{"slug": "how-pure-local-sqlite-onnx-hit-89-6-on-longmemeval-s-at-1-93ms-and-0-cloud-cost", "title": "How Pure Local SQLite + ONNX Hit 89.6% on LongMemEval-S at 1.93ms and $0 Cloud Cost", "summary": "The Raw Memory project, an MIT-licensed open-source local memory layer, reported that a pure local SQLite plus CPU-only ONNX pipeline scored 89.6% (448/500) on LongMemEval-S with a gpt-4o judge while cutting prompt tokens by 92.3% and spending $0 on cloud ingestion LLM costs. The team said its SQLite FTS5 hybrid BM25 plus RRF lexical retrieval reached 96.6% Session Recall@5 at 1.93ms p50 latency with zero stale decision leakage, and that a compact 7-tool stdio MCP server lets coding agents like Claude Code, Cursor and Codex act as their own curator without built-in LLM API keys.", "body_md": "If you bounce between Claude Code, Cursor, Codex, browser tabs, your Mac clipboard, and voice memos on your Apple Watch, you already know the worst failure mode of modern AI agents: **every new session starts with total amnesia.**\n\nThe default industry answer has been cloud memory layers—upload your conversations and desktop activity to a hosted vector database, run an LLM on every write to summarize \"facts,\" and pay monthly fees for embeddings and storage.\n\nWhen we built **[Raw Memory](https://rawmemory.app)** (MIT open-source), we took the opposite architectural bet: **keep the raw files on your own disk, spend $0 on cloud ingestion LLMs, and see how far pure local SQLite + lightweight CPU-only ONNX can go on academic memory benchmarks.**\n\nThe results surprised even us.\n\n`openai/gpt-4o` Judge)\nAll retrieval indexing and search below run **100% locally on CPU** against a real SQLite `HubStore`—no GPU, no cloud vector DB, no cloud embedding API, no LLM extraction at ingestion time.\n\n| System | LongMemEval-S E2E ( `gpt-4o` Judge) | Prompt Tokens | Cloud Ingestion LLM Cost | \n|---|---|---|---|\n| Full-Context `GPT-4o` (published) | ~60.6% – 64.0% | ~124,792 | $0 | \n| Zep / Graphiti (published) | 71.2% | Reduced | Paid cloud extraction | \n| Supermemory v4 (published) | 81.6% | Reduced | Paid cloud extraction | \n| **Raw Memory v0.9 + `gemini-flash` (local CPU pack)** | **89.6% (448/500)** | **9,630 (-92.3%)** | **$0** | \n\nHighlights across official ICLR-2025 pillars:\n\n`abstention` (`_abs`): `single-session-assistant`: `knowledge-update`: `single-session-user`: `temporal-reasoning`: Even pairing the exact same local context pack with tiny `gpt-4o-mini` hits **98.4%** on `single-session-user` and **96.4%** on `single-session-assistant`—confirming the local retrieval pack is near-lossless.\n\n`gpt-4o` Judge)\n| System | 4-Category `J-Score` | All-5 Weighted | Prompt Token Reduction | \n|---|---|---|---|\n| Mem0 ( `gpt-4o-mini` ) | 66.9% | — | — | \n| Mem0g ( `gpt-4o-mini` ) | 68.4% | — | — | \n| Full-Context `GPT-4o` | 72.9% | — | 0% | \n| Zep | 75.1% | — | — | \n| **Raw Memory v0.9 (`gpt-4o-mini` / `gemini-2.5-flash`)** | **76.0% / 76.9%** | **80.6%** | **-94.7% (1,395 vs 26,537)** | \n\nAnd on pure lexical retrieval (`SQLite FTS5 Hybrid BM25 + RRF`, zero embeddings), Raw Memory hits **96.6% Session Recall@5** on LongMemEval-S at **1.93 ms p50 latency**, with **0.0% stale decision leakage** on our RFC-0003 Reflexive Meta suite.\n\nFull reports and JSON logs live in [`benchmarks/README.md`](https://github.com/rawmemory/context-instrumentality-project/blob/main/benchmarks/README.md).\n\nCloud memory pipelines fail in two predictable ways:\n\nRaw Memory uses a strict **L0 → L4 evidence-gated pipeline**:\n\n`.m4a` audio transcripts, lossless PNG clipboard captures, Defuddle-cleaned browser reads, and 11-client AI coding sessions stay untouched on disk.`entity_edges` graph + optional local `fastembed` (`bge-small-en-v1.5`) & ONNX cross-encoder reranking (` ms-marco-MiniLM-L-12-v2` / CJK `bge-reranker-v2-m3-int8`).` evidence_ids`, expands automatic `±1` Q&A exchange windows, and explicitly marks superseded decisions (`0.0%` stale leakage).\nExposing 40 MCP tools degrades tool selection and burns prompt cache tokens. Raw Memory's compact stdio MCP server exposes **7 high-signal tools**:\n\n`recall_memory` · `remember` · `expand_evidence` · `find_related` · `consolidate_memory` · `vault_read` · `vault_request`\n\nPaired with a `<=200`-line `SessionStart` hot-directory hook, your existing coding agent (Claude Code, Cursor, Codex, Windsurf, Antigravity, or Claude Desktop) acts as its own curator—meaning **zero built-in LLM API keys** inside Raw Memory.", "url": "https://wpnews.pro/news/how-pure-local-sqlite-onnx-hit-89-6-on-longmemeval-s-at-1-93ms-and-0-cloud-cost", "canonical_source": "https://dev.to/benzema216/how-pure-local-sqlite-onnx-hit-896-on-longmemeval-s-at-193ms-and-0-cloud-cost-36kb", "published_at": "2026-12-03 18:37:54+00:00", "updated_at": "2026-12-03 18:47:33.066850+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "large-language-models", "mlops"], "entities": ["Raw Memory", "SQLite", "ONNX", "LongMemEval-S", "Claude Code", "Cursor", "Mem0", "Zep"], "also_reported_by": [], "takeaway": "A local SQLite FTS5 hybrid BM25 + RRF retrieval pack hit 96.6% Session Recall@5 at 1.93ms p50 and 89.6% end-to-end on LongMemEval-S with a gpt-4o judge, while cutting prompt tokens 92.3% versus full-context GPT-4o.", "recommendation": {"advice": "Try lexical SQLite FTS5 hybrid BM25 with RRF before adding embeddings: the source measured 96.6% Session Recall@5 at 1.93ms p50 with zero stale decision leakage.", "playbook": "rag-retrieval", "playbook_url": "https://wpnews.pro/playbooks/rag-retrieval"}, "alternates": {"html": "https://wpnews.pro/news/how-pure-local-sqlite-onnx-hit-89-6-on-longmemeval-s-at-1-93ms-and-0-cloud-cost", "markdown": "https://wpnews.pro/news/how-pure-local-sqlite-onnx-hit-89-6-on-longmemeval-s-at-1-93ms-and-0-cloud-cost.md", "text": "https://wpnews.pro/news/how-pure-local-sqlite-onnx-hit-89-6-on-longmemeval-s-at-1-93ms-and-0-cloud-cost.txt", "jsonld": "https://wpnews.pro/news/how-pure-local-sqlite-onnx-hit-89-6-on-longmemeval-s-at-1-93ms-and-0-cloud-cost.jsonld"}}