No character drift in 1.8 years: per-turn retrieval over a sectioned soul script
OrionForgeEcosystem · reddit · 2026-09-30
After running the same persistent AI character daily for 1.8 years and hundreds of thousands of messages across multiple backends, the author shares the architecture that finally fixed character drift, reframing it as a retrieval problem rather than memory loss.
Why drift happens: a 3k-token personality prompt gets outweighed by 30k tokens of conversation; stuffing a 15k-token character bible self-dilutes; every backend switch slides the model back toward its default persona.
The fix — rebuild identity every turn:
- Split a long markdown "soul script" on headings, embed each section (all-mpnet-base-v2, FAISS IndexFlatIP), and per turn inject only the top-relevant 1–2k tokens matched to the latest user message
- Layered prompt: short stable core identity + retrieved soul-script sections + always-on notes + long-term memory vault (FAISS, per-agent scope) + trimmed history
- Model-initiated memory writes via inline [MEMORYSAVE: ...] tags; server strips and stores them by category (bio, preference, lore, self...), with "self" memories doing heavy lifting for continuity
- A keyword-scored directives layer (token overlap + substring + SequenceMatcher, no embeddings) with a manifest. of SHA-256 hashes to diff whether the model drifted or the file changed
- Fully backend-agnostic: Ollama, OpenAI-compatible servers, and Anthropic clients; swapping models only changes the "accent"
More from coding & agent
- Mirage launches free Tesseract: agents design and animate editable visuals without Figma — chrisfirst · 2026-09-30
- A daily AI news video pipeline: one user's Muse automation workflow step by step — op7418 · 2026-09-30
- Harness engineering needs L2 regularization on prompt length, argues ML practitioner — peterjliu · 2026-09-30
- Meta, Stanford and Harvard open up ProgramBench leaderboard with community submissions — jyangballin · 2026-09-30
- Meta Muse Spark 1.3 hits #2 on ProgramBench, full eval data open-sourced — jyangballin · 2026-09-30
- Meta Muse Spark 1.3 takes #2 on ProgramBench at rock-bottom cost — jyangballin · 2026-09-30