Persistent MCP memory server with SQLite storage, demand-paged retrieval, eviction, and pinning for shared agent context.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
The install command below didn't complete successfully in our automated test.
uvx --fromDownloading cpython-3.14.7-linux-x86_64-gnu (download) (34.3MiB) Downloaded cpython-3.14.7-linux-x86_64-gnu (download) Building vmem @ git+https://github.com/soolaugust/0CompactMem@1d57f12fbb46742a14ffe623fba474bf554ff954 Downloading cryptography (4.5MiB) Downloading pydantic-core (2.0MiB) Downloaded pydantic-core Downloaded cryptography Built vmem @ git+https://github.com/soolaugust/0CompactMem@1d57f12fbb46742a14ffe623fba474bf554ff954 Installed 29 packages in 17ms Traceback (most re
This is an experimental automated check and can have false negatives β missing environment variables, a slow cold install, etc. It doesnβt necessarily mean somethingβs wrong. Last checked 1mo ago.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by 0CompactMem.
Virtual memory for LLM context. For Claude Code and every AI agent.
Your AI never forgets β no more "context compacted" interruptions.
One-line install via Claude Code:
If you use Claude Code, you know this pain:
Every time this happens, your AI loses track of decisions, constraints, and hard-won context. You re-explain. It re-learns. Hours of accumulated understanding β gone in one compaction event.
And if you run multiple agents? They can't share what they've learned. Each one starts from zero.
This isn't a model limitation. It's a missing infrastructure layer.
vMem gives your AI agents persistent, retrievable context managed like virtual memory: the context window is the hot working set, and durable knowledge lives outside it until demand-paged back in.
The result: OS-managed context continuity. Your AI retains every decision, constraint, and lesson across sessions, across compactions, across agents.
The whole pipeline runs inside Claude Code hooks. There is no manual memory management.
vMem is virtual memory for LLM context: instead of treating the context window as the whole world, it manages a working set with OS primitives.
| What others see | What vMem does |
|---|---|
| "Context compacted" | Durable knowledge already lives outside the window |
| New session starts | Working set auto-restored in <100ms |
| Multiple agents running | All share one managed context substrate |
| Constraint decided 3 weeks ago | Pinned with mlock-style semantics |
OS-managed context. Durable working sets. No repeated explanation.
The secret sauce? We didn't invent new algorithms. We borrowed what the Linux kernel has been doing for 40 years:
| OS concept | vMem equivalent |
|---|---|
| RAM (working space) | Context window β what the AI sees right now |
| Disk (persistent storage) | Knowledge base β facts that survive across sessions |
| Demand paging | On-demand retrieval β fetch relevant memories at the right moment |
mlock | Hard / soft pinning β guarantee a constraint is never evicted |
| kswapd watermarks | Capacity-aware eviction under pressure |
| CRIU checkpoint / restore | Session snapshots β pause and resume seamlessly |
| Process scheduling | Multi-agent coordination β many agents, one knowledge base |
| kworker thread pool | Async extraction β I/O off the critical path |
| vMem | mem0 | Letta (MemGPT) | Zep | |
|---|---|---|---|---|
| Design metaphor | OS-managed context | Vector store | Agent runtime | Temporal graph |
| Context continuity | β pinned knowledge survives | β | β | β |
| Multi-agent shared | β native, single store | β οΈ via API | β | β |
| MCP-native | β first-class | β | β | β |
| Single-file deploy | β SQLite, no service | β needs server | β needs server | β needs server |
| Demand-paging retrieval | β explicit | implicit | implicit | implicit |
| Eviction policy | β kswapd + DAMON | TTL only | recency | recency + decay |
| Pin / mlock semantics | β | β | β | β |
TL;DR. If you're tired of context compaction wiping your AI's memory, and you want a solution that's
pip install, runs as a sidecar on a laptop, shares between several Claude Code / Cursor / custom agents, and never loses a pinned constraint β vMem is built for that.
| Metric | Value |
|---|---|
| Retrieval latency (P50, hot path) | ~0.1 ms (540x faster than the 54 ms subprocess baseline) |
| Recall@3 vs baseline | +147% |
| Cross-session recall | 94.2% |
| Token cost per call | ~44 tokens injected, +256 tokens net ROI (avoided re-explanation) |
| Test suite | 3,500+ tests across retrieval, eviction, MCP, privacy filter |
One-line install (recommended).
Manual install.
Detailed Claude Code hook configuration, daemon management, and troubleshooting live in docs/SETUP.md.
Three layers:
SessionStart, UserPromptSubmit, Stop, PostToolUse) and call into the store.memory_os.store.api / memory_os.store.vfs / memory_os.store.criu).For the full layered diagram, on-disk schema, and the rationale behind each subsystem, see docs/ARCHITECTURE.md. For the comprehensive OS-and-cognitive-science primitive mapping, see docs/DESIGN_PHILOSOPHY.md.
What landed already (1,051+ tuning iterations, eight major capability rounds) is summarized in CHANGELOG.md. Pain points it has resolved along the way are in docs/PROBLEMS_SOLVED.md.
Coverage: per-session DB isolation, concurrent-write safety, cross-agent IPC delivery, extractor-pool queue semantics, CRIU checkpoint validation, goals-progress idempotency.
No GPU. No external API. Everything runs locally.
| Dependency | Purpose |
|---|---|
| Python 3.12+ | Core runtime |
| SQLite (built-in) | Store + FTS5 full-text index |
nc, flock | Daemon socket + single-instance startup |
π Beyond Eviction: Full OS Context-Management Semantics for LLM Agent Persistence (PDF, 8 pages)
Technical paper describing the complete OSβagent-context mapping: demand paging, kswapd, DAMON, mlock, CRIU, kworker, and shared memory.
Each subsystem hides behind a clean VFS interface, so components are testable in isolation. Issues, design proposals, and pull requests are welcome β see the Discussions tab for design questions, and please run the test subset above before submitting a PR.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/soolaugust-0compactmem)<a href="https://allmcps.com/mcp/soolaugust-0compactmem"><img src="https://allmcps.com/api/badge/soolaugust-0compactmem?style=directory" alt="0CompactMem on AllMCPs" /></a>