{"slug": "we-achieved-94-7-in-longmemeval-with-no-hacks-lol-everything-open-sourced", "title": "We achieved 94.7% in Longmemeval with no hacks lol, everything open sourced", "summary": "Swafra, an open-source semantic memory system for AI assistants, achieved 94.7% recall_all@10 on the LongMemEval benchmark for long-term memory. The tool works as an MCP server with Claude Desktop, Claude Code, and VS Code Copilot, using local embeddings and hybrid retrieval without requiring a database or cloud service.", "body_md": "Semantic memory for AI — ingest anything, retrieve what matters.\n\n**94.7% recall_all@10 on LongMemEval** — the standard benchmark for long-term memory in AI assistants.\n\nWorks as an MCP server with Claude Desktop, Claude Code, VS Code Copilot, and any MCP-compatible AI.\n\n```\npip install swafra\n```\n\nOr with Node.js:\n\n```\nnpm install -g swafra\n```\n\nAdd to `~/Library/Application Support/Claude/claude_desktop_config.json`\n\n:\n\n```\n{\n  \"mcpServers\": {\n    \"swafra\": {\n      \"command\": \"swafra\"\n    }\n  }\n}\n```\n\nRestart Claude Desktop — the tools appear automatically.\n\n```\nclaude mcp add swafra swafra\n```\n\nAdd to `.vscode/mcp.json`\n\nin your project:\n\n```\n{\n  \"servers\": {\n    \"swafra\": {\n      \"command\": \"swafra\"\n    }\n  }\n}\n```\n\nOnce connected, Claude can use swafra to remember and retrieve anything:\n\n```\n\"Remember this meeting transcript: ...\"\n\"What did we decide about the API design?\"\n\"What are my editor preferences?\"\n\"Forget everything from the project X sessions\"\n```\n\n| Tool | What it does |\n|---|---|\n`add_knowledge` |\nStore text — chunked, embedded, and graph-linked |\n`search_knowledge` |\nFind relevant chunks by natural language query |\n`get_context` |\nSearch + graph walk combined (recommended) |\n`graph_walk` |\nExplore connected chunks from a starting point |\n`list_sources` |\nSee everything stored |\n`delete_source` |\nRemove a source and all its data |\n\n**1. Chunking**\nText is split into semantically coherent chunks using Leiden community detection — a graph algorithm that groups sentences by topic. Falls back to conversation-aware chunking if Leiden deps aren't available (Python 3.13+).\n\n**2. Local embeddings**\nUses [fastembed](https://github.com/qdrant/fastembed) (ONNX, CPU-only, no API key) with `BAAI/bge-small-en-v1.5`\n\n. Falls back to deterministic hash vectors if fastembed isn't installed.\n\n**3. Hybrid retrieval**\n4-signal fused scoring: BM25 + vector cosine + entity/date overlap + character n-gram. Returns the best chunk per source so you get diverse, non-redundant context.\n\n**4. Knowledge graph**\nChunks are connected with sequential (next/prev), similarity, and entity co-occurrence edges. Graph walk expands retrieval beyond what search alone finds.\n\n**5. Storage**\nJSON files in `~/.scimap/`\n\n. No database, no server, no cloud.\n\n94.7% recall_all@10 on LongMemEval-S — 500 questions across 6 categories, 53 sessions each.\n\n| Category | recall_all@10 |\n|---|---|\n| knowledge-update | 100.0% |\n| single-session-user | 100.0% |\n| single-session-preference | 100.0% |\n| single-session-assistant | 100.0% |\n| temporal-reasoning | 99.2% |\n| multi-session | 93.3% |\n\n[Full benchmark details and reproduction steps →](/kunal12203/swafra/blob/master/BENCHMARK.md)\n\n| Variable | Default | Description |\n|---|---|---|\n`SCIMAP_DATA_DIR` |\n`~/.scimap` |\nWhere knowledge is stored |\n`SCIMAP_EMBED_MODEL` |\n`BAAI/bge-small-en-v1.5` |\nEmbedding model |", "url": "https://wpnews.pro/news/we-achieved-94-7-in-longmemeval-with-no-hacks-lol-everything-open-sourced", "canonical_source": "https://github.com/kunal12203/swafra", "published_at": "2026-07-26 11:28:31+00:00", "updated_at": "2026-07-26 11:52:51.752560+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-tools", "ai-research", "large-language-models", "ai-infrastructure"], "entities": ["Swafra", "Claude Desktop", "Claude Code", "VS Code Copilot", "LongMemEval", "BAAI/bge-small-en-v1.5", "fastembed", "Leiden community detection"], "alternates": {"html": "https://wpnews.pro/news/we-achieved-94-7-in-longmemeval-with-no-hacks-lol-everything-open-sourced", "markdown": "https://wpnews.pro/news/we-achieved-94-7-in-longmemeval-with-no-hacks-lol-everything-open-sourced.md", "text": "https://wpnews.pro/news/we-achieved-94-7-in-longmemeval-with-no-hacks-lol-everything-open-sourced.txt", "jsonld": "https://wpnews.pro/news/we-achieved-94-7-in-longmemeval-with-no-hacks-lol-everything-open-sourced.jsonld"}}