sandman · knowledge

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.

systemholdssandmanfiled by
episodicwhat happened: a preference stated, a correction, a project's decisionmemory types user, feedback, project, referencerepository: memories/<bank>/
semanticgeneral knowledge, true independent of the episode it was learned inknowledgetopic: knowledge/<topic>/
proceduralhow a recurring task is doneplaybooktopic: 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

How a page is written and revised

One episode, two homes; one consolidate job, two targets.

① episodea taken session,its digest ② encodeeach trace typed,homed by kind traces/<bank>/memory types, byrepository (about) traces/@<topic>/knowledge, playbook,by topic ③ consolidatekeep, merge, pruneinto the bank ③ consolidatethe same job,another target memories/<bank>/episodic: whathappened, decided knowledge/<topic>/pages and playbooks,revised in place keep keep a later trace: merge, the page read whole
An episode's traces split by type. The topic consolidates exactly as a bank does; only the target root differs, and a page grows by merges.

The playbook's shape

Fixed, so a reader finds the step and the hazard without reading the history.

---
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.

Open questions