Coverage for app / memory / __init__.py: 100%

0 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-10-31 11:23 +0000

1"""What an agent keeps of a person between conversations. 

2 

3An agent's memory of one person is a set of rows in ``agent_memories``, 

4scoped to ``(agent, user)`` and stamped with the workspace the work was done 

5in. Two kinds of row, written and read differently: 

6 

7* **Episodes** — one per turn: the person's request and the gist of the 

8 answer. What "what did we discuss" and a follow-up beyond the replayed 

9 history need. Model-written where a summary was made, so marked as such. 

10* **Curated memories** — facts about the person, how they want to be 

11 answered, and their ongoing work (``kinds.CURATED``). Written only from 

12 the person's own words: an extraction step proposes them, and code keeps 

13 one only when its quoted words are in the person's message 

14 (``extraction.validate``). Corrections replace what they correct; a 

15 request to forget deletes. 

16 

17Recall (``recall.rank``) is relevance-gated rather than "the newest N": a 

18memory reaches the model only when the request bears on it, except 

19preferences, which shape every answer. Nothing comes back from a 

20superseded or expired row, or from an episode the replayed history already 

21holds. 

22 

23See ``docs/guides/memory.md``. 

24"""