Automatic Chapter Summaries
Keeps long-running stories coherent by saving chapter summaries to a lorebook, keeping recent chapters in story context, and progressively condensing older memory to stay within a token budget.
Description
The script automatically creates and maintains long-term chapter memory for your stories. Recent chapters can remain directly in the Story Context, while older chapters are summarized into the Lorebook and progressively condensed as the story grows.
Optional TA Generation Helper: If Automatic Chapter Summaries exhausts its own output token budget, an available helper can continue summary, regeneration, and condensation generations. You can find it in the Resources section.
Have feedback, questions, or suggestions? Join the discussion on Discord.
What Does It Do?
- Automatic Chapter Summaries - Summarizes completed chapters once they move beyond the Recent Story Buffer
- Recent Story Buffer - Keeps your newest chapters as raw story while they are still expected to remain available in the Story Context
- Progressive Condensation - Compresses older summary memory as your story grows
- Change Detection - Detects edits to previously summarized chapters and can regenerate them
- History-Aware Tracking - Keeps summary state aligned across story history and branching edits
- Trim Anchor - Helps reconnect chapter numbering after older story text has been manually trimmed
- TA Generation Helper Support - Can continue summary, regeneration, and condensation generations through an available helper when the main script has exhausted its output token budget
- Manual Controls - Rebuild, regenerate, condense, uncondense, and customize specific ranges
- Summary Controls - Configure narration style, protagonist reference, prompts, and optional post-processing
How It Works
- Write your story normally in the Editor
- End chapters using your configured chapter break token, such as
*** - Continue writing
- The newest chapters stay in the Recent Story Buffer
- Once a completed chapter falls behind that buffer, the script creates a durable summary in the configured Lorebook category
- As summary memory grows, older summaries are progressively condensed to stay within the configured token budget
By default, the newest 7 visible chapters are kept as raw story because they are expected to remain available in the Story Context.
Set the Recent Story Buffer to 0 if you prefer to summarize every completed chapter immediately.
The configured Lorebook category is created automatically if it does not already exist.
Trim Anchor
If you manually remove older story text and chapter tracking loses its place, set the Trim Anchor to the last chapter already covered by your summaries.
For example:
Trim Anchor: 20
The script uses that as a reference point to reconnect the remaining story and then continues tracking new chapters automatically.
You normally only need to set this once after trimming.
Progressive Condensation
Older summary memory is compressed gradually as needed:
- recent summarized chapters stay detailed when possible;
- older detailed summaries are grouped into condensed ranges;
- older condensed ranges can be merged again if more space is needed.
Condensed ranges can also be restored with Uncondense.
Change Detection & Regeneration
If a previously summarized chapter is edited, the script can detect the change and regenerate its summary.
You can use:
- Automatic mode to regenerate changed summaries automatically
- Semi-Automatic mode to review changes before regenerating
TA Generation Helper
When available, a TA Generation Helper can continue maintenance generations after the main script has exhausted its own output token budget.
This includes summary generation, regeneration, and condensation work.
The script continues to work normally without a compatible helper.
Rebuild & Recovery
Rebuild All Summaries can rescan the current story, reuse valid summaries, and regenerate anything that is missing or outdated.
The script also keeps rebuild backups and can recover from interrupted maintenance.
Scope Information
License & Attribution
Similar Scripts
Character Commentator
Get Hypebot messages from the characters in the current story.
Prose Coach
Prompt used for the lightweight General Coach observation.
Mid-Gen Lorebook Injector
Monitors generation for Lorebook keywords (including complex A & B logic) and restarts generation immediately to force context injection.
RPG Stats V2
Automatically detects +/- patterns and updates stats accordingly