Show HN: Engrim – A universal, local-first SQLite memory engine for AI CLIs
TL;DR Highlight
Swapping transcript replay for a 4,000-char memory pack kept decisions alive across /clear and tools
Who Should Read
Developers who juggle Claude Code, Cursor, Codex and similar CLIs and are tired of re-explaining project rules after every /clear
Core Mechanics
- One SQLite file replaces per-tool memory silos
- Memory lives in a single ~/.engrim/memory.db.
- Antigravity, Claude Code, Cursor, Codex CLI, Copilot CLI and OpenCode share it.
- Only about 4,000 chars are injected at session start
- A top-priority memory pack (~4k chars) is injected, led by [▶ RESUME HERE].
- It is contrasted with resending 150k+ tokens of transcript each turn.
- Records come from hooks or MCP
- The agent writes decisions via the engrim_add MCP tool, or lifecycle hooks capture them automatically.
- Each record carries origin_agent, the agent that wrote it.
- Retrieval mixes keyword and vector search
- It combines SQLite FTS5 (bm25) with model2vec static embeddings.
- Recall is stated to take about 30ms.
- One engrim setup auto-detects installed tools
Community Reactions
- 105-session trading codebase case
- The author ran 105 sessions on a 50,000-line algorithmic trading system.
- 153,000 tokens of work shrank to a memory pack under 1,000 tokens, per the author.
- Calls for benchmarks against competitors
- A commenter asked for a comparison with rival memory plugins.
- Another noted there is no lifecycle management or conflict resolution yet, and the model decides when to use it.
- Skepticism that agent memory works
- One commenter said they had only seen LLMs write garbage to memory and recall it in irrelevant contexts.
- Suggestion to test unclean exits
- A commenter wants a test where a session dies mid-task, to see whether the next agent knows what was done versus only planned.
- They argue recovering decisions and recovering unfinished work are different tests.
- Experience with another memory plugin
- One user of ctx.rs for a couple of months said they almost never compact sessions now.
How to Apply
- Install and run engrim doctor
- Today, run pip install engrim and engrim setup --dry-run to see which files change.
- If it looks fine, run engrim setup and then engrim doctor to check hooks.
- Have the agent engrim_add decisions before /clear
- Right after an architectural decision, tell the agent to record it with engrim_add.
- Before /clear, run engrim_review to catch uncaptured decisions.
- Use origin_agent to trace sources in multi-tool teams
- Run engrim list to see which agent wrote each decision.
- Check the prompt of the source agent for suspicious entries.
- Trust the hooks in Codex explicitly
- After engrim setup --codex, review and trust the hooks with Codex's /hooks command.
- Add engrim setup --codex-mcp if you want the tool interface.
Try It
# Paste into a terminal (install and check engrim)
pip install engrim
# Preview what will change
engrim setup --dry-run
# Apply the setup, then check health
engrim setup
engrim doctor
# Next: ask your agent to record a decision, run /clear, and verify it is restored
engrim listTerminology
Related Papers
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.