Introduction
Engrams gives your AI coding assistant persistent project memory that compounds into reusable playbooks (called Schemas). Instead of starting every chat blank and burning 15,000+ tokens defensively reading source files, your AI receives the exact architecture rules, interface contracts, and checks for a file right before it writes code.
Why Playbooks (Schemas)?
Have you ever had to remind your AI assistant—again—that your project already settled on a database pattern, error format, or folder boundary? AI coding tools are capable, yet every new session starts with amnesia.
Traditional workarounds either stuff giant Markdown files into every prompt (wasting tokens and diluting model focus) or search isolated notes after the fact. Senior engineers work differently—they rely on mental models: "When I edit database code, I borrow SQL parameters and avoid throwaway collections." Engrams gives your AI that same reflex through human-confirmed Schemas.
The Problem: Context Window Bloat & Fragile Servers
Traditionally, developers had to choose between two bad options for giving AIs project context:
- Bloated prompts: Dumping huge
README.md, architecture docs, or complete file trees into the prompt. This wastes tokens, costs money, and degrades the AI's reasoning performance (attention decay). - MCP Daemons: Running background MCP servers. These are notorious for port conflicts, silent failures in sandboxed IDEs, memory leaks, and tedious setup across team members' environments.
The Solution: A Standalone Rust CLI
Engrams solves this by running as a fast, zero-overhead CLI. AI agents simply run engrams commands inside their terminal tool to search or log information.
Key Practical Benefits
1. Zero Background Overhead
Since Engrams is a compiled Rust CLI rather than a server daemon:
- There are no ports to allocate and no socket connections to drop.
- It consumes 0 MB of RAM when idle (it only runs when invoked).
- No risk of background crashes freezing your editor extension.
2. Universal Compatibility
Any AI coding tool that can run terminal commands works with Engrams out of the box—no editor-specific extensions required:
- Claude Code (
CLAUDE.md) - Codex & omp (
AGENTS.md+ optionalengrams install --harness omp) - Cursor (
.cursor/rules/) - Zed, Windsurf & Cline
3. Blazing Fast FTS5 Search
Instead of relying on heavy local vector models (which eat CPU/GPU) or calling external embedding APIs (which cost money and require internet), Engrams uses SQLite's built-in FTS5 (Full-Text Search) engine. Searches take less than 5 milliseconds and run entirely locally.
4. Git-Friendly Collaboration
You shouldn't commit SQLite binary files to Git. Engrams has native export and import commands that serialize your database to clean, structured Markdown files under engrams_export/. You commit these Markdown files to your repository, allowing:
- Easy peer reviews of architectural decisions (ADRs) and patterns in PRs.
- Automatic local database synchronization upon running
git pull && engrams import.
Comparison: Engrams vs. Alternatives
| Aspect | Manual Prompts | MCP Servers | Engrams CLI |
|---|---|---|---|
| Setup Time | None | Tedious (config files, uvx, node paths) | 1 Minute (binary install) |
| Token Waste | High (pasting files every time) | Low (query on demand) | Low (query on demand) |
| IDE Sandbox Issues | None | Common (crashes, permission drops) | None (runs as normal tool) |
| Offline Support | Yes | Depends on embeddings API | Yes (fully local SQLite) |
| Git Versioning | Manual files only | Binary DB or None | Automatic via Export/Import |
How Engrams Works
Every time you start a new chat with your AI assistant, it has no memory of your previous conversations. Engrams changes that. It quietly sits alongside your AI tool, remembering your project decisions, design patterns, and progress — and automatically provides the right information when it's needed. Linked together, those records form a knowledge graph your AI traverses to answer with the specifics of your project instead of generic advice. The more you store and link, the sharper the advisor gets.
How a typical interaction works
- You ask your AI to build a feature. For example: "Implement the payment webhook handler."
- Your AI runs
engrams advise src/adapters/stripe.rsbefore editing. Engrams intercepts the action in ~1ms and returns the matching playbook (trigger + rule + scope) alongside anchored contracts and pattern checks—using a fraction of the tokens of reading source files. - Your AI writes code aligned with project context, respecting architectural decisions on the first turn without defensive file exploration.
- Session closes and compounds. Running
engrams session closevalidates PR linkage (when--pris passed), tallies how many retrievals your playbooks guided, records estimated reads/tokens saved, and surfaces recurring threads with ready-to-fillschema proposetemplates for human confirmation.
On Day 1, your advisor recalls exact contracts you logged. As decisions, standards, and file anchors accumulate, Engrams spots recurring threads at session close and helps you confirm reusable playbooks. On this repository itself (engrams-cli v0.17.0), everyday feature work grew the project graph from 23 nodes on Day 1 to 318 nodes, 808 links, and 3 active playbooks—guiding over 130 sessions automatically.
Architecture Overview
Engrams runs as a standalone CLI tool in your project workspace. It integrates with any AI coding tool supporting shell commands (like Claude Code, Codex, omp, Cursor, or Zed). The CLI maintains a local SQLite database at engrams/context.db for high-performance FTS5 queries and updates. To share context with your team, developers export database state to version-controlled Markdown files in the workspace.
(Claude Code, Cursor, Codex, omp…)
(Rust binary)
engrams/context.db (local)
engrams_export/ (Git)
Storage: local SQLite and Markdown exports
Engrams uses a simple, robust storage model designed for git-controlled sharing:
| Storage | Location | Purpose |
|---|---|---|
| SQLite DB | engrams/context.db (in .gitignore) | Local, high-performance database supporting FTS5 search and relationships. |
| Markdown Files | engrams_export/ (committed to Git) | Human-readable dumps of the database items, easily version-controlled and shared. |
The core design is Git-friendly. The SQLite database is local to your machine, while the exported Markdown files are the source of truth committed to Git.
Team sync via Git
Sharing Engrams project memory across team members is fully manual and transparent:
- Export: Run
engrams exportto dump all SQLite items toengrams_export/. - Commit: Push the
engrams_export/directory alongside your code. - Import: Teammates pull the changes and run
engrams importto update their local SQLite database.
Workspace detection
Engrams automatically resolves where your project lives by scanning upwards for indicators like .git, Cargo.toml, or package.json. The database is stored relative to this discovered root.
How Engrams connects to your AI tool
There are no background services or daemons running. Your AI assistant calls the engrams binary directly as a shell/terminal command. This ensures total security, zero background memory footprint, and compatibility with any agent tool that can run terminal commands.
Stored Knowledge Types
Engrams stores structured knowledge across several distinct types. Each type maps to a database table and is managed via specific engrams CLI subcommands.
| Type | What It Does | Example |
|---|---|---|
| Schemas (Playbooks) | Human-confirmed mental models that bundle 3+ notes with a trigger, directive, and folder/tag scope | performance-rules — fires whenever editing src/ops/ Rust files |
| Decisions | Choices your team made, why, and their interface contracts (--contract) | "Use PostgreSQL row locks instead of check-then-insert on schedule writes" |
| Patterns | Repeatable standards and enforceable regex/AST checks (engrams check) | "Borrow dynamic SQL parameters via Vec<&dyn ToSql>" |
| Progress | Task state across sessions (Todo → InProgress → Done) | "Completed v0.17 worktree path canonicalization" |
| Context & Custom Data | Project overview, active workstream tracks, glossaries, and research notes | Current sprint focus, API glossary, saved benchmark findings |