⬡ ENGRAMS v0.15.0

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)

Dead history waiting to be searched

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)

Brittle, manual, and bloated

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.

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 1: REPOSITORY CODE ANCHORS TIER 2: DECISIONS & PATTERNS TIER 3: SCHEMA

Tier 3: Cognitive Schema

● active mental model
performance-rules guided 14 sessions
⚡ TRIGGER

Fires whenever I edit Rust code handling collections & strings

📋 DIRECTIVE
The four allocation rules (borrow params, keep borrowed, consume by move) plus staged checker.

Tier 2: Linked Decisions & Patterns

architectural standards
Decision #88 Borrowed SQL parameters (Vec<&dyn ToSql>)
Decision #91 Static vocabulary returns Cow<str>
Pattern #11 Single-source row projections
Pattern #12 Enrich by move, not get().clone()
Checker Tool engrams check --staged (pre-commit)

Tier 1: Repository Code Anchors

grounded code reality
⚓ src/ops/schemas/retrieval.rs surface_counts · enrich_members
⚓ src/ops/schemas/list.rs resolve_schema · row_json
⚓ src/ops/schemas/gates.rs gates_pass · claimed_territory
STRATEGIC SCHEMA what-to-build-next
● active · guided 16 sessions centroid: roadmap: 1 · planning: 1 · versioning: 1
⚡ MENTAL TRIGGER
When does this mental model activate?

Fires when planning releases, evaluating roadmap priorities, or drafting new feature specifications

📋 CONCEPTUAL DIRECTIVE
What operational paradigm is enforced?

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.

🔗 BUNDLED MEMBERS
What decisions, research, and progress notes are unified?
Decision #74: Tiered version roadmap Research: 2026 agent-memory survey (8 findings) Progress: Survey session notes & synthesis Anchor: specs/

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 scan

2. 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-rules

3. 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 "..."

Three Operational Levers

Your AI executes the advice automatically. You steer the runtime with three high-leverage commands.

$ engrams advise src/ops/schemas/retrieval.rs
{
  "schemas": [
    {
      "id": 1,
      "name": "performance-rules",
      "summary": "Fires whenever I edit Rust code that creates, copies, or hands off collections...",
      "guided": 14
    }
  ],
  "constraints": [ ... ]
}
$ engrams schema show performance-rules
{
  "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"}
  ]
}
$ engrams session close --pr 42
{
  "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