AIToday

Graft — a local-first semantic memory system for AI agents that stores and retrieves learned context across sessions without cloud services.

Hacker NewsMay 12, 20262 min read
Graft — a local-first semantic memory system for AI agents that stores and retrieves learned context across sessions without cloud services.

Summaries like this, in your inbox every morning.

Sign up free →

3 Key Points

  1. Graft is a single-binary, SQLite-based memory layer for AI agents and microservices. It runs locally with no SaaS, no API key, and no Python runtime required; models (BGE-M3 via llama.cpp) run on CPU by default, with optional CUDA or ROCm GPU acceleration.

  2. The system uses hybrid search (dense semantic embedding via BGE-M3 cosine similarity plus lexical BM25) fused by Reciprocal Rank Fusion, returning STRONG / WEAK / MISS verdicts in milliseconds. Results are gated by a verify step to prevent confident false matches; graph walks follow keyword and semantic edges using beam search and MMR diversity.

  3. In a three-layer microservice stack, graft serves as L2 semantic cache (~30–80 ms latency) between L1 Redis exact-match caching (~1 ms) and L3 LLM + agentic retrieval (~500 ms+). Every L3 answer is written back via POST /v1/insert, so repeat queries hit the faster cached layer.

  4. Integrations include Claude Code (skills + hooks), Codex (AGENTS.md + hooks), Claude Desktop and ChatGPT (MCP), and Gemini CLI. The C11 codebase (~10 K LOC project code) builds in under 3 minutes; multi-tenant profiles (work, personal, project-scoped) are isolated as separate SQLite databases and daemons.

Discussion

No comments yet. Be the first to share your thoughts!

Log in to join the discussion

Related Articles

Stay ahead with AI news

Get curated AI news from 200+ sources delivered daily to your inbox. Free to use.

Get Started Free

Free · takes 30 seconds · unsubscribe anytime

1 minute a day. The AI essentials.

200+ sources · Email / LINE / Slack

Get it free →