Where next
Your wiki, remembered
Where next · Your wiki, remembered
You want to: make the pages you already wrote reach the agent at the moment they apply, without pasting them into prompts.
You leave with: one page from your wiki turned into memory by a line on a heading, arriving in the sessions that touch the code it is about, and a store that tells you when that page changes or goes away. Engram only; nothing new to install.
Before you start
Continue in the repository from step 4, with its .engram/ store and session-start hook. Have a Markdown folder people are supposed to read: a wiki, docs/, an Obsidian vault, a CLAUDE.md that has grown sections. Pick the one page you most often point people at.
Tag one section
Engram reads a Markdown page by its level-two headings. Find the section of your page that states the thing people keep getting wrong, and add to its heading a key, a kind and the code it is about:
## Refunds are idempotent [key: refunds-idempotent] [kind: invariant] [globs: app/Billing/**]
> summary: Re-running a refund with the same key must not refund twice.
(the section's existing text, unchanged)
The > summary: line is optional; it is the short form a session sees first. Compile the page without loading it, and read what came out:
engram seed compile <path/to/page>.md --ring M2 --output seed.jsonl --ote .engram/ote.toml
The file holds one entry per section that became a memory. Expect the section you tagged, with the page's words as its body. When it is what you meant, load it:
engram seed compile <path/to/page>.md --ring M2 --import --ote .engram/ote.toml
What you should notice: the page did not move and nobody retyped it. The section has a key, a scope and the page as its source, and the memory's body is the sentence your colleague wrote, not a paraphrase of it.
Does not prove: that the page is right. Where the words came from is recorded; whether they are still true is not.
See it arrive where it belongs
Ask for the block a session would start with, first for a task that touches the code in the glob, then for one that does not:
engram block --context '<a task under app/Billing>'
engram block --context '<a task somewhere else>'
Or start a session through the hook from step 4 on a task in that area.
What you should notice: the page's own sentences arrive for the first task and stay out of the second. The wiki reached the agent at the moment it applied, which is the only moment it was ever going to be read.
Does not prove: that the agent used it. A cue is a candidate the agent is expected to confirm, as in step 4.
Use the properties you already have
If your pages already carry front matter the same way, an id and a type on each, you do not need to tag headings page by page. Describe the properties once, in a file outside the folder:
# .engram/wiki-map.toml
schema = "engram.frontmatter_map.v1"
[key]
field = "id"
[kind]
field = "type"
[kind.values]
rule = "invariant"
howto = "procedure"
draft = "skip"
[globs]
field = "paths"
Then load the folder with it:
engram sync hydrate-knowledge --vault-path <folder> --frontmatter-map .engram/wiki-map.toml --ote .engram/ote.toml
Pages at the top level of the folder are read; a page whose type maps to skip is left out; a tag on a heading still wins over the map. The map is strict: a page without the fields it names stops the run, so point it at a folder whose pages carry them.
What you should notice: nothing in the folder changed. The map is yours, lives beside the store, and says in ten lines how your wiki's conventions become memory.
Does not prove: that a page should be memory because it can be. Mapping is mechanical; which folder to point at is your call, and skip is there for drafts, notes and pages that are not yours to share.
Rename, retire, reload
Change the heading or the key of a section you loaded, then run the hydration from the previous section again. Then delete a section you loaded, and run it once more.
What you should notice: the renamed section replaced the old memory, and the old one is kept in its history. The deleted section changed nothing: the memory is still served, because a missing page is not a decision. To retire it, say so in a keys.json at the top of the folder and rerun:
{"retired": ["refunds-idempotent"]}
Read that list before you run it; it retires every active memory with those keys.
Does not prove: anything about sections you did not tag or pages the map skipped. The store knows about what you loaded, not about the whole wiki.
What you have
A wiki that reaches the agent when it applies, by a line on a heading or a ten-line map, with renames and deletions handled on purpose. The page remains the source; the store remembers which words came from it.
Next: when a second person should start from the same knowledge, Your team; when a page's rule should be enforced rather than suggested, Make it enforce. The Engram command reference covers compilation and hydration in full.