Building a local-first memory layer using Rust, SQLite, and Graph Structures
Mnemo is a local-first, privacy-focused memory layer for Large Language Models built on Rust, SQLite, and the petgraph library. It enables agents to retain state and context across sessions without cloud services. Implement persistent local memories in your personal agent stacks.
Why it matters
You can give your local AI agents long-term, structural memory across different tasks without exposing sensitive proprietary codebase structures to the cloud.
TL;DR
- 01Use Mnemo to construct local-first, private knowledge graphs of your development projects
- 02Integrate petgraph-powered traversal queries to retrieve contextual memory without heavy vector databases
- 03Write custom wrappers in Rust or Python to sync active workspace files into Mnemo's SQLite backend
Architecture
Mnemo operates as a local sidecar service. It ingests raw conversation text, extracts entities (people, tools, concepts) using an LLM, and persists them into a SQLite database. Atomic state updates are managed by the petgraph library.
Query Pipeline
Retrieval is optimized via a 6-stage pipeline: full-text chunk search, entity name search, graph expansion using Breadth-First Search (BFS), relation filtering, and ranking.
Deployment
Mnemo ships as a single static binary with zero cloud dependencies. It supports multiple providers including Ollama, OpenAI, and Anthropic.