semantic memory for mcp agents

local memory for your ai.
94.7% on longmemeval — the best out there.

swafra is leiden-chunked, graph-linked semantic memory as an MCP server — for Claude, Codex, and any MCP-compatible AI. fully local: no cloud, no gpu, no api keys. 94.7% recall on LongMemEval, the standard benchmark for long-term memory in AI assistants.

→ we'll email you the steps: pip install, attach to your client, done.
quickstart

one line to memory.

install, attach to your client, restart. the tools appear automatically and your agent starts remembering.

terminal
$ pip install swafra  # python >= 3.10, deps install automatically
$ claude mcp add swafra swafra  # attach to claude code
$ claude skills add https://github.com/kunal12203/swafra  # or install as a claude skill
claude desktop — claude_desktop_config.json
{
  "mcpServers": {
    "swafra": { "command": "swafra" }
  }
}
vs code (copilot / codex) — .vscode/mcp.json
{
  "servers": {
    "swafra": { "command": "swafra" }
  }
}
→ restart your client — the tools appear automatically: add_knowledge, search_knowledge, graph_walk, get_context, list_sources, delete_source. with the skill installed, just type /swafra store <text> or /swafra what do you know about x?
[ 02 ] how it works

chunks that follow the topic, not the token count.

pip install swafra, attach it to Claude Desktop, Claude Code, or VS Code, and the tools appear automatically.

01

leiden chunking

text is split into sentences, a hybrid graph is built, and the leiden algorithm finds topically coherent communities — each one becomes a chunk.

02

local embeddings

fastembed (onnx, no cloud) with bge-small-en-v1.5. nothing you store ever leaves your machine.

03

knowledge graph

chunks connect with sequential, similarity, and community edges. graph-walk retrieval traverses them for broader context.

04

plain storage

json files on disk. no database required. six tools — add_knowledge to get_context — cover the whole loop.