engrim

The Universal Cross-Model & Cross-Agent Episodic Memory Standard.
A local-first, project-scoped SQLite memory engine that allows developers to freely switch between models and environments (Google Antigravity, Claude Code, Cursor, Codex CLI, GitHub Copilot CLI, OpenCode, and Windsurf) on the same codebase without losing architectural decisions, user constraints, or project state.
1. Overview & Core Value Proposition
"Why pay for 200,000 tokens of forgotten noise on every turn? The models are disposable utilities; your project's decisions are not."
Engrim is the universal, cross-model episodic memory standard engineered specifically for autonomous AI coding agents and heavy software development.
It solves the "200,000-token context window trap" (where coding models suffer from severe attention dilution, compounding per-turn token costs, and the loss of prior architectural decisions whenever a chat session is cleared) by replacing raw transcript replay with 4,000 characters of high-precision, curated episodic working memory stored in a single, local-first SQLite file (~/.engrim/memory.db).
The Problem vs. The Engrim Standard
| Challenge | Without Engrim (Token Bloat & Context Resets) | With Engrim (Episodic Continuity) |
|---|
| Context Window | Attention Dilution: 150k+ tokens re-sent on every turn; models lose reasoning sharpness and hallucinate past constraints. | Precision Working Memory: ~4,000 chars (<1,000 tokens, <1% of context) injected at boot. Zero attention dilution. |
| Session Clearing | Context Reset on /clear: Clearing chat wipes agent context to zero; you spend minutes re-explaining rules and architecture. | Continue-As-Clear: Clear anytime (/clear). Decisions, active state, and [▶ RESUME HERE] reload instantly. |
| Agent Ecosystem | Vendor Silos: Decisions made in Claude Code are invisible in Antigravity, Cursor, Codex, Copilot CLI, or OpenCode. | Universal Substrate: One local SQLite store (~/.engrim/memory.db) shared across all 6 major harnesses. |
| Hook Reliability | Silent Failures: Moving across machines or OSes silently breaks hardcoded binary paths with no error message. | Self-Healing Diagnostics: engrim doctor --fix checks the supported hook and MCP configurations and repairs stale binary paths. |
| Data Privacy | SaaS Cloud Leakage: Proprietary code and architectural constraints sent to third-party memory APIs. | 100% Local & Private: Stored locally in SQLite WAL mode (POSIX 0600). No telemetry, no cloud sync, no tracking. |
2. Architecture & How It Works (The 10-Second Mental Model)
graph TD
subgraph Agents ["Supported Agent Environments"]
AGY["Google Antigravity<br/>(PreInvocation & Stop Hooks)"]
CLAUDE["Claude Code<br/>(SessionStart & Stop Hooks)"]
CURSOR["Cursor / Windsurf<br/>(Model Context Protocol stdio)"]
CODEX["Codex CLI<br/>(Hooks, guidance & optional MCP)"]
OPENCODE["OpenCode<br/>(Plugin & MCP)"]
COPILOT["GitHub Copilot CLI<br/>(Command hooks & MCP)"]
end
subgraph CoreEngine ["engrim Core Engine (v1.4.11)"]
ADAPTERS["Adapters & Lifecycle Hooks<br/>(agy, claude, opencode, copilot, mcp)"]
DOCTOR["Health & Diagnostic Engine<br/>(engrim doctor --fix)"]
PROVENANCE["Agent Provenance Engine<br/>(origin_agent tracking)"]
ROUTER["Hybrid Retrieval & Minder<br/>(bm25 lexical + vector cosine)"]
end
subgraph Storage ["Local-First SQLite Store (~/.engrim/memory.db)"]
MEMORIES[("Curated Memories<br/>(decisions, facts, feedback)")]
FTS5["FTS5 Full-Text Search<br/>(porter stemmer, triggers)"]
VEC["Vector Embeddings<br/>(model2vec static embeddings)"]
LOG["Flight Recorder Log<br/>(turns + action lines)"]
end