The Schema Runtime
for AI Coding Agents.
Static markdown rules bloat your prompt. Flat memory stores sit passively waiting to be queried. Engrams is an active runtime that continuously finds, defines, and refines mental models for your codebase — just like the human brain.
Why a Schema Runtime?
Other tools treat AI context as static text files or dead database records. A runtime is fundamentally different: it actively perceives changes, clusters patterns, and executes directives at the exact point of action.
Vector Databases & ADR Lists (Passive)
Stores hundreds of isolated notes. But the agent has no trigger condition — it doesn't know when a rule applies. It either queries blindly or ignores your history completely.
Prompt Stuffing & .cursorrules (Static)
Developers manually write rigid text rules that get dumped into every prompt regardless of relevance. Consumes context window space and causes severe attention decay in reasoning models.
The Engrams Runtime (Active Schemas)
Autonomously clusters codebase activity, formalizes triggers and directives, and intercepts agent edits in 1ms with compact mental models.
What is a Schema?
A Cognitive Schema is not an isolated note. It is the peak of an architectural pyramid: an active mental model resting on linked decisions and standards, which anchor directly into your concrete repository source code.
Tier 3: Cognitive Schema
● active mental modelperformance-rules guided 14 sessions Fires whenever I edit Rust code handling collections & strings
Tier 2: Linked Decisions & Patterns
architectural standardsTier 1: Repository Code Anchors
grounded code realitysrc/ops/schemas/retrieval.rs src/ops/schemas/list.rs src/ops/schemas/gates.rs what-to-build-next Fires when planning releases, evaluating roadmap priorities, or drafting new feature specifications
The pack that answers "what should engrams do next?": the 2026 agent-memory research survey (8 saved findings), the decision that turned it into a tiered version-by-version roadmap, and the survey session note. My learn → plan → ship loop — read this before writing any new spec.
Why this is an architectural mental model, not a linter rule
Notice how both schemas capture how an expert thinks:
performance-rules doesn't just block a single function call; it packages four architectural decisions, two code files, and a validation checker into an instant zero-allocation posture.
what-to-build-next packages a research survey and roadmap decisions into a planning protocol.
Your AI receives the complete mental model on Turn 1 before writing a single line of code.
How the Runtime Learns
The human brain doesn't require manual file editing to form intuition. Engrams runs a continuous cognitive loop: perceiving clusters, defining boundaries, adapting to drift, and executing just in time.
1. Finds
As you commit code and log decisions, graph community detection identifies natural clusters of co-edited files and decisions in local SQLite.
$ engrams schema scan2. Proposes
At session close, Engrams surfaces candidate clusters with ready-to-fill propose commands. Your agent drafts a plain-language claim, trigger-and-rule instruction, and scope over the evidence.
$ engrams schema propose --from decision:88 --statement "..." --trigger "..." --rule "..."3. Confirms & Refines
You confirm or edit the reviewed proposal (or refine existing schemas with claims and scope paths), while Engrams tracks drift and retrieval telemetry.
$ engrams schema confirm proposal:14. Executes
Tomorrow, your AI touches matching files. engrams advise intercepts the edit in 1ms,
injecting the active schema before a single line is written.
$ engrams advise src/ops/schemas/retrieval.rsThree Operational Levers
Your AI executes the advice automatically. You steer the runtime with three high-leverage commands.
{
"schemas": [
{
"id": 1,
"name": "performance-rules",
"statement": "Hot retrieval and enrichment paths must avoid avoidable allocations and clones",
"summary": "Fires whenever I edit Rust code that creates, copies, or hands off collections...",
"scope": {"tags": ["performance", "rust"], "paths": ["src/ops"]},
"matched_by": {"via": "member_anchor", "value": "src/ops/schemas/retrieval.rs"},
"guided": 14
}
],
"constraints": [ ... ]
} {
"name": "performance-rules",
"statement": "Hot retrieval and enrichment paths must avoid avoidable allocations and clones",
"summary": "Fires whenever I edit Rust code that creates, copies, or hands off collections...",
"scope": {"tags": ["performance", "rust"], "paths": ["src/ops"]},
"origin": {"proposal_id": 1, "source": {"kind": "candidate", "ref": "decision:88,decision:91"}},
"guided": 14,
"members": [
{"kind": "decision", "id": 88, "summary": "Borrowed SQL parameter lists"},
{"kind": "decision", "id": 91, "summary": "Static vocabulary returns Cow"}
]
} {
"schema_value": {"guided_retrievals": 6, "distinct_schemas": 2, "schemas": [{"id": 1, "name": "performance-rules", "guided": 4}]},
"schema_prompts": [
{"key": "candidate:decision:88", "lens": "software", "propose_command": "engrams schema propose --from decision:88 --lens software --name performance-rules --statement \"<claim>\" --summary \"When <condition>: <directive>\""}
]
} Give your AI the mental models it deserves.
Local SQLite engine. 0MB background memory. 1ms query execution.
cargo install engrams-cli or brew install stevebrownlee/tap/engrams