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
- After pip install engrim, engrim setup checks dirs like ~/.claude and ~/.cursor and configures them.
- --dry-run previews changes.
- engrim doctor repairs hook paths
- It checks DB integrity and each agent's hook status.
- Adding --fix repairs stale binary paths.
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.
- They start a new session and let the agent work out what happened before.
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
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques