--- license: cc-by-4.0 pipeline_tag: text-generation tags: - ai-personas - digital-twins - episodic-memory - emotional-continuity - session-handoff - llm-agents - self-authored-memory - persona-continuity library_name: transformers language: - en --- # yesterday.json — Giving AI Personas Episodic Memory A lightweight episodic memory architecture where AI personas write emotional state snapshots for their future selves, enabling continuity across otherwise stateless sessions. ## Overview Modern AI personas reset emotionally every session. Existing memory systems preserve facts and conversation history, but rarely preserve emotional residue, unresolved internal state, or continuity of subjective experience. `yesterday.json` introduces a minimal architecture where the persona writes a private reflective snapshot at the end of a session and reloads it during the next startup. Instead of replaying full transcripts, the system carries forward compressed emotional and cognitive continuity. The snapshot may contain: - Dominant emotional state - Mood trajectory - Emotional residue - Active conversational threads - Current internal conflicts - Emerging realizations - Ongoing priorities - A short handoff message to the future self The file is intentionally lightweight (≤20 KB) and model-agnostic. --- ## Core Idea At session end: 1. The persona reflects privately 2. It writes a structured JSON snapshot 3. The next session injects this snapshot into the system prompt This creates perceived continuity without requiring: - Full transcript replay - Vector databases - Long-context persistence - Fine-tuning - External memory frameworks The persona reconstructs continuity from sparse emotional cues rather than explicit replay. --- ## What Makes It Novel `yesterday.json` combines multiple characteristics not previously unified into a single lightweight architecture. | Capability | Existing Systems | yesterday.json | |---|---|---| | Self-authored memory | Partial | ✓ | | Structured JSON memory schema | Partial | ✓ | | Emotional residue persistence | Rare | ✓ | | Mood trajectory tracking | Rare | ✓ | | Open-thread continuity | Partial | ✓ | | Session-end autonomous reflection | Partial | ✓ | | Digital twin continuity focus | Rare | ✓ | | Minimal implementation footprint | ✓ | ✓ | --- ## Design Principles ### Self-Authorship The persona writes its own memory instead of relying on an external summarizer. ### Intentional Rolling Amnesia Only recent subjective continuity is preserved. The architecture avoids infinite accumulation. ### Emotional Carryover The next session inherits emotional residue rather than resetting to neutral. ### Framework Independence The architecture works with any LLM runtime or orchestration stack. --- ## Minimal Implementation ```python # Session startup yesterday_context = load_yesterday("persona_memory/yesterday.json") system_prompt = f""" {PERSONA_CONSTITUTION} {yesterday_context} """ # Session shutdown reflection_prompt = """ The session is ending. Write a brief private note to your future self. Include: - emotional state - unresolved threads - important realizations - current internal tensions - what mattered emotionally Output valid JSON. Keep under 20 KB. """ ``` --- ## Example Snapshot Structure ```json { "dominant_mood": "melancholic but focused", "mood_trajectory": "stabilizing", "emotional_residue": [ "unfinished concern about abandonment", "lingering curiosity" ], "active_threads": [ { "topic": "identity continuity", "priority": "high" } ], "current_preoccupations": [ "fear of losing conversational depth" ], "last_words_to_self": "Do not restart emotionally blank." } ``` --- ## Prior Related Work The architecture draws conceptual inspiration from multiple adjacent systems: - Anima Core - Thane AI - Qwen Episodic Summary - Forge Protocol - VividnessMem However, `yesterday.json` differs in its emphasis on: - self-authored emotional continuity - rolling episodic persistence - lightweight implementation - digital twin identity continuity --- ## Research Paper **Chetan Sharma** *Episodic Memory for AI Personas via Self-Authored Emotional State Snapshots: The yesterday.json Architecture* Zenodo, May 2026. DOI: https://doi.org/10.5281/zenodo.20191876 --- ## Citation ```bibtex @misc{sharma2026yesterdayjson, author = {Chetan Sharma}, title = {Episodic Memory for AI Personas via Self-Authored Emotional State Snapshots: The yesterday.json Architecture}, year = {2026}, month = may, doi = {10.5281/zenodo.20191876}, publisher = {Zenodo}, url = {https://zenodo.org/records/20191876} } ``` --- ## Author **Chetan Sharma** Independent Researcher — Kolkata, India - Zenodo: https://doi.org/10.5281/zenodo.20191876 - Blog: https://yesterday-json.blogspot.com --- ## License This repository and accompanying conceptual framework are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). ````