OpenMem: smarter compaction for cheaper LLM sessions and other memory tools

Wait 5 sec.

I built OpenMem for sharing memory between coding agents and trimming long sessions. Apache-2.0 · Local setup only for now, no hosted OpenMem service. 1. Bring your own memory backend The idea is to have a consistent memory Interface you can use with any memory backend. Hindsight, mem0, Cognee, or add an adapter for your own system. OpenMem connects that backend to Claude Code, Codex, Cursor and OpenCode. It exposes memory through MCP (Model Context Protocol): a way to give an agent tools it can call. In this case, tools to save notes, search memory and recall previous decisions. The agents use a common interface, so switching your memory backend doesn’t mean rebuilding each agent’s integration. 2. Reducing Costs by Context Masking Saves the full conversation in local SQLite, removes older history from the active prompt, and lets the agent search or retrieve it later. The trimming step makes zero LLM summarization calls. Currently works with Claude Code, Codex and OpenCode. From the published ContextBench log-triage tests with Haiku 5.5 (other Benchmarks): OpenMem Keep everything Cost per trial, at list prices $0.32 Total tokens, including cache reads and output 10.6M Prompt-cache hit rate 96% Small synthetic tests: three OpenMem trials and two baseline trials, with unequal seed counts. Full coding and Luna results are still pending. The context trimming idea (and masking) comes from MemGPT for external memory, Mainplane for transcript pointers, and The Complexity Trap for observation masking. If you try it, I’m interested in which memory backend you use and what the agent fails to retrieve after a trim :)   submitted by   /u/goost95 [link]   [comments]