OPEN SOURCE / MCP

Xanima.

Long-term memory for AI agents.
A real forgetting curve. A memory graph. Sleep-cycle consolidation. Drop it into Claude Code, Cursor, or any MCP client.
Formerly SharpWave. Same engine, new name.

npx -y xanima
Memory Graph FSRS Beliefs & Goals Multi-Agent
THE PROBLEM

Most agent memory doesn’t work the way memory should.

Your agent forgets everything the moment a session ends. The usual fix is to dump conversation history into a vector store and retrieve the most similar chunks — which works until it doesn’t:

  • It never forgets. Every note lives forever at equal weight, so a throwaway remark from March competes with something that actually matters.
  • It has no structure. A pile of embeddings can tell you what’s similar. It can’t tell you what caused what, or that one fact replaced another.
  • Recall degrades as it grows. More memories means more near-matches, and precision falls off exactly when the memory becomes worth having.

Human memory doesn’t work that way. It decays on a curve, strengthens what gets used, consolidates related things into concepts, and lets the rest fade. Xanima models that — and on top of memory, it keeps track of what the agent believes, how sure it is, what it decided, and what it’s working toward.

HOW IT WORKS

Built around how memory actually consolidates.

Sharp-wave ripples are the hippocampal events that replay and consolidate memories during rest. That’s the mechanism this is built around, not a metaphor bolted on afterward.

01

A real forgetting curve

Every memory carries FSRS-6 stability and retrievability. Unused memories decay on a power-law curve and drop out of recall. Faded memories go dormant instead of being deleted — an explicit search (include_dormant) brings them back.

02

Consolidation, not just storage

A background pass replays recent episodes, promotes recurring patterns into durable semantic nodes, synthesises clusters into higher-level schemas, and downscales the noise — modelled on slow-wave and REM sleep. Plans the agent carried out become step-by-step procedures, verified by repeated success.

03

A graph, not a bag

Memories connect through typed edges — caused_by, supports, contradicts, supersedes, instance_of and more. Retrieval spreads activation across those edges.

04

Beliefs, not just facts

Every memory carries a confidence, a source and a status. brain_retract and brain_supersede correct a memory with a reason and keep the history; as_of asks what the agent believed on a given date.

05

Hybrid retrieval

Full-text search fused with vector similarity via reciprocal rank fusion, then spread across the graph. Vector search is optional — full-text and graph retrieval work with no embedding provider at all.

06

Multi-agent by design

One Xanima process can back any number of agents at once. Each agent’s memories live in their own database — isolated, never cross-contaminated — under a single config entry.

INSTALL

Standard stdio MCP server.

Point any MCP client at it. Node.js 22 or newer.

Config

{
  "mcpServers": {
    "xanima": {
      "command": "npx",
      "args": ["-y", "xanima"]
    }
  }
}

One-line

claude mcp add xanima -- npx -y xanima
openclaw mcp add xanima --command npx --arg -y --arg xanima
openclaw mcp doctor xanima --probe

Memory lands in ~/.xanima/ as a SQLite database. Nothing leaves your machine unless you configure a remote embedding provider.

Leave XANIMA_AGENT_ID unset and one process serves the whole fleet: every brain_* call carries the calling agent’s agent id and is routed to its own ~/.xanima/<agent>/brain.db. Set it to pin the server to one agent.

Upgrading from SharpWave

The sharpwave command still works — it’s kept as an alias of xanima. Your data is safe where it is: while ~/.xanima doesn’t exist and ~/.sharpwave does, the old folder is used (with a one-time notice). xanima-server migrate (the brain service, built from the xanima repo) copies it over, verifies every brain’s counts, and never moves or deletes the old folder. XANIMA_* env vars replace SHARPWAVE_*; the old names are still read with a deprecation warning.

TOOLS

32 brain_* tools.

Memory, beliefs, decisions, goals, reflection and plans. Every schema comes from xanima-core’s unified tool module, the same one the OpenClaw plugin uses.

GroupTools
Memorybrain_query, brain_write, brain_link, brain_supersede, brain_stats, brain_history, brain_expand, brain_review, brain_forget, brain_edges, brain_reset
Beliefsbrain_retract, brain_status
Decisions & goalsbrain_record_decision, brain_update_decision_outcome, brain_query_decisions, brain_set_goal, brain_update_goal, brain_list_goals
Reflection, open items & plansbrain_reflect, brain_replay, brain_hypothesis, brain_question, brain_list_open, brain_commit, brain_commitments, brain_plan, brain_changes, brain_conflicts, brain_briefing, brain_forget_impact
Soulbrain_export_soul — export the agent’s own brain as a portable xanima-soul/1 package
HighlightsWhat it does
brain_queryHybrid FTS + vector + spreading activation. as_of for what the agent believed at a past time; include_dormant to search and revive faded memories.
brain_expandFull detail for a node: content, FSRS metrics, encoding context. source_turns prints the original conversation the memory came from.
brain_supersedeReplace an outdated node with a reason. The old version is kept as history but never injected again.
brain_retractRetract a memory that is wrong. Kept as history with your reason; never recalled again.
brain_statusShort self-status: last sleep, low-confidence and disputed counts, hot conflicts, anything that needs attention.
brain_resetWipe an agent’s brain back to empty (a .db backup is taken first). confirm must equal the agent id.
WHAT PEOPLE USE IT FOR

From coding assistants to personal memory.

MCP SERVER VS OPENCLAW PLUGIN

Same engine. Two surfaces.

Xanima is the standalone MCP server — point any MCP client at it and go. Works with Claude Code, Cursor, Claude Desktop, any MCP client. 32 brain_* tools.

Xanima for OpenClaw (formerly OpenWave) is the OpenClaw plugin — same engine, but in-process: it injects memory into every turn automatically, runs the sleep system (slow-wave/REM consolidation, awake replay, LLM fact extraction) inside your agent’s process, and registers all 43 brain_* tools, including rooms, focus and identity. Full persistence, no child process.