openmem
Health Warn
- License — License: Apache-2.0
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 5 GitHub stars
Code Fail
- exec() — Shell command execution in bench/cc_stream.py
Permissions Pass
- Permissions — No dangerous permissions requested
No AI report is available for this listing yet.
Memory and context management for coding agents: smart compaction that keeps every turn searchable, pluggable memory providers (Hindsight, mem0, Cognee), one setup wizard.
OpenMem
OpenMem. Memory and context management for coding agents: smart compaction that keeps every turn searchable, pluggable memory providers (Hindsight, mem0, Cognee), one setup wizard.
A. Memory: your sources become memory any agent can query.
B. Context management: long sessions stay under the limit; nothing is summarized away.
Benchmarks: In seed-matched ContextBench log tasks on Haiku 5.5, smart compaction scored 0.469 higher than keep-everything (95% bootstrap interval 0.339–0.578; eight pairs). All arms scored 1.0 on kv R4000. Costs fell at R4000, L6400, and L12800; the L1600 saving remains uncertain. Claude Code's default native arm made no compaction in these tasks. Methods and results · paired intervals and pending work. Compact-Bench real-coding results are pending.
Docs: bcmyguest.github.io/openmem/
MCP: npx -y -p @bcmyguest/openmem openmem-mcp (after the wizard — it needs a running provider)
Start here: Concepts · Quickstart · Compatibility
Quickstart
| Step | Command |
|---|---|
| 1. Wizard | npx @bcmyguest/openmem |
| 2. Check | npx @bcmyguest/openmem doctor |
| 3. Coding agents | npx @bcmyguest/openmem install-coding-agent --yes |
Checkout instead of npx:
git clone https://github.com/bcmyguest/openmem.git && cd openmem
npm install && npm run setup
Other commands from a checkout: node cli/openmem.mjs <command>.
Needs: Docker Compose v2, Node ≥ 24 (built-in node:sqlite with FTS5), and an LLM route if you use Hindsight (lemond, Ollama, OpenAI-compatible, or a Claude subscription through Meridian — set in the wizard).
Later: npx @bcmyguest/openmem up / down / switch <provider> --yes / doctor.
Wizard dry-run (what first setup plans — no writes):
Full guide: Quickstart · Concepts · Architecture
Architecture
The two diagrams at the top show memory (A) and context management (B).
Same diagrams as Mermaidflowchart LR
S["<b>Sources</b><br/>Git repos: docs, code outlines<br/>Obsidian vaults · notes · papers · bookmarks<br/>RSS · OpenAlex feeds"] -->|index| I["<b>OpenMem indexer</b><br/>polls repos, watches folders"]
I -->|retain| P[("<b>Memory provider</b><br/>one active, swappable<br/>Hindsight (default) · mem0 · Cognee · …")]
P <--> M["<b>OpenMem MCP</b><br/>memory_recall · memory_add<br/>memory_search · memory_reflect<br/>memory_pages_* + export/import, status…"]
M <-->|tools| A["<b>Coding agents</b><br/>Claude Code · Codex · Cursor · OpenCode"]
A -.->|"session hooks: recall at start · retain at stop"| M
classDef om fill:#e8eaf9,stroke:#4651a6,color:#1b1d2a
class I,M om
flowchart LR
A["<b>Coding agent</b><br/>Claude Code · Codex · OpenCode 1"] -->|requests| X["<b>Context proxy</b><br/>LiteLLM pre-call hook<br/>trims at 125k tokens (Haiku 95k) · no LLM call"]
X -->|trimmed request| API["<b>Model API</b><br/>Anthropic · ChatGPT (Codex)"]
X -->|every turn| S[("<b>Session store</b><br/>SQLite · every turn, verbatim")]
S -->|"MCP: smart_compact_search · smart_compact_sql"| A
O["<b>OpenCode 2</b><br/>native plugin, no proxy"] -.->|same store| S
classDef om fill:#e8eaf9,stroke:#4651a6,color:#1b1d2a
class X,S om
Native compaction replaces history with an LLM summary, so exact values can be lost; OpenMem keeps every turn verbatim and searchable. The optional context proxy trims long agent sessions without an LLM summary. See the full architecture for setup, optional integrations, and provider-specific behavior.
Providers and portability
- Providers — Provider status lists every provider and its support level from the manifests. Contributor details: adding a provider.
- MCP — unified
memory_*plus optional native/NotebookLM servers: MCP setup. - Context management — smart compaction on/off, per-agent support, tools and config: Context management.
- Portable memory —
memory_export/memory_importspeak PMM: Portable memory. - Switch —
npx @bcmyguest/openmem switch <provider>does not migrate data by itself; export/import (or re-index) moves content.
Compose runs the shared indexer and the services required by the selected provider. Hindsight uses litellm and hindsight (127.0.0.1:8888); mem0 and Cognee use their own APIs and do not include LiteLLM by default. LiteLLM can also be added for memory_reflect synthesis on mem0/Cognee, or to host the optional context proxy's pre-call hook. See Architecture for runtime paths.
Inspiration and related
OpenMem is not affiliated with these projects; they shape the problem or the pattern.
| OpenFeature | Inspiration for a vendor-agnostic interface + pluggable providers (there: feature flags; here: coding-agent memory). |
| mise / asdf | One CLI over many backends; declarative config and tasks without replacing each tool’s own settings. |
| LiteLLM | Model proxy used on Hindsight stacks; its pre-call hook hosts the context proxy. |
| Hindsight coding agents | Reference implementation for knowledge pages, initiative capture and ingest status; OpenMem's hooks replace it in openmem mode. |
| Mainplane | Inspiration for smart compaction: continue in a fresh context with a pointer to the saved transcript and retrieve as you go, instead of an LLM summary. |
| Letta / MemGPT | Inspiration for smart compaction: evicted turns kept verbatim in searchable recall storage the agent pages back with tools, and file-style search over the transcript (74.0% on LoCoMo). OpenMem does this in a proxy and an MCP server, so no Letta server is needed. |
| rtk | Compresses shell command output before the agent sees it; install-coding-agent runs rtk init when it is installed. Inspired the context proxy's compression of large tool results (reimplemented, not bundled). |
| opencode-clm | OpenCode plugin for Context Language Models: the model edits a file mirror of its own context. Same goal as smart compaction, with the model doing the trimming (comparison). |
| Meridian | Bridges a Claude subscription to an Anthropic-compatible API; optional Hindsight model backend (guide). |
| OpenCode / Claude Code hooks / Codex hooks | The agent hook and plugin APIs OpenMem translates between (compatibility). |
Research notes and benchmark results for the context proxy: Context research.
More setup analogues: Pluggable memory providers.
Formerly personal-memory. Use the
openmemCLI and MCP server name; installers drop the oldpersonal-memoryMCP entry.
License
Apache License 2.0 — see LICENSE (Copyright 2026 B Guest).
Contributing
Contributions are welcome. Read and understand the code you change before opening a PR. See the contribution guide.
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found