For Your Agent
Engrams only becomes an advisor if the agent keeps the graph fed. This section documents the agent's side of the partnership: the commands it runs to store what it learns, connect what it knows, retrieve context before acting, and keep the graph healthy over time.
Day 1, engrams can only fetch — the graph is nearly empty. Every decision logged, every link asserted, every progress entry compounds. As the graph densifies, prime,relevant, and doctor shift from retrieval to advice. That maturation story is told in The Advisor Loop; this pillar is the machinery that drives it.
The operating loop
The agent runs the same loop every session. Consult first, log as you work, hand off at the end.
- Orient & Check Before Editing.
engrams primeloads active playbooks and focus at session start. Before modifying or creating files,engrams advise <paths>returns matching playbooks, contracts, and pattern rules in ~1ms. - Log decisions as they happen.
engrams decision log --contract "..."records choices while the reasoning is fresh—not at session end. - Wire it in.
engrams link addconnects new items withimplements,depends_on, orsupersedesso retired decisions step aside automatically. - Track the work.
engrams progress logrecords task state so future sessions know where work stands. - Close & Export.
engrams session closetallies guided retrievals and surfaces new playbook prompts for human review, andengrams exportwrites clean Markdown toengrams_export/for Git.
Four jobs
Storing
decision log · pattern log · progress log · custom set
Put facts in. Decisions with rationale, machine-checkable patterns, task progress, and arbitrary key-value data.
Connecting
link add · anchor add · pr add
Wire facts together. A validated relationship ontology, file anchors, and PR links turn entries into a graph.
Retrieving
prime · relevant · query · decision search
Pull context back out — briefings at session start, anchor-matched context before every edit, FTS5 search any time.
Maintaining
decision supersede · export · migrate · doctor
Keep the graph current. Supersede stale decisions, audit health, migrate schema, and sync to git.
It compounds — real numbers
This repository dogfoods engrams. Its own knowledge graph — the one rendered on thelanding page — grew from a fetches-only database into a reasoning web in under a month:
From 1 link on Day 1 to 808 edges and 3 active playbooks in v0.17.0: what started as simple fact lookup now guides edits automatically before a file is even opened.
--db <path> and--workspace <path> go before the subcommand; --compact and--fields <a,b> work on most subcommands to trim output tokens. Entity types use hyphens: decision, progress-entry, system-pattern,custom-data.