memory for agentic sessions · the main page · recall
The knowledge store holds what is true beyond one project, and how a recurring task is done, filed by topic rather than by repository. The same unattended pipeline feeds it: encode homes a trace by its type, consolidate folds a topic's traces into its pages, recall ranks the pages beside the memories.
Built: the store, encode's and consolidate's split, remember --topic,
recall, show and chart over it, consolidate's graduation into it
(rung 1). Not built: rehoming the existing memories, graduation out of it (next).
The problem
Every memory is filed under the repository a session worked in. That suits a preference or a project's decision; it misfiles what the work discovered about a tool (how launchd stops a job, what a llama.cpp flag really does) and the steps of a task done again and again. Such a fact lands in whichever bank the session happened to touch, one short note per fact, and a session in another repository never earns it the bank's bonus. The owner, 2026-11-14: "memories are good for my preferences and project recall, but i'm finding we should have a place for general knowledge and playbook type structures".
Three long-term systems
Memory science names three; sandman stored one. On disk and in the CLI the words are the
owner's: knowledge and playbook.
| system | holds | sandman | filed by |
|---|---|---|---|
| episodic | what happened: a preference stated, a correction, a project's decision | memory types user, feedback, project, reference | repository: memories/<bank>/ |
| semantic | general knowledge, true independent of the episode it was learned in | knowledge | topic: knowledge/<topic>/ |
| procedural | how a recurring task is done | playbook | topic: knowledge/<topic>/ |
A reviewed memory about one repository's decision stays a memory even when the tool is general: "grove sets
ExitTimeOut 2" is grove's project memory; "launchd kills a job past
its ExitTimeOut" is knowledge under launchd.
The store
<topic> is a slug: lowercase letters, digits and
-, a letter or digit first (launchd, llama-cpp,
grove-release).
<root>/ knowledge/launchd/knowledge_launchd_exittimeout.md a page knowledge/launchd/playbook_swap_a_launchd_daemon.md a playbook traces/@launchd/playbook_drain_a_daemon.md a trace awaiting consolidate traces/-work-grove/project_exit_timeout_2.md a memory trace, by repository .pruned/2026/11/14/093000-@launchd-ops.json consolidate's reply, as for a bank
- pages — the memory file format: flat frontmatter,
typeknowledgeorplaybook,topic,created,updatedonce merged,sourcethe consolidate stamp; the session and archive of the trace that started it, andsessionsevery session it descends from, merges included;id,fromandoriginas every note's (the note): a page born of a rung-1 graduation names its memories onfrom:and starts with no sessions. - traces — a topic's wait in
traces/@<topic>/. A bank key is letters, digits and-, so@never collides with one, and thenotesreader, which skips only.and_, finds them. Inside the pipeline a topic's bank is@<topic>throughout: the ledger'sconsolidatelines,.pruned/names, reflect's evidence. - paths —
show knowledge/<topic>/<file>.mdreads a page,show traces/@<topic>/<file>.mda trace;chartlists pages asknowledge,memories' shape withtopicforbank.
How a page is written and revised
One episode, two homes; one consolidate job, two targets.
- encode — the contract gains the two types and
topic, required for them, in place ofabout; a knowledge type without a slug topic fails the episode. The guidance says when a fact is knowledge (it holds for any project on the same tool), when a sequence is a playbook (a task done more than once, or steps worth repeating), and that a later episode showing a step wrong writes a corrected playbook trace under the same topic. - consolidate — picks a quiet
@<topic>as it picks a bank and sends the topic's pages as the bank's memories.mergeis the common case: the trace folds into the page, the page comes back whole and replaces the old,updatedset, the old under.pruned/.keepstarts a page, and in a topic takesknowledgeorplaybookonly;prunedrops a trace. - by hand —
sandman remember "<body>" --type playbook --topic launchdwrites the trace at once;--topicalone meansknowledge, and a type without a slug topic is refused, exit 2. The MCPremembertool takestypeandtopic. - reflect — no code of its own: it reviews the guidance that carries these rules, and its evidence reads a topic's ops and remembers as a bank's. A page merged often is growing as it should; its guidance says so.
The playbook's shape
Fixed, so a reader finds the step and the hazard without reading the history.
- When: the situation it is for.
- Steps: numbered, one action each, its command when there is one.
- Watch for: what went wrong before and how it showed, dated. A trace that proves a step wrong replaces the step and adds the failure here; the old step does not survive beside the new.
--- id: 5e1f0a2b9c3d name: Swap a launchd daemon description: launchd: swap a running daemon after an install with kickstart -k, never bootout then bootstrap type: playbook created: 2026-10-02T09:12:00Z topic: launchd sessions: 5a000000-0000-4000-8000-00000000000a 5a000000-0000-4000-8000-00000000000b source: consolidate 2026-11-14T09:30:00Z · 5a000000-0000-4000-8000-00000000000b · model=opus updated: 2026-11-14T09:30:00Z --- When: sample: a new build of a daemon under launchd is installed and the running one must be replaced. Steps: 1. Install the binary in place. 2. `launchctl kickstart -k gui/$(id -u)/<label>`. 3. `<daemon> status`: the version matches the build. Watch for: sample: bootout then bootstrap raced KeepAlive's respawn and left two instances (2026-11-11); kickstart -k is one atomic restart.
How recall treats it
Pages and their traces are ordinary candidates in the same pass: the
gate, BM25, the embeddings, the decision model and the cap of 6. Their label is
knowledge · <topic>, which is the head embedded and the decision model's
Memory (knowledge · launchd): …; it matches no repository, so no bank bonus, and the line
shows the type: 1.00 Swap a launchd daemon (playbook · knowledge/launchd/playbook_swap_a_launchd_daemon.md),
a trace marked ~. Knowledge is never in the always-set, even pinned. The tick's embed job
covers the pages as it covers memories. With no knowledge on disk, every pinned recall output is unchanged.
Next
Not built.
- rehoming — a one-time, reviewed pass over the 645 memories, starting with the 109
referenceones (measured 2026-11-13, recall): a model proposes per memorykeep(stays episodic),knowledgeorplaybookwith a topic, written as a plan file; the owner reviews it; the apply step writes each moved one as a trace undertraces/@<topic>/(itscreated,sessionand quotes kept) and moves the original to.pruned/, so consolidate builds the pages and every step is recoverable. - promotion — memories graduate into pages automatically (rung 1, built); a page or playbook used across sessions is proposed as a skill or a guidance line (rung 2), a lesson relearned as a mechanism (rung 3), the owner approving both (graduation).
Open questions
- Whether knowledge crowds memories out under the shared cap of 6 lines: unmeasured.
- Rehoming the existing
referencememories (next). - The
referencetype's future once its general part moves: kept for a repository's pointers, or folded intoknowledge.