by mnemon-dev
LLM-supervised persistent memory for AI agents — graph-based recall, cross-session knowledge, single binary. Works with Claude Code, OpenClaw, and any CLI agent.
# Add to your Claude Code skills
git clone https://github.com/mnemon-dev/mnemonEnglish | 中文
LLM-supervised persistent memory for AI agents.
LLM agents forget everything between sessions. Context compaction drops critical decisions, cross-session knowledge vanishes, and long conversations push early information out of the window.
Mnemon gives your agent persistent, cross-session memory — a four-graph knowledge store with intent-aware recall, importance decay, and automatic deduplication. Single binary, zero API keys, one setup command.
Claude Max / Pro subscriber? Mnemon works entirely through your existing subscription — no separate API key required. Your LLM subscription is the intelligence layer. Two commands and you're done.
Most memory tools embed their own LLM inside the pipeline. Mnemon takes a different approach: your host LLM is the supervisor. The binary handles deterministic computation (storage, graph indexing, search, decay); the LLM makes judgment calls (what to remember, how to link, when to forget). No middleman, no extra inference cost.
| Pattern | LLM Role | Representative | |---|---|---| | LLM-Embedded | Executor inside the pipeline | Mem0, Letta | | | None — reads file at session start | Claude Code Memory | | | Tool provider via MCP protocol | claude-mem | | | External supervisor of a standalone binary | |
No comments yet. Be the first to share your thoughts!
Mnemon also addresses a gap in the protocol stack. MCP standardizes how LLMs discover and invoke tools. ODBC/JDBC standardizes how applications access databases. But how LLMs interact with databases using memory semantics — this layer has no protocol. Mnemon's three primitives — remember, link, recall — form an intent-native protocol: command names map to the LLM's cognitive vocabulary (remember not INSERT, recall not SELECT), and output is structured JSON with signal transparency rather than raw database rows.
Memory has a compound interest effect — the longer it accumulates, the greater its value. LLM engines iterate constantly, skill files cost nearly nothing to write, but memory is a private asset that grows with the user. It is the only component in the agent ecosystem worth deep investment.
See Design & Architecture for details.
Homebrew (macOS / Linux):
brew install mnemon-dev/tap/mnemon
Go install:
go install github.com/mnemon-dev/mnemon@latest
From source:
git clone https://github.com/mnemon-dev/mnemon.git && cd mnemon
make install
Verify installation:
mnemon --version
mnemon setup
mnemon setup auto-detects Claude Code, then interactively deploys skill, hooks, and behavioral guide. Start a new session — memory just works.
mnemon setup --target openclaw --yes
One command deploys skill, hook, plugin, and behavioral guide to ~/.openclaw/. Restart the OpenClaw gateway to activate.
NanoClaw runs agents inside Linux containers. Use the /add-mnemon skill to integrate:
/add-mnemon — Claude Code will modify the Dockerfile, add a container skill, and set up volume mountsThe skill is available at .claude/skills/add-mnemon/ in the NanoClaw repo.
mnemon setup --eject
Once set up, memory operates transparently — you use your LLM CLI as usual. Mnemon integrates via Claude Code's hook system, injecting memory operations at key lifecycle points:
Session starts
│
▼
Prime (SessionStart) ─── prime.sh ──→ load guide.md (memory execution manual)
│
▼
User sends message
│
▼
Remind (UserPromptSubmit) ─── user_prompt.sh ──→ remind agent to recall & remember
│
▼
LLM generates response (guided by skill + guide.md rules)
│
▼
Nudge (Stop) ─── stop.sh ──→ remind agent to remember
│
▼
(when context compacts)
Compact (PreCompact) ─── compact.sh ──→ extract critical insights to remember
Four hooks drive the memory lifecycle. Prime loads the behavioral guide — a detailed execution manual for recall, remember, and sub-agent delegation. Remind prompts the agent to evaluate recall and remember before starting work. Nudge reminds the agent to consider remember after finishing work. Compact instructs the agent to extract and save critical insights before context compression. The skill file teaches command syntax. The guide (~/.mnemon/prompt/guide.md) defines the detailed rules for when to recall, what to remember, and how to delegate.
You don't run mnemon commands yourself. The agent does — driven by hooks and guided by the skill and behavioral guide.
remember, link, recall) map to the LLM's cognitive vocabulary, not database syntax; structured JSON output with signal transparencyremember auto-detects duplicates and conflicts; skips or auto-replacesAll your local agentic AIs — across sessions and frameworks — sharing one pool of live memory.
Claude Code ──┐
│
OpenClaw ─────┤
│
NanoClaw ─────┤
├──▶ ~/.mnemon ◀── shared memory
OpenCode ─────┤
│
Gemini CLI ───┘
The foundation is in place: a single ~/.mnemon database that any agent can read and write. Claude Code's hook integration is the reference implementation; OpenClaw uses a plugin-based approach; NanoClaw integrates via container skills and volume mounts. The same pattern can be replicated for any LLM CLI that supports event hooks or system prompts.
The longer-term direction is a memory gateway: protocol decoupled from storage engine. The current SQLite backend is the first adapter; the protocol surface (remember / link / recall) can sit on top of PostgreSQL, Neo4j, or any graph database. Agent-side optimization (when to recall, what to remember) and storage-side optimization (indexing, graph algorithms) evolve independently. See Future Direction for details.
Do different sessions share memory?
Yes. By default, all sessions use the same default store — a decision remembered in one session is available in every future session.
Can I isolate memory per project or agent? Yes. Use named stores to separate memory:
mnemon store create work # create a new store
mnemon store set work # set as default
MNEMON_STORE=work mnemon recall "query" # or use env var per-process
Different agents/processes can use different stores via the MNEMON_STORE environment variable — no global state contention.
Local or global mode?
mnemon setup defaults to local (project-scoped .claude/), recommended for most users. Global (mnemon setup --global, installed to ~/.claude/) activates mnemon across all projects — convenient if you want other frameworks (e.g., OpenClaw) to share memory by forwarding requests through Claude Code CLI, but may add maintenance overhead.
How do I customize the behavior?
Edit ~/.mnemon/prompt/guide.md. This file controls when the agent recalls memories and what it considers worth remembering. The skill file (SKILL.md) is auto-deployed and should not need manual editing.
What is sub-agent delegation?
Memory writes don't happen in the main conversation. The host LLM (e.g., Opus) decides what to remember, then delegates the actual mnemon remember