Emotional Memory
A memory library that recalls by mood as well as meaning. It helps only in the narrow case it was built for; the public record is DOI 10.5281/zenodo.19972258.
Diagram description: emotional-memory research
I encode affective state into a memory store and run a published benchmark; the claim matrix feeds back into encoding. This diagram omits dataset ingest and the archived artifacts.
On this page
Why this matters
I built a memory library that recalls by mood as well as by meaning. In the documented evaluation, it helped only in the narrow case it was built for. Outside that case, it did no better than plain similarity search, and on some tests it did worse.
What the library does
The public emotional-memory library stores each memory with the emotional context associated with it: how pleasant it felt (valence), how intense it was (arousal), the mood at the time, and an appraisal of the event (how new, relevant, and manageable it was). At recall, it ranks memories by meaning plus that context. The README calls the model Affective Field Theory (AFT). I designed it for agents that talk to the same person across many sessions. It is not a drop-in replacement for general-purpose RAG.
Where it works
I tested it on realistic_recall_v2, with its preregistration and reported measurements recorded in the DOI artifact. Preregistered means I wrote down the test and what would count as a pass before running it. AFT scored higher in English (N = 200, Δ = +0.21, d = 0.49) and in French (N = 120, Δ = +0.18, p < 0.0001, g = 0.42). Δ is the gain, d and g measure effect size, and p is the probability of observing a result this extreme or more under the null hypothesis. In Italian and Spanish, AFT did not meet the preregistered success criterion at the declared sample size (N = 120).
These results have a specific condition: affect was supplied at encoding and retrieval. The emotion labels were provided as known-correct values, not inferred automatically by a model. Under that condition, the system with better ranking also produced higher answer accuracy in the reported end-to-end test. In that preregistered test (N = 200), the system stored memories, retrieved them, and wrote an answer, and GPT-5 mini graded the answer. AFT's answer accuracy was 0.595, against 0.440 for plain similarity search (cosine): a gain of +0.155 (interval 0.095 to 0.220, p < 0.001).
Where it fails
The claim-validation matrix records these failures.
- Factual questions. On LoCoMo, a dataset of 1,986 question–answer pairs, AFT scores below a basic RAG baseline: F1 0.168 against 0.271. F1 measures how closely an answer matches the expected one.
- Emotions inferred automatically. When a model infers the emotions (
LLMAppraisalEngine) instead of being given them, AFT does not beat plain similarity on queries with no emotional content (Δ = −0.010). A recalibrated re-run put it further behind (Δ = −0.087, p = 0.002). - Everyday dialogue. On DailyDialog (120 personas, 396 queries), there is no advantage over plain similarity (Δ = −0.008).
- Emotional support. On MADial-Bench (NAACL 2025), a third-party benchmark, plain similarity is significantly better: nDCG@5 0.304 against 0.221. nDCG@5 measures how well the right memories rank in the top five. There, a supportive assistant is expected to recall happy memories for an upset user, which is the opposite of what AFT assumes.
- Questions about what was said. On ES-MemEval (WWW 2026), where the right memory depends on what was said and when, plain similarity is again significantly better: nDCG@4 0.284 against 0.133. 45.5% of its queries carry no emotion at all (source: results file in the repository).
The limit
The claim-validation matrix records that the advantage holds only when relevance itself depends on emotion and the emotion is known when the memory is stored. The checkmarks in its comparison table mark features, not a head-to-head score.
FAQ
What does emotional memory add to similarity search?
I store each memory with valence, arousal, mood, and event appraisal, then rank recall by meaning plus that context. I designed this for agents that speak with the same person across many sessions, not as a general-purpose RAG replacement.
When does Affective Field Theory improve recall?
I found an advantage only when relevance itself depends on emotion and emotion is known when the memory is stored, as recorded in the evaluation artifact. In the reported recall tests, labels were supplied as known-correct values rather than inferred by a model.
Does emotional memory work with automatically inferred emotions?
I found that AFT did not beat plain similarity for queries without emotional content when a model inferred emotions. In a recalibrated re-run, it was further behind plain similarity.
Why can plain similarity work better for emotional support?
I found that plain similarity performed better on MADial-Bench. That benchmark expects a supportive assistant to recall happy memories for an upset user, which is the opposite of what AFT assumes.
Related articles
How I Design Source Checks for Autonomous Research Agents
I describe a planner-executor-critic workflow for checking source support. Examples define routing and retained evidence, without measured detection accuracy.
Nov 15, 202410 min read#AI Agents#Research#LLM#ProductionIs Saying an LLM Doesn't Think Like Saying a Calculator Can't Do Numbers?
Where the calculator analogy for LLMs holds and where it breaks: what interpretability, chain-of-thought, and philosophy of mind say about thinking.
Jul 2, 202616 min read#LLM#AI Reasoning#Interpretability#Philosophy of MindState as the API: Three LangGraph Designs
I compare three LangGraph state designs: flat fields, nested models, and explicit reducers, with routing and replay constraints.
Jan 8, 202511 min read#LangGraph#LLM#Multi-Agent#Orchestration