Cross-session memory and context continuity for AI coding agents.

Engrim is a local-first, zero-dependency engine that persists architectural decisions, measured outcomes, and project state across session clears. Clear context freely without losing the rationale behind past work.

$ pip install engrim && engrim setup
Local SQLite · Zero telemetry
Session Boot Trace ~4k char memory pack
# Agent starts a new session after context clear (/clear)
$ engrim context
🧠 engrim · memory restored for this project · /workspace/my-project
[DECISION #42] Chose SQLite WAL mode over external database daemon
[FEEDBACK #45] PreCompact hook captures state at decision time, not session end
[POINTER #50] Active task: Add benchmark regression tests for hybrid search
# Context loaded in < 5ms · Leaves 98% of context window free for reasoning

Core Workflow

1. Capture decisions as you work
engrim add -t decision -s "Chose Postgres over Mongo" --tags db
2. Query project memory on demand
engrim recall -q "database architecture" --tag db
3. Hydrate session boot pack
engrim context --budget 4000
4. Pre-clear integrity gate
engrim review --strict

Design Invariants

Local-First Storage

All records persist in a local SQLite database at ~/.engrim/memory.db. No servers, no accounts, no cloud dependencies.

Sub-4k Char Budget

Curates high-signal memories into a compact boot pack under 4,000 characters so your LLM context window remains focused on code.

Universal Agent Hooks

Native integrations for Antigravity, Claude Code, Cursor, and OpenAI Codex via standard lifecycle hooks and MCP.

Hybrid Search Retrieval

Combines BM25 keyword matching with dense vector embeddings using Reciprocal Rank Fusion for fast recall across project history.