Transcrypto commited on
Commit
e82fb43
Β·
verified Β·
1 Parent(s): 6ba6139

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +192 -39
README.md CHANGED
@@ -1,67 +1,220 @@
 
1
  ---
2
  license: cc-by-4.0
3
  pipeline_tag: text-generation
4
  tags:
5
- - ai-personas
6
- - digital-twins
7
- - episodic-memory
8
- - emotional-continuity
9
- - session-handoff
10
- - llm-agents
11
- - self-authored-memory
12
- - persona-continuity
13
  library_name: transformers
14
  language:
15
- - en
16
  ---
17
 
18
  # yesterday.json β€” Giving AI Personas Episodic Memory
19
 
20
- A lightweight (≀20 KB) episodic memory architecture where AI personas write their own emotional state snapshots at session end and read them at next startup, enabling emotional continuity across session boundaries.
 
 
21
 
22
  ## Overview
23
 
24
- AI personas wake up blank. Every session is a cold start. Existing memory systems store *what happened* but systematically discard *how the interaction felt*. The yesterday.json architecture closes this gap.
 
 
 
 
25
 
26
- At the end of every session, the persona is prompted to write a brief, private note to its future self β€” a single JSON file (≀20 KB) containing:
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
- - **Emotional signature:** dominant mood, mood trajectory, emotional residue
29
- - **Open threads:** what was being discussed, current position, priority
30
- - **Decisions and insights:** conclusions reached, realizations
31
- - **Self-state snapshot:** current preoccupations, internal conflicts, mood susceptibility
32
- - **Last words:** a one-line handoff to tomorrow
33
 
34
- At the start of the next session, this snapshot is injected into the system prompt alongside the persona's permanent psychological constitution. The persona doesn't need a full transcript β€” it has *glimpses*, and its own cognitive architecture fills in the rest.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  ## What Makes It Novel
37
 
38
- yesterday.json is the first system to combine six specific features:
 
 
 
 
 
 
 
 
 
 
 
39
 
40
- | Feature | Existing Work | yesterday.json |
41
- |--------|:---:|:---:|
42
- | Self-authored by the persona | Thane, Anima | βœ“ |
43
- | JSON-structured schema | Qwen Episodic Summary | βœ“ |
44
- | Emotional signature + mood trajectory | Forge (YAML), VividnessMem (weights) | βœ“ |
45
- | Open thread tracking with priority | Qwen (tasks only) | βœ“ |
46
- | Session-end automatic trigger | Qwen, Anima | βœ“ |
47
- | Designed for digital twin identity continuity | β€” | βœ“ |
 
 
 
 
 
 
 
48
 
49
- ## Key Design Choices
50
 
51
- - **Self-authorship:** The persona writes its own memory β€” no external summarizer.
52
- - **Intentional rolling amnesia:** Only the most recent session is preserved, mimicking human short-term memory.
53
- - **Emotional carryover:** If yesterday ended in melancholy, tomorrow begins with its residue β€” not a blank slate.
54
- - **No model retraining required:** Works with any LLM, any framework, any runtime.
55
 
56
  ## Minimal Implementation
57
 
58
  ```python
59
- # At session start: inject yesterday's state
60
  yesterday_context = load_yesterday("persona_memory/yesterday.json")
61
- system_prompt = f"{PERSONA_CONSTITUTION}\n\n{yesterday_context}"
62
 
63
- # At session end: persona reflects and writes
64
- reflection_prompt = """The session is ending. Write a brief private note
65
- to your future self. Include what mattered emotionally, what remains
66
- unresolved, and what you were in the middle of. Output as JSON.
67
- Keep it under 20 KB."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ````markdown
2
  ---
3
  license: cc-by-4.0
4
  pipeline_tag: text-generation
5
  tags:
6
+ - ai-personas
7
+ - digital-twins
8
+ - episodic-memory
9
+ - emotional-continuity
10
+ - session-handoff
11
+ - llm-agents
12
+ - self-authored-memory
13
+ - persona-continuity
14
  library_name: transformers
15
  language:
16
+ - en
17
  ---
18
 
19
  # yesterday.json β€” Giving AI Personas Episodic Memory
20
 
21
+ A lightweight episodic memory architecture where AI personas write emotional state snapshots for their future selves, enabling continuity across otherwise stateless sessions.
22
+
23
+ ---
24
 
25
  ## Overview
26
 
27
+ 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.
28
+
29
+ `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.
30
+
31
+ Instead of replaying full transcripts, the system carries forward compressed emotional and cognitive continuity.
32
 
33
+ The snapshot may contain:
34
+
35
+ - Dominant emotional state
36
+ - Mood trajectory
37
+ - Emotional residue
38
+ - Active conversational threads
39
+ - Current internal conflicts
40
+ - Emerging realizations
41
+ - Ongoing priorities
42
+ - A short handoff message to the future self
43
+
44
+ The file is intentionally lightweight (≀20 KB) and model-agnostic.
45
+
46
+ ---
47
 
48
+ ## Core Idea
 
 
 
 
49
 
