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.
engrams primeloads a token-budgeted briefing at session start. Before editing files,engrams relevant <paths>surfaces every decision and pattern anchored to them. - Log decisions as they happen.
engrams decision logthe moment a design choice is made — not at session end, when the rationale is already gone. - Wire it in.
engrams link addconnects the new item to what it implements, depends on, or supersedes. Links are what turn a list into a reasoning web. - Track the work.
engrams progress logrecords task state so the next session knows exactly where things stand. - Hand off.
engrams active-context update --patchmerges the session's outcome into the named workstream track, thenengrams exportdumps Markdown for git. Commitengrams_export/with the code.
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 the landing page — grew from a fetches-only database into a reasoning web in under a month:
29 reasoning links across 26 days of real feature work — policy engine, ontology, schema,
search. Day 1 the agent could fetch one fact. By week 4 it could traverse
depends_on chains and answer "what breaks if I revisit this?"
--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.