SharpWave
Long-term memory for AI agents as a standalone MCP server. A real forgetting curve, a memory graph, and consolidation during rest. Drop it into Claude Code, Cursor, or any MCP client.
npx -y sharpwave
Long-term memory for AI agents. Standalone MCP server. Free, open source.
The problem with most agent memory
Your agent forgets everything the moment a session ends. The usual fix is to dump conversation history into a vector store and retrieve the 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. SharpWave models that.
How it works
The name comes from sharp-wave ripples — the hippocampal events that replay and consolidate memories during rest. That's the mechanism this is built around, not a metaphor bolted on afterward.
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. Reviewed ones strengthen. Importance and emotional weight scale how durable a memory starts out.
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.
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.
Memories can be replaced
brain_supersede closes out a stale memory and links the replacement, so the graph keeps its temporal integrity instead of accumulating contradictions.
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.
Multi-agent by design
One SharpWave 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
SharpWave is a standard stdio MCP server. Point any MCP client at it:
{
"mcpServers": {
"sharpwave": {
"command": "npx",
"args": ["-y", "sharpwave"]
}
}
}
Or one-line:
claude mcp add sharpwave -- npx -y sharpwave
openclaw mcp add sharpwave --command npx --arg -y --arg sharpwave
openclaw mcp doctor sharpwave --probe
Memory lands in ~/.sharpwave/ as a SQLite database. Nothing leaves your machine unless you configure a remote embedding provider.
Tools
| Tool | What it does |
|---|---|
brain_query | Search and recall memories using hybrid FTS + vector + spreading activation. |
brain_write | Store a new memory node. Auto-queues for embedding and PRISM/NEXUS auto-linking. |
brain_link | Create a typed edge between two existing nodes. |
brain_supersede | Replace an outdated node with updated content. Preserves graph temporal integrity. |
brain_stats | Node/edge/episode counts, neuromodulator state, consolidation status, embedding coverage. |
brain_history | Search episode history (raw conversation turns) by keyword. |
brain_expand | Get full detail for a specific node: content, FSRS metrics, encoding context, source episodes. |
brain_review | Apply an FSRS-6 spaced-repetition review to a node. Updates stability, retrievability, and SIGMA calibration. |
brain_forget | Physically delete a node. Refuses to delete nodes with active edges unless force=true. |
brain_edges | Get all active incoming and outgoing edges for a node. |
brain_reset | Wipe an agent's brain back to empty (a .db backup is taken first). |
What people use SharpWave for
- Agents that remember prior conversations, preferences, and decisions across sessions
- Coding assistants that recall past fixes and architectural choices
- Multi-agent systems where each agent has its own isolated memory store
- Personal assistants that consolidate daily notes into durable semantic knowledge
- Anything where the alternative is losing context every time the session ends
SharpWave vs OpenWave
Same engine. Two surfaces.
SharpWave is the standalone MCP server — point any MCP client at it and go. Works with Claude Code, Cursor, Claude Desktop, any MCP client.
OpenWave is the OpenClaw plugin version — same engine, but in-process: autonomic wake-up injects memory into every turn, the sleep system (slow-wave/REM consolidation, awake replay, LLM fact extraction) runs inside your agent's process, and all 16 brain_* tools are registered. Full persistence, no child process.