back to home

aikohanasaki / SillyTavern-MemoryBooks

Saves SillyTavern chat memories to lorebooks

View on GitHub
162 stars
20 forks
2 issues

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing aikohanasaki/SillyTavern-MemoryBooks in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/aikohanasaki/SillyTavern-MemoryBooks)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

📕 Memory Books (A SillyTavern Extension) 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. ❓ Vocabulary • Scene → Memory • Many Scenes → Arc Summary • Always-On → Side Prompt (Tracker) ❗ Read Me First! 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 --- 📚 Power Up with Lorebook Ordering (STLO) 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 folder for list. Internaional/localized Readme and User Guides can be found in the folder. > Lorebook converter and side prompt template library are in the folder. --- 📋 Prerequisites • **SillyTavern:** 1.14.0+ (latest recommended) • **Scene Selection:** Start and end markers (start 💡 Think of arc summaries as *season recaps*, not scene logs. When to use Arc Summaries • 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 Beta Notes • 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 --- 📝 Memory Generation **JSON-Only Output** All prompts and presets **must** instruct the AI to return only valid JSON, e.g.: **No other text is allowed in the response.** **Built-in Presets** • **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. **Custom Prompts** • Create your own, but **must** return valid JSON as above. --- 📚 Lorebook Integration • **Automatic Entry Creation:** New memories are stored as entries with all metadata. • **Flag-Based Detection:** Only entries with the flag are recognized as memories. • **Auto-Numbering:** Sequential, zero-padded numbering with multiple supported formats ( , , , ). • **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 flag and required fields. --- 🎡 Trackers & Side Prompts Side Prompts can be used like trackers and create separate side-prompt 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?") **Access:** From the Memory Books settings, click “🎡 Trackers & Side Prompts”. **Features:** • 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, depending on the template. • Use standard SillyTavern macros like and in side prompt and . • Use custom runtime macros like , which are supplied when you run . **Usage Tips:** • When creating a new prompt, you can copy from built-ins for best compatibility. • Manual syntax is . • Once you choose a side prompt in slash-command autocomplete, STMB will suggest any required runtime macros for that template. • Side prompts with custom runtime macros are manual-only. STMB strips and from those templates on save/import and warns you with a toast. • Additional Side Prompts Template Library JSON file - just import to use --- 🧠 Regex Integration for Advanced Customization • **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. --- 👤 Profile Management • **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. --- ⚙️ Settings…