Engrim, a Local-First SQLite Memory Engine for AI CLIs, Released to Preserve Context During Model Switches
Key point
Engrim, a local-first SQLite memory engine that preserves context during model switches and session resets in AI CLI environments, has been released.
Details
Engrim, a local-first memory engine, has been released to address the context window limitations and memory loss during model switches encountered when using AI coding agents (such as Claude Code, Cursor, and Antigravity). This tool stores project-scoped architectural decisions, constraints, and states in a local SQLite file, enabling the retention of project intelligence even when changing AI models or sessions.
Key Features and Architecture
- Hybrid Search Engine: Combines SQLite FTS5 (bm25 keyword search) with static vector embeddings (model2vec) to retrieve relevant memories with zero latency.
- Episodic Working Memory: To prevent attention dilution as the context window grows, it compresses tens of thousands of tokens of work into curated memory packs of under 1,000 tokens for reloading.
- Multi-Agent Support: Integrates with major AI CLI environments including Google Antigravity, Claude Code, Cursor, and Windsurf, tracking the origin (origin_agent) of memories generated by each agent.
- Fully Local Storage: All data is stored in
~/.engrim/memory.db, with no cloud synchronization or telemetry. Embeddings load in approximately 30ms on CPU without a GPU.
Empirical Case Studies and Results
Testing 105 consecutive sessions on a 50,000-line algorithmic trading system confirmed zero context amnesia and zero regressions during model switches. This resulted in a reduction of over 99% in context reloading costs upon session restarts, demonstrating efficiency by compressing workloads of over 153,000 tokens to less than 1% of their original size.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.