50
+ At session end:
51
+
52
+ 1. The persona reflects privately
53
+ 2. It writes a structured JSON snapshot
54
+ 3. The next session injects this snapshot into the system prompt
55
+
56
+ This creates perceived continuity without requiring:
57
+
58
+ - Full transcript replay
59
+ - Vector databases
60
+ - Long-context persistence
61
+ - Fine-tuning
62
+ - External memory frameworks
63
+
64
+ The persona reconstructs continuity from sparse emotional cues rather than explicit replay.
65
+
66
+ ---
67
 
68
  ## What Makes It Novel
69
 
70
+ `yesterday.json` combines multiple characteristics not previously unified into a single lightweight architecture.
71
+
72
+ | Capability | Existing Systems | yesterday.json |
73
+ |---|---|---|
74
+ | Self-authored memory | Partial | βœ“ |
75
+ | Structured JSON memory schema | Partial | βœ“ |
76
+ | Emotional residue persistence | Rare | βœ“ |
77
+ | Mood trajectory tracking | Rare | βœ“ |
78
+ | Open-thread continuity | Partial | βœ“ |
79
+ | Session-end autonomous reflection | Partial | βœ“ |
80
+ | Digital twin continuity focus | Rare | βœ“ |
81
+ | Minimal implementation footprint | βœ“ | βœ“ |
82
 
83
+ ---
84
+
85
+ ## Design Principles
86
+
87
+ ### Self-Authorship
88
+
89
+ The persona writes its own memory instead of relying on an external summarizer.
90
+
91
+ ### Intentional Rolling Amnesia
92
+
93
+ Only recent subjective continuity is preserved. The architecture avoids infinite accumulation.
94
+
95
+ ### Emotional Carryover
96
+
97
+ The next session inherits emotional residue rather than resetting to neutral.
98
 
99
+ ### Framework Independence
100
 
101
+ The architecture works with any LLM runtime or orchestration stack.
102
+
103
+ ---
 
104
 
105
  ## Minimal Implementation
106
 
107
  ```python
108
+ # Session startup
109
  yesterday_context = load_yesterday("persona_memory/yesterday.json")
 
110
 
111
+ system_prompt = f"""
112
+ {PERSONA_CONSTITUTION}
113
+
114
+ {yesterday_context}
115
+ """
116
+
117
+ # Session shutdown
118
+ reflection_prompt = """
119
+ The session is ending.
120
+
121
+ Write a brief private note to your future self.
122
+ Include:
123
+ - emotional state
124
+ - unresolved threads
125
+ - important realizations
126
+ - current internal tensions
127
+ - what mattered emotionally
128
+
129
+ Output valid JSON.
130
+ Keep under 20 KB.
131
+ """
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Example Snapshot Structure
137
+
138
+ ```json
139
+ {
140
+ "dominant_mood": "melancholic but focused",
141
+ "mood_trajectory": "stabilizing",
142
+ "emotional_residue": [
143
+ "unfinished concern about abandonment",
144
+ "lingering curiosity"
145
+ ],
146
+ "active_threads": [
147
+ {
148
+ "topic": "identity continuity",
149
+ "priority": "high"
150
+ }
151
+ ],
152
+ "current_preoccupations": [
153
+ "fear of losing conversational depth"
154
+ ],
155
+ "last_words_to_self": "Do not restart emotionally blank."
156
+ }
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Prior Related Work
162
+
163
+ The architecture draws conceptual inspiration from multiple adjacent systems:
164
+
165
+ - Anima Core
166
+ - Thane AI
167
+ - Qwen Episodic Summary
168
+ - Forge Protocol
169
+ - VividnessMem
170
+
171
+ However, `yesterday.json` differs in its emphasis on:
172
+
173
+ - self-authored emotional continuity
174
+ - rolling episodic persistence
175
+ - lightweight implementation
176
+ - digital twin identity continuity
177
+
178
+ ---
179
+
180
+ ## Research Paper
181
+
182
+ **Chetan Sharma**
183
+ *Episodic Memory for AI Personas via Self-Authored Emotional State Snapshots: The yesterday.json Architecture*
184
+ Zenodo, May 2026.
185
+
186
+ DOI: https://doi.org/10.5281/zenodo.20191876
187
+
188
+ ---
189
+
190
+ ## Citation
191
+
192
+ ```bibtex
193
+ @misc{sharma2026yesterdayjson,
194
+ author = {Chetan Sharma},
195
+ title = {Episodic Memory for AI Personas via Self-Authored Emotional State Snapshots: The yesterday.json Architecture},
196
+ year = {2026},
197
+ month = may,
198
+ doi = {10.5281/zenodo.20191876},
199
+ publisher = {Zenodo},
200
+ url = {https://zenodo.org/records/20191876}
201
+ }
202
+ ```
203
+
204
+ ---
205
+
206
+ ## Author
207
+
208
+ **Chetan Sharma**
209
+ Independent Researcher β€” Kolkata, India
210
+
211
+ - Zenodo: https://doi.org/10.5281/zenodo.20191876
212
+ - Blog: https://yesterday-json.blogspot.com
213
+
214
+ ---
215
+
216
+ ## License
217
+
218
+ This repository and accompanying conceptual framework are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
219
+ ````
220
+