MIT Open Source • Single Rust Binary + SQLite + MCP

Long-Term Memory for AI Coding Assistants.

Stop re-explaining your codebase every new chat. RustGraph is a self-hosted bitemporal knowledge graph over POST /mcp that remembers modules, decisions, bugs, and session history—what is true now, and what was true two months ago.

1 Core • 128 MB RAM Zero Server LLM Cursor & Claude Code
$ cargo run -p rustgraph -- serve --config config/default.toml --db rustgraph.sqlite
POST /mcp• group: rustgraph
JSON-RPChas_modulehas_featuredecision (active)supersededAI IDECursor/ClaudeprojectSQLiteauth-moduleblake3-authstatus: liveFTS5 + Ollamakeyword-only (ended)bug #14 (fixed)episode: session #42
VIEW: Current active graph statevalid_at: now
MCP Request -> memory_project_context200 OK • SQLite Tree
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "memory_project_context",
    "arguments": { "group_id": "rustgraph" }
  }
}
Minimum RAM
128 MB

One lightweight Rust process, 1 CPU core.

Disk Footprint
100 MB

Binary, SQLite vault & 7 rolling backups.

MCP Toolset
25 +

Native JSON-RPC tools over Streamable HTTP.

Server-Side LLMs
0 required

No API keys on server; optional local Ollama.

Zero-Friction Automation

Context That Loads & Saves Itself Automatically

RustGraph wires directly into Claude Code and Cursor using zero-dependency Python 3 hooks.

Session Start -> Context Injection
scripts/memory_context.py
# Triggered automatically on new Claude Code / Cursor session
1. Resolve workspace folder -> project group ("rustgraph")
2. Fetch memory_project_context(group_id="rustgraph")
3. Inject compact brief into system context:
   - Open bugs & active todos
   - Architectural decisions (valid_now)
   - Every module & feature status
   - Last 3 session episodes
Graph schema: project -> has_module -> module -> has_feature -> feature -> status (with dates)
Model Context Protocol

25+ Purpose-Built MCP Memory Tools

Read timelines, batch-write facts atomically, supersede outdated decisions, and clean up duplicate entities.

memory_project_contextcontext

Entry point: returns the full project tree with current facts and edge IDs, or historical state via as_of.

memory_meaning_searchcontext

PC-side semantic search blending AI-supplied related words with optional local Ollama vector similarity.

memory_searchcontext

Keyword and prefix FTS5 search with related terms (also), vector similarity, and include_ended history.

memory_get_entitycontext

Read full details and active attributes for a single entity in the knowledge graph.

memory_timelinecontext

Inspect the complete chronological history of facts and status transitions for any entity.

memory_get_episodecontext

Retrieve a saved coding session note (episode) linked to a project group.

memory_changes_sincecontext

List everything added, ended, or modified in a project since a specific date.

memory_exportcontext

Export every entity and edge ID in a project group for backup or migration.

memory_batchwrite

Execute multiple graph writes in a single atomic SQLite transaction (all or nothing).

memory_add_modulewrite

Register a new codebase module under the active project in one MCP call.

memory_add_featurewrite

Attach a feature with its current status and timestamp to a project module.

memory_add_itemwrite

Record a project todo, bug, or architectural decision in one call.

memory_upsert_entitywrite

Create or update a graph entity node with normalized naming.

memory_upsert_edgewrite

Create or update a typed relationship edge between two entities.

memory_ingestwrite

Store a structured session note as an episode in the vault.

memory_suggestwrite

Rule-based parser that proposes entities, facts, todos, bugs, and decisions from raw notes without writing.

memory_supersedetemporal

Replace an outdated fact while preserving the previous version as historical truth.

memory_invalidatetemporal

Mark a fact as ended with a timestamp without deleting its audit trail.

memory_set_statustemporal

Update a feature status while keeping full historical state transitions.

memory_close_itemtemporal

Close a todo or bug along with its resolution outcome.

memory_confirmtemporal

Re-confirm that existing facts, todos, or bugs are still true and current.

memory_cleanup_reporthygiene

Audit duplicates, look-alikes, conflicting facts, orphan nodes, and items unconfirmed for 14+ days.

memory_mergehygiene

Merge two duplicate entities into a single canonical node.

memory_undo_mergehygiene

Safely reverse a previous entity merge if needed.

memory_link_folderhygiene

Bind a local PC directory to a specific RustGraph project group ID.

memory_list_groupshygiene

List accessible project groups with node and edge counts (plus memory_move_to_group).

memory_embed_synchygiene

Sync pending local Ollama embeddings via memory_embeddings_pending and memory_embeddings_upsert.

12-Crate Rust Workspace

Engineered for Speed, Privacy & Determinism

Bitemporal Truth

Facts are ended via memory_supersede rather than deleted, enabling exact as_of historical project reconstruction.

Embedded /ui Dashboard

Served directly via rust-embed with force-directed graph visualization, neighbor focus, type filters, and 10s Live refresh.

Hybrid FTS5 + Vectors

Meaning search works out of the box via SQLite FTS5 + AI-expanded terms, with optional local Ollama (nomic-embed-text).

Blake3 Bearer Auth

Stores only the blake3 token digest in auth.token_blake3_hex. All routes except /v1/health and /ui require Bearer auth.

Graph Hygiene & Undo

Detect duplicates, contradictions, and 14-day stale todos via memory_cleanup_report, with safe memory_merge and undo.

Per-Project Groups

Isolate each repo in its own group while personal facts live in default. Full JSONL export and import built in.

Deploy in Minutes

Start Your Self-Hosted Memory Vault

Clone the repo and launch the RustGraph vault on localhost:8080 with an embedded graph UI at /ui.

git clone https://github.com/vishvajeet2012/RustGraph.git
cd RustGraph
cargo run -p rustgraph -- serve --config config/default.toml --db rustgraph.sqlite

# Open the embedded force-directed graph dashboard:
# http://127.0.0.1:8080/ui
Technical Q&A

Frequently Asked Questions

RustGraph is a self-hosted long-term memory vault for AI coding assistants like Cursor and Claude Code. It runs as one small Rust binary backed by SQLite and exposes 25+ Model Context Protocol (MCP) tools over POST /mcp so your assistant remembers modules, features, decisions, bugs, todos, and session episodes across chats.