Living Memory V3.2 - Long Campaign & NPC Edition
# Living Memory v3.3 โLong Campaign & NPC Edition *Your story evolves. Your characters remember. Your past matters.* **Living Memory** is an advanced memory management script for AI Dungeon, designed to preserve campaign history, track NPC relationships, and maintain long-term story continuity across hundreds or thousands of actions. Ever defeated a powerful enemy, developed a meaningful relationship, or experienced a major story event, only for the AI to forget about it twenty actions later? Living Memory is designed to address that problem. By maintaining persistent historical records, protected milestone memories, and individual NPC memory cards, Living Memory helps ensure that important events from your adventure continue to influence the story long after they occur. ## Key Features **๐ Campaign Chronicle & AI Summary Integration** Maintains a historical record of significant campaign events, including major battles, discoveries, important decisions, and character interactions. Also attempts to integrate AI Dungeon's native Story Summary when available. **๐ง Individual NPC Memory Cards** Automatically creates dedicated memory Story Cards for configured NPCs, tracking their significant experiences, relationship developments, and established knowledge of past events. **๐ Persistent Relationship Memories** Preserves meaningful relationship milestones, including romantic developments, intimate encounters, promises, betrayals, reconciliations, and major emotional experiences. **๐ Protected Milestone Archive** Stores important historical events separately from ordinary memories, preventing them from being removed during standard archive cleanup. Supports up to 5,000 protected milestones, with additional safeguards prioritizing the earliest 1,000 significant records. **โ๏ธ Long-Term Campaign Continuity** Remembers important achievements and developments beyond the recent-story context window, helping early campaign events remain relevant even thousands of actions later. **๐๏ธ NPC Knowledge Tracking** Associates memories with characters who participated in, witnessed, or learned about events. Helps prevent NPCs from automatically knowing information they haven't encountered in the written story. **๐ Intelligent Memory Prioritization** Selects relevant historical memories based on active NPCs and significant campaign developments. By default, the system prioritizes up to: - 20 core memories per NPC - 8 recent memories per NPC - 8 global campaign memories A 6,000-character recall budget determines how much historical information can be injected into the AI's context. **โณ Delayed Memory Recording** Waits eight actions before committing new events, allowing players to retry, edit, or backtrack recent AI responses without immediately preserving unwanted story developments. **โ๏ธ In-Game Configuration** Automatically creates a **Living Memory - Configure** Story Card, allowing players to add NPCs and customize memory limits, recording delays, and recall settings without editing the script. **๐ญ Player-Centered Storytelling** Designed to support second-person narration without generating private first-person NPC thoughts or shifting the narrative away from the player character. **๐งน Optimized Context Management** Automatically manages memory injection to prevent duplicate recall blocks from accumulating and unnecessarily consuming context space. ## How It Works Living Memory monitors completed story actions and identifies significant events using rule-based detection. After a configurable delay, recognized events are stored in persistent adventure data and organized into campaign and NPC memory records. Important milestones receive additional protection against automatic deletion. When relevant characters return or related events occur, Living Memory selects historical records and injects them into the AI's context, helping the storyteller maintain continuity with established events and relationships. ## Recommended Setup For best results: - Enable AI Dungeon's native Memory Bank and Auto Summarization. - Add important NPC names to the Living Memory configuration card. - Use a story model with sufficient context capacity. - Keep second-person narration enabled for player-centered adventures. ## Limitations & Compatibility Living Memory does not independently generate AI-written summaries. It uses rule-based event detection and attempts to reuse AI Dungeon's native Story Summary when accessible. Not every significant event will necessarily be detected, and persistent storage does not guarantee that every archived memory will appear in every AI response. The script's protected archive has finite capacity, and the AI's available context window limits how much history can be recalled at once.
