A next-generation SillyTavern extension for automatic, structured, and reliable memory creation. Mark scenes in chat, generate JSON-based summaries with AI, and store them as "vectorized" entries in your lorebooks. Supports group chats, advanced profile management, and bulletproof API/model handling.
- Scene β Memory
- Many Scenes β Arc Summary
- Always-On β Side Prompt (Tracker)
Start here:
β οΈ βΌοΈ Please read prerequisites for installation notes (especially if you run Text Completion API)- π½οΈ Quickstart Video - English only (sorry, that's the language I am most fluent in)
- β Frequently Asked Questions
- π οΈ Troubleshooting
Other links:
- π User Guide (EN)
- π Version History & Changelog
- π‘ Using π Memory Books with π Lorebook Ordering
For advanced memory organization and deeper story integration, we highly recommend using STMB together with SillyTavern-LorebookOrdering (STLO). See the guide for best practices, setup instructions, and tips!
Note: Supports various languages: see
/localesfolder for list. Internaional/localized Readme and User Guides can be found in the/userguidesfolder. Lorebook converter and side prompt template library are in the/resourcesfolder.
- SillyTavern: 1.14.0+ (latest recommended)
- Scene Selection: Start and end markers (start < end) must be set.
- Chat Completion Support: Full support for OpenAI, Claude, Anthropic, OpenRouter, or other chat completion API.
- Text Completion Support: Text completion APIs (Kobold, TextGen, etc.) are supported when connected via a Chat Completion (OpenAI-compatible) API endpoint. I recommend setting up a Chat Completion API connection according to the KoboldCpp tips below (change as needed if you are Ollama or other software). After that, set up an STMB profile and use Custom (recommended) or full manual configuration (only if Custom fails or you have more than one custom connection). NOTE: Please note that if you use Text Completion, you must have a chat completion preset!
Set this up in ST (you can change back to Text Completion AFTER you get STMB working)
- Chat Completion API
- Custom chat completion source
http://localhost:5001/v1endpoint (you can also use127.0.0.1:5000/v1)- enter anything in "custom API key" (doesn't matter, but ST requires one)
- model ID must be
koboldcpp/modelname(don't put .gguf in the model name!) - download a chat completion preset and import it (any one will do) just so you HAVE a chat completion preset. It avoids errors from "not supported"
- change the max response length on the chat completion preset so that it is at least 2048; 4096 is recommended. (Smaller means you run the risk of getting cut off.)
Just like Kobold, set the following up as a Chat Completion API in ST (you can change back to Chat Completion after you've verified STMB is working):
- Create a new connection profile for a Chat Completion API
- Completion Source:
Custom (Open-AI Compatible) - Endpoint URL:
http://host.docker.internal:8080/v1if running ST in docker, elsehttp://localhost:8080/v1 - Custom API key: enter anything (ST requires one)
- Model ID:
llama2-7b-chat.gguf(or your model, doesn't matter if you're not running more than one in llama.cpp) - Prompt post-processing: none
For starting Llama.cpp, I recommend placing something similar to the following in a shell script or bat file, so startup is easier:
llama-server -m <model-path> -c <context-size> --port 8080- Match Whole Words: leave unchecked (false)
- Scan Depth: higher is better (mine is set to 8)
- Max Recursion Steps: 2 (general recommendation, not required)
- Context %: 80% (based on a context window of 100,000 tokens) - assumes you don't have super-heavy chat history or bots.
- Additional note: If the memory lorebook is your only lorebook, disable 'Delay until recursion' in the STMB profile or the memories will not trigger!
- Load SillyTavern and select a character or group chat.
- Wait for the chevron buttons (βΊ β) to appear on chat messages (may take up to 10 seconds).
- Click βΊ on the first message of your scene.
- Click β on the last message.
- Open the Extensions menu (the magic wand πͺ) and click "Memory Books", or use
/creatememoryslash command. - Confirm settings (profile, context, API/model) if prompted.
- Wait for AI generation and automatic lorebook entry.
/creatememorywill use existing chevron start/end markers to create a memory/scenememory x-ywill make a memory starting with message x and ending with message y/nextmemorywill make a memory with all messages since the last memory.
- All features work with group chats.
- Scene markers, memory creation, and lorebook integration are stored in group metadata.
- No special setup requiredβjust select a group chat and use as normal.
- How it works: Automatically uses the lorebook that is bound to your current chat.
- Best for: Simplicity and speed. Most users should start here.
- To use: Ensure a lorebook is selected in the "Chat Lorebooks" dropdown for your character or group chat.
- How it works: Automatically creates and binds a new lorebook when none exists, using your custom naming template.
- Best for: New users and quick setup. Perfect for one-click lorebook creation.
- To use:
- Enable "Auto-create lorebook if none exists" in the extension's settings.
- Configure your naming template (default: "LTM - {{char}} - {{chat}}").
- When you create a memory without a bound lorebook, one is automatically created and bound.
- Template placeholders: {{char}} (character name), {{user}} (your name), {{chat}} (chat ID)
- Smart numbering: Automatically adds numbers (2, 3, 4...) if duplicate names exist.
- Note: Cannot be used simultaneously with Manual Lorebook Mode.
- How it works: Allows you to select a different lorebook for memories on a per-chat basis, ignoring the main chat-bound lorebook.
- Best for: Advanced users who want to direct memories to a specific, separate lorebook.
- To use:
- Enable "Enable Manual Lorebook Mode" in the extension's settings.
- The first time you create a memory in a chat, you will be prompted to choose a lorebook.
- This choice is saved for that specific chat until you clear it or switch back to Automatic Mode.
- Note: Cannot be used simultaneously with Auto-Create Lorebook Mode.
π Memory Books supports two levels of narrative memory, each designed for different kinds of continuity.
Scene memories capture what happened in a specific range of messages.
- Based on explicit scene selection (βΊ β)
- Ideal for moment-to-moment recall
- Preserves dialogue, actions, and immediate outcomes
- Best used frequently
This is the standard and most commonly used memory type.
Arc summaries capture what changed over time across multiple scenes.
Instead of summarizing events, arc summaries focus on:
- Character development and relationship shifts
- Long-term goals, tensions, and resolutions
- Emotional trajectory and narrative direction
- Persistent state changes that should remain stable
Arc summaries are higher-level, lower-frequency memories designed to prevent character drift and narrative loss in long-running chats.
π‘ Think of arc summaries as season recaps, not scene logs.
- After a major relationship shift
- At the end of a story chapter or arc
- When motivations, trust, or power dynamics change
- Before starting a new phase of the story
- Arc summaries are prompt-sensitive and intentionally conservative
- Recommended to review before committing to lorebook
- Best paired with lower-priority or meta-style lorebook entries
Arc summaries are generated from existing scene memories, not directly from raw chat.
This gives you:
- reduce token usage
- AI has better understanding of the narrative flow
All prompts and presets must instruct the AI to return only valid JSON, e.g.:
{
"title": "Short scene title",
"content": "Detailed summary of the scene...",
"keywords": ["keyword1", "keyword2"]
}No other text is allowed in the response.
- Summary: Detailed beat-by-beat summaries.
- Summarize: Markdown headers for timeline, beats, interactions, outcome.
- Synopsis: Comprehensive, structured markdown.
- Sum Up: Concise beat summary with timeline.
- Minimal: 1-2 sentence summary.
- Create your own, but must return valid JSON as above.
- Automatic Entry Creation: New memories are stored as entries with all metadata.
- Flag-Based Detection: Only entries with the
stmemorybooksflag are recognized as memories. - Auto-Numbering: Sequential, zero-padded numbering with multiple supported formats (
[000],(000),{000},#000). - Manual/Automatic Order: Per-profile insertion order settings.
- Editor Refresh: Optionally auto-refreshes the lorebook editor after adding a memory.
Existing memories must be converted! Use the Lorebook Converter to add the
stmemorybooksflag and required fields.
Side Prompts can be used like trackers and will create entries in your memory lorebook. Side Prompts allow you to track ongoing state, not just past events. For example:
- π° Inventory & Resources ("What items does the user have?")
- β€οΈ Relationship Status ("How does X feel about Y?")
- π Character Stats ("Current health, skills, reputation")
- π― Quest Progress ("What goals are active?")
- π World State ("What's changed in the setting?")
- View all side prompts.
- Create new or duplicate prompts to experiment with different prompt styles.
- Edit or delete any preset (including built-ins).
- Export and import presets as JSON files for backup or sharing.
- Run them manually or automatically with memory creation.
- When creating a new prompt, you can copy from built-ins for best compatibility.
- Additional Side Prompts Template Library JSON file - just import to use
- Full Control Over Text Processing: Memory Books now integrates with SillyTavern's Regex extension, allowing you to apply powerful text transformations at two key stages:
- Prompt Generation: Automatically modify the prompts sent to the AI by creating regex scripts that target the User Input placement.
- Response Parsing: Clean, reformat, or standardize the AI's raw response before it's saved by targeting the AI Output placement.
- Multi-Select Support: You can now multi-select regex scripts. All enabled scripts will be applied in sequence at each stage (Prompt Generation and Response Parsing), allowing for advanced and flexible transformations.
- How It Works: The integration is seamless. Simply create and enable (multi-select) your desired scripts in the Regex extension, and Memory Books will apply them automatically during memory and side prompt creation.
- Profiles: Each profile includes API, model, temperature, prompt/preset, title format, and lorebook settings.
- Import/Export: Share profiles as JSON.
- Profile Creation: Use the advanced options popup to save new profiles.
- Per-Profile Overrides: Temporarily switch API/model/temp for memory creation, then restore your original settings.
Short video overview on Youtube
- Manual Lorebook Mode: Enable to select lorebooks per chat.
- Auto-create lorebook if none exists: β New in v4.2.0 - Automatically create and bind lorebooks using your naming template.
- Lorebook Name Template: β New in v4.2.0 - Customize auto-created lorebook names with {{char}}, {{user}}, {{chat}} placeholders.
- Allow Scene Overlap: Permit or prevent overlapping memory ranges.
- Always Use Default Profile: Skip confirmation popups.
- Show memory previews: Enable preview popup to review and edit memories before adding to lorebook.
- Show Notifications: Toggle toast messages.
- Refresh Editor: Auto-refresh lorebook editor after memory creation.
- Token Warning Threshold: Set warning level for large scenes (default: 30,000).
- Default Previous Memories: Number of prior memories to include as context (0-7).
- Auto-create memory summaries: Enable automatic memory creation at intervals.
- Auto-Summary Interval: Number of messages after which to automatically create a memory summary (10-200, default: 100).
- Memory Title Format: Choose or customize (see below).
- Name: Display name.
- API/Provider: openai, claude, custom, etc.
- Model: Model name (e.g., gpt-4, claude-3-opus).
- Temperature: 0.0β2.0.
- Prompt or Preset: Custom or built-in.
- Title Format: Per-profile template.
- Activation Mode: Vectorized, Constant, Normal.
- Position: βChar, βChar, βEM, βEM, βAN, βAN, Outlet (and field name).
- Order Mode: Auto/manual.
- Recursion: Prevent/delay until recursion.
Customize the titles of your lorebook entries using a powerful template system.
- Placeholders:
{{title}}- The title generated by the AI (e.g., "A Fateful Encounter").{{scene}}- The message range (e.g., "Scene 15-23").{{char}}- The character's name.{{user}}- Your user name.{{messages}}- The number of messages in the scene.{{profile}}- The name of the profile used for generation.- Current date/time placeholders in various formats (e.g.,
August 13, 2025for date,11:08 PMfor time).
- Auto-numbering: Use
[0],[00],(0),{0},#0, and now also the wrapped forms like#[000],([000]),{[000]}for sequential, zero-padded numbering. - Custom Formats: You can create your own formats. As of v4.5.1, all printable Unicode characters (including emoji, CJK, accented, symbols, etc.) are allowed in titles; only Unicode control characters are blocked.
- Include up to 7 previous memories as context for better continuity.
- Token estimation includes context memories for accuracy.
- Button States:
- Inactive, active, valid selection, in-scene, processing.
- Accessibility:
- Keyboard navigation, focus indicators, ARIA attributes, reduced motion, mobile-friendly.
Settings are located in the Extensions menu (the magic wand πͺ to the left of your input box). Look for "Memory Books".
The π entry in world info is named "vectorized" in ST's UI. This is why I use the world vectorized. If you don't use the vectors extension (I don't), it works via keywords. This is all automated so that you don't have to think about what keywords to use.
Should I make a separate lorebook for memories, or can I use the same lorebook I'm already using for other things?
I recommend that your memory lorebook be a separate book. This makes it easier to organize memories (vs other entries). For example, adding it to a group chat, using it in another chat, or setting an individual lorebook budget (using STLO).
No. If there are no other world info or lorebooks, selecting 'Delay until recursion' may prevent the first loop from triggering, causing nothing to activate. If Memory Books is the sole lorebook, either disable 'Delay until recursion' or ensure at least one additional world info/lorebook is configured.
-
No lorebook available or selected:
- In Manual Mode, select a lorebook when prompted.
- In Automatic Mode, bind a lorebook to your chat.
- Or enable "Auto-create lorebook if none exists" for automatic creation.
-
No scene selected:
- Mark both start (βΊ) and end (β) points.
-
Scene overlaps with existing memory:
- Choose a different range, or enable "Allow scene overlap" in settings.
-
AI failed to generate valid memory:
- Use a model that supports JSON output.
- Check your prompt and model settings.
-
Token warning threshold exceeded:
- Use a smaller scene, or increase the threshold.
-
Missing chevron buttons:
- Wait for extension to load, or refresh.
-
Character data not available:
- Wait for chat/group to fully load.
- Allowed in titles: All printable Unicode characters are allowed, including accented letters, emoji, CJK, and symbols.
- Blocked: Only Unicode control characters (U+0000βU+001F, U+007FβU+009F) are blocked; these are removed automatically.
See Character Policy Details for examples and migration notes.
This extension uses Bun for building. The build process minifies and bundles the source files.
# Build the extension
bun run buildThe project includes a pre-commit hook that automatically builds the extension and includes the build artifacts in your commits. This ensures the built files are always in sync with the source code.
To install the git hook:
bun run install-hooksThe hook will:
- Run
bun run buildbefore each commit - Add build artifacts to the commit
- Abort the commit if the build fails
Developed with love using VS Code/Cline, extensive testing, and community feedback. π€π










