ClawMem

Local, SQLite-backed memory and hybrid search over your markdown for coding agents

By Yoloshi Nomotomoro? (individual) JavaScript Local · stdio Knowledge and memory

48 popularity score ★ 211 ↓ 190/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

FirstTerminal
npm install -g clawmem
clawmem bootstrap <NOTES_DIR> --name <NAME>
Claude CodeTerminal
claude mcp add clawmem -- clawmem mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "clawmem": {
      "command": "clawmem",
      "args": [
        "mcp"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "clawmem": {
      "command": "clawmem",
      "args": [
        "mcp"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "clawmem": {
      "type": "stdio",
      "command": "clawmem",
      "args": [
        "mcp"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.clawmem]
command = "clawmem"
args = ["mcp"]
Gemini CLITerminal
gemini mcp add --scope user clawmem clawmem -- mcp
Local (from source)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

FirstTerminal
git clone https://github.com/yoloshii/clawmem.git <ABSOLUTE_PATH_TO_CLONE>
cd <ABSOLUTE_PATH_TO_CLONE> && bun install
<ABSOLUTE_PATH_TO_CLONE>/bin/clawmem bootstrap <NOTES_DIR> --name <NAME>
Claude CodeTerminal
claude mcp add clawmem -- '<ABSOLUTE_PATH_TO_CLONE>/bin/clawmem' mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "clawmem": {
      "command": "<ABSOLUTE_PATH_TO_CLONE>/bin/clawmem",
      "args": [
        "mcp"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "clawmem": {
      "command": "<ABSOLUTE_PATH_TO_CLONE>/bin/clawmem",
      "args": [
        "mcp"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "clawmem": {
      "type": "stdio",
      "command": "<ABSOLUTE_PATH_TO_CLONE>/bin/clawmem",
      "args": [
        "mcp"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.clawmem]
command = "<ABSOLUTE_PATH_TO_CLONE>/bin/clawmem"
args = ["mcp"]
Gemini CLITerminal
gemini mcp add --scope user clawmem '<ABSOLUTE_PATH_TO_CLONE>/bin/clawmem' -- mcp

Settings 10

CLAWMEM_VAULTS Optional: JSON map of named vaults to SQLite paths. Without it there is one vault at ~/.cache/clawmem/index.sqlite. For list_vaults, vault_sync and the vault parameter.
CLAWMEM_NO_LOCAL_MODELS Optional: Set to true to fail instead of running models in-process with node-llama-cpp. Default false.
CLAWMEM_HEAVY_LANE Optional: Set to true for the quiet-window heavy maintenance worker. Meant for the clawmem watch service. Default false.
Set together: embedding
CLAWMEM_EMBED_URL Optional: Embedding server address. Left unset, embedding runs in-process.
CLAWMEM_EMBED_API_KEY secret Optional: Key for a cloud embedding provider. Setting it turns on cloud mode.
Set together: embedding wait
CLAWMEM_EMBED_WAIT_SEC Optional: Seconds clawmem embed waits for a self-hosted embedding server when no cloud key is set and local models are off. Default 120. For clawmem embed.
CLAWMEM_EMBED_WAIT_INTERVAL_MS Optional: Milliseconds between probes during that wait. Default 5000. For clawmem embed.
CLAWMEM_EMBED_PROBE_TIMEOUT_MS Optional: Milliseconds one probe during that wait may take. Default 15000. For clawmem embed.
Set together: consolidation
CLAWMEM_ENABLE_CONSOLIDATION Optional: Set to true to run the consolidation worker inside the server. Default false.
CLAWMEM_CONSOLIDATION_INTERVAL Optional: Consolidation worker interval in milliseconds. Default 300000.

What it does

ClawMem keeps a long-term memory for coding agents on your own machine. It indexes collections of markdown (project docs, notes, research, Obsidian vaults) into a SQLite vault, stores decisions and handoffs taken from past sessions, and lets the agent search all of it with keyword (BM25), vector and combined reranked queries, plus graph lookups for causes, timelines and entity facts.

The MCP server is one of four ways in. The same vault is also fed by Claude Code hooks, a native OpenClaw memory plugin and a Hermes Agent memory provider, so what one runtime records is visible to the others. Its makers say the hooks do most of the work in Claude Code and the MCP tools are for targeted look-ups when the hooks miss something.

The stdio server is started with `clawmem mcp`. At v0.43.5 the server code (src/mcp.ts) registers 33 tools, including a `__IMPORTANT` guide tool that tells the agent which search to use. It also serves any indexed document as a `clawmem://{+path}` resource, which the README does not mention. Searches return 10 results by default (`limit`), `multi_get` caps output at 10,240 bytes by default (`maxBytes`), and `lifecycle_sweep` only previews unless `dry_run` is set to false. Embedding, query expansion and reranking run on local models through llama-server or in-process node-llama-cpp. Cloud embedding providers are an opt-in alternative.

What it needs

RuntimeBun 1.0+
Runs onLinux, macOS
Also
  • Homebrew SQLite on macOS (brew install sqlite)
  • Optional GPU: about 4 GB VRAM for the default models, 16 GB for the larger stack
  • bd CLI v0.58.0 or newer, only for beads_sync

On Linux, install Bun with the bun.sh script rather than snap, which breaks the hooks. Windows users run it inside WSL2. Before the server is useful, create a vault with content using `clawmem bootstrap <dir> --name <name>`. Local models download on first use.

Limits

  • Limit Without a GPU or llama-server, models run in-process and can fall back to CPU silently. Set CLAWMEM_NO_LOCAL_MODELS=true to fail instead.
  • Limit Contradiction detection only works when a judge model is configured with the CLAWMEM_JUDGE_* settings.
  • Not covered vault_sync refuses paths under /etc, /root, /var, /proc, /sys and /dev, and any path containing .ssh, .gnupg, .env, credentials, secrets, .aws or .kube.
  • Limit memory_forget deactivates the best match as soon as it is called (confirm defaults to true), and lifecycle_restore does not bring forgotten documents back.
  • Limit The makers warn that most zerank-2 GGUF files lack the score head and do nothing as rerankers.
  • Limit CLAWMEM_HEAVY_LANE is meant for the clawmem watch service. The MCP server warns that its quiet-window worker may never run there.
  • Limit From v0.43.5, clawmem embed against a self-hosted embedding server with local models off waits 120 s by default, then skips embedding and exits 1.
  • Platform Native Windows is not recommended because the launcher and hooks are bash scripts. Use WSL2.
  • Limit The README's MCP tools heading says 31, but the v0.43.5 server registers 33 tools.

Without a GPU or llama-server, models run in-process and can fall back to CPU silently; set `CLAWMEM_NO_LOCAL_MODELS=true` to fail instead. Contradiction detection only works when a judge model is configured (`CLAWMEM_JUDGE_*`). `vault_sync` refuses directories under /etc, /root, /var, /proc, /sys, /dev and paths containing .ssh, .env, credentials, secrets, .aws or .kube. The makers warn that most zerank-2 GGUF files lack the score head and do nothing as rerankers. The heavy maintenance lane (`CLAWMEM_HEAVY_LANE`) is meant for the `clawmem watch` service, and the MCP server warns that it may never run there.

Who it suits

Suits a developer who wants memory for Claude Code, OpenClaw or Hermes that stays on their own machine, works over their own markdown, and needs no API key. It is most useful with the hooks installed as well as the MCP server; with any other MCP client you get the 33 tools but no automatic capture or context injection. It asks more setup than a plain notes server: Bun, an indexed vault, local models and ideally a GPU. Pick something else if you are on native Windows, want a hosted memory shared across machines without running services, or need a store that agents only read: several tools write to the vault.

Tools 33

23 only read, 9 change things, 1 can delete or overwrite. A ? marks an optional parameter.

__IMPORTANT
Guide telling the agent which search tool fits which question
memory_retrieve
Classifies a query and sends it to the best-suited searchquery: stringmode?: enumlimit?: numbercompact?: booleanincludeInternal?: booleanvault?: string
search
Keyword (BM25) search of the vaultquery: stringlimit?: numberminScore?: numbercollection?: stringcompact?: booleanincludeInternal?: booleanvault?: string
vsearch
Vector search for loosely worded or conceptual queriesquery: stringlimit?: numberminScore?: numbercollection?: stringcompact?: booleanincludeInternal?: booleanvault?: string
query
Combined keyword and vector search with rerankingquery: stringlimit?: numberminScore?: numbercollection?: stringcompact?: booleandiverse?: booleanintent?: stringcandidateLimit?: numberincludeInternal?: booleanvault?: string
memory_forget deletes
Deactivates the closest matching memory at once unless confirm is falsequery: stringconfirm?: booleanvault?: string
profile
Returns the stored user profile, rebuilding it on requestrebuild?: boolean
get
Fetches one document by path or idfile: stringfromLine?: numbermaxLines?: numberlineNumbers?: booleanvault?: string
multi_get
Fetches several documents by glob or list of pathspattern: stringmaxLines?: numbermaxBytes?: numberlineNumbers?: booleanvault?: string
status
Reports index health and content typesvault?: string
find_similar
Finds documents near a given one in vector spacefile: stringlimit?: numberincludeInternal?: booleanvault?: string
reindex changes
Starts a re-scan of the vault's collectionsvault?: string
index_stats
Detailed index statistics: types, staleness, access counts, sessionsvault?: string
memory_stats
Per-collection lifecycle and ranking statisticscollection?: stringvault?: string
memory_rank
Explains how each result's ranking score was made upquery: stringlimit?: numbercollection?: stringweightProfile?: enumincludeInternal?: booleanvault?: string
session_log
Returns history of past sessionslimit?: numbervault?: string
beads_sync changes
Imports issues from a Beads tracker into the vault through the bd CLIproject_path?: string
build_graphs changes
Builds temporal and semantic graphs over the documentsgraph_types?: arraysemantic_threshold?: numbervault?: string
intent_search
Answers why/when/who questions by walking causal and semantic linksquery: stringlimit?: numberforce_intent?: enumenable_graph_traversal?: booleanvault?: string
query_plan
Splits a multi-part question into separate typed searchesquery: stringlimit?: numbercompact?: booleanincludeInternal?: booleanvault?: string
find_causal_links
Follows chains of decisions and their causesdocid: stringdirection?: enumdepth?: numbervault?: string
kg_query
Looks up subject-predicate-object facts about an entity, with time rangesentity: stringas_of?: stringdirection?: enumvault?: string
memory_evolution_status
Shows how a document's derived metadata changed over timedocid: stringlimit?: numbervault?: string
timeline
Lists documents created or changed before and after a given onedocid: stringbefore?: numberafter?: numbersame_collection?: booleanvault?: string
memory_pin changes
Pins a memory so it is kept and ranked higher, or unpins itquery: stringunpin?: booleanvault?: string
memory_snooze changes
Hides a memory from surfaced context until a datequery: stringuntil?: stringvault?: string
lifecycle_status
Counts active, archived, forgotten, pinned and snoozed documentsvault?: string
lifecycle_sweep changes
Archives stale documents by policy; previews by defaultdry_run?: booleanvault?: string
lifecycle_restore changes
Restores documents archived by lifecycle policiesquery?: stringcollection?: stringall?: booleanvault?: string
list_vaults
Lists configured named vaults and their paths
vault_sync changes
Indexes markdown from a directory into a named vaultvault: stringcontent_root: stringpattern?: stringcollection_name?: string
diary_write changes
Adds an entry to the agent diaryentry: stringtopic?: stringagent?: stringvault?: string
diary_read
Reads recent diary entries, optionally for one agentlast_n?: numberagent?: stringvault?: string

Resources 1

clawmem://{+path}
One indexed document as markdown with line numbers, addressed by collection and path

Similar servers