⬡ENGRAMSv0.17.1

Project Memory That Stops Your AIFrom Repeating Mistakes.

Your AI forgets settled decisions between sessions and wastes tokens re-reading files. Engrams saves your team's rules locally and delivers the right playbook for a file—before a single line of code is written.

⬡graph-ontology-and-rebuild
01 · THE MENTAL MODEL

What Is a Schema (Playbook)?

Senior engineers don't re-read the entire codebase before editing a file—they recall a mental model. In Engrams, a Schema is the top of a three-layer pyramid: one plain-English playbook backed by linked decisions and checks, anchored directly to your repository folders and files.

Vector Search & Notes (Passive)

Sits idle unless queried

Stores isolated notes, but your AI doesn't know when a rule applies—so it either searches blindly or ignores past decisions.

Giant Markdown Rules (Static)

Burns context on every prompt

Dumping hundreds of lines of static rules into every chat wastes tokens on unrelated tasks and weakens model focus.

LAYER 1 · CODE ANCHORSLAYER 2 · DECISIONS & CHECKSLAYER 3 · PLAYBOOK

Layer 3: Active Playbook (Schema)

● guided 67 sessions
performance-rules
⚡ WHEN IT FIRES

Whenever the AI edits Rust code in src/ or src/ops/

📋 WHAT TO DO
Borrow SQL parameters, keep string slices borrowed through transforms, and move temporary lookup maps instead of cloning.

Layer 2: Linked Decisions & Checks

6 bundled items
Pattern #7 (Error Gate)Borrow SQL params via Vec<&dyn ToSql>
Pattern #8 (Warn Gate)Keep Cow<str> borrowed in string chains
Pattern #9 & #12Consume lookup maps by move, not .clone()
Pre-Commit Enforcementengrams check --staged

Layer 1: Repository Code Anchors

real source paths
⚓src/ops/schemas/retrieval.rshot retrieval queries
⚓src/ops/advise.rs1ms pre-edit check
⚓src/ops/check.rsstaged regex & AST runner
02 · LIVE PRE-EDIT COMPARISON

Without Engrams vs. With Engrams

Click any file below to compare what a cold AI guesses against what engrams advise hands it in ~1ms before editing.

Pick a file to compare:
WITHOUT ENGRAMSCold AI session

Reads 11 graph & link files cold to rediscover invariants and risks breaking the empty-window guard.

Extra files read
11+ source files
Prompt tokens
~18,400 tokens
Outcome
Guesses architecture from scratch
WITH ENGRAMSengrams advise src/ops/graph/rebuild.rs

Validate relationship rules at link-write time in link.rs; compute inverse edges and rankings in memory during rebuild while borrowing SQL parameters.

Extra files read
0 extra files
Prompt tokens
~1,979 tokens
Outcome
0 missed rules
What exactly fired? (⬡ graph-ontology-and-rebuild)
  • Playbook #3: graph-ontology-and-rebuild (12 linked decisions)
  • Playbook #1: performance-rules (4 zero-allocation Rust rules)
  • Pre-Commit Gate: Borrow SQL params + move lookup maps (check --staged)

Measured live on engrams-cli (7,916 bytes from engrams advise src/ops/graph/rebuild.rs)

03 · HUMAN + AI COLLABORATION LOOP

Zero Manual Rule-Writing: How Playbooks Emerge

You never maintain a brittle rules file by hand. Playbooks grow naturally out of your everyday coding sessions in four steps:

  1. STEP 1 · DURING NORMAL WORK

    Log Decisions as You Build

    You never stop to hand-write a playbook file. As your AI writes features, it logs key design choices, function contracts, and file anchors in local SQLite.

    Why it matters: Each decision takes <5ms to store locally and carries the exact source file paths it governs.
  2. STEP 2 · AT SESSION CLOSE

    Engrams Spots Recurring Threads

    When you wrap up a task, Engrams notices when 3+ decisions share topics across at least two files or days—and asks your AI targeted questions to synthesize them.

    Why it matters: Instead of auto-creating noisy rules, Engrams hands your AI the related notes in reading order plus a ready-to-fill proposal template.
  3. STEP 3 · HUMAN APPROVAL

    Approve the Playbook in Plain English

    Your AI drafts a one-sentence claim, a clear 'When X: do Y' rule, and directory triggers—then asks you to confirm, edit, or reject it in plain words.

    Why it matters: Nothing becomes an active playbook without human confirmation. Once confirmed, all 12 underlying decisions stay linked for auditability.
  4. STEP 4 · EVERY FUTURE SESSION

    Pre-Edit Advice Fires in 1ms

    Weeks later, a fresh AI session touches a file in that folder—even a brand-new file. Engrams delivers the playbook before a single line of code is written.

    Why it matters: 0 exploratory file reads needed: ~1,980 tokens (2 playbooks + all pattern gates) replace ~18,400 tokens of hunting across 11 source files.
04 · STAYING ACCURATE AS CODE EVOLVES

Outdated Decisions Retire Automatically

Requirements change. Flat markdown docs and vector stores keep feeding abandoned experiments into your AI's prompt. Engrams links new decisions with supersedes so retired rules step aside cleanly.

OUTDATED DECISIONS STAY RETIRED · 37 SUPERSEDES · 42 REFINES LINKS

When Your Architecture Changes, Old Rules Step Aside Automatically

In engrams-cli itself, automatic batch promotion (scan --apply) split character arcs in book simulations and was superseded by human-confirmed schema_proposals.

1 · EARLY APPROACH (RETIRED)
decision:81RETIRED
scan --apply opt-in batch promotionCreated unreviewed schemas
2 · ITERATION / PIVOT
decision:85RETIRED
Restrict scan --apply to schema-kind labelsHeuristic still noisy on prose
3 · WHAT YOUR AI RECEIVES TODAY
decision:93● ACTIVE
Schemas require human-confirmed proposals onlyActive Spec 0007 invariant
PROVEN AT PRODUCTION SCALE · 100 ACTIVE DAYS

Explore 1,503 Real Nodes & 40 Specimens in the Knowledge Atlas

Browse real playbooks, enforceable anti-pattern checks, and the 7-domain codebase map from both engrams-cli and a multi-tenant production monorepo (465 decisions, 50 standards, 342 source files).

Open Knowledge Atlas ↗

Give your AI project memory in 60 seconds.

Single local Rust binary · Embedded SQLite · 0 MB idle memory · ~1ms pre-edit checks.

curl -fsSL https://engrams.sh/install | bash