This recipe gives a coding agent a shared memory that outlives its sessions. Hand these files to your agent and it builds four parts that work together:
- kb: a searchable folder of short technical docs, plus a CLI to search it and to queue new knowledge
- librarian: the only agent allowed to write docs; it runs on a schedule and files, merges, fact-checks and prunes them
- debrief: an end-of-session review that reads the session's own transcript and turns what went wrong or was learned into fixes and kb submissions
- kb hooks: small harness hooks that show relevant docs to the agent without being asked, and check each doc as it is written
The recipe works with any harness and any language. It describes contracts, data shapes and procedures. A few excerpts show the algorithms where exact behavior matters. Your agent writes the code in whatever stack your machine already has.