File size: 5,107 Bytes
2cfbb43
 
6ba6139
 
12b81bc
 
 
 
 
 
 
 
6ba6139
 
12b81bc
2cfbb43
6ba6139
 
 
e82fb43
 
6ba6139
 
e82fb43
 
 
 
 
6ba6139
e82fb43
 
 
 
 
 
 
 
 
 
 
 
 
 
6ba6139
e82fb43
6ba6139
e82fb43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6ba6139
 
 
e82fb43
 
 
 
 
 
 
 
 
 
 
 
6ba6139
e82fb43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6ba6139
e82fb43
6ba6139
e82fb43
 
 
6ba6139
 
 
 
e82fb43
6ba6139
 
e82fb43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
---
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).
````