How Sliding Window Context Management works
mainTo prevent context window overflow (common in LLMs at 4K-32K tokens) as a novel grows to 50+ chapters, AI Novelist automatically manages the prompt context:
- Recent Chapters: Full summaries of the last 3 chapters are preserved.
- Older Chapters: Earlier chapters are automatically compressed into a 200-word "long-term arc" summary.
- Worldview: The worldview context is automatically truncated at the head and tail if it exceeds 4000 words.
This ensures that the prompt size for Chapter 50 remains similar to Chapter 5, maintaining high generation quality without crashing the LLM.