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. Defines
At session close, Engrams nudges you with ready-to-run confirm commands, and authoring enforces strict trigger-and-rule contracts.
$ engrams schema confirm decision:88 --name performance-rules3. Refines
Tracks git staleness drift, records retrieval surface counts, and re-notifies when new candidate evidence advances beyond prior notifications.
$ engrams schema refine performance-rules --trigger "..." --rule "..."4. 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",
"summary": "Fires whenever I edit Rust code that creates, copies, or hands off collections...",
"guided": 14
}
],
"constraints": [ ... ]
} {
"name": "performance-rules",
"summary": "Fires whenever I edit Rust code that creates, copies, or hands off collections...",
"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},
"schema_opportunities": [
{"confirm_command": "engrams schema confirm decision:88 --name performance-rules"}
]
} 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