Graphite

The graph that makes your
agent finish faster

Embedded code-graph engine for AI code assistants. One Rust daemon per repo extracts dependencies via Tree-sitter, serves blast radius with source inline. Your agent acts in turn 1, not turn 15.

View on GitHub

Your agent explores when it should be acting

AI code assistants spend most of their turns reading files to understand architecture. Each file read is a tool call, each tool call is latency, each wrong file is a wasted turn.

30

Files read per task

The agent reads dozens of files to map dependencies before making a single edit. Most of those reads discover things the graph already knows.

60%

Time spent exploring

Exploration dominates execution. The agent's first edit often comes after 5+ tool calls of pure discovery. Every session re-discovers the same codebase.

0

Persistent context

Understanding dies with the session. No queryable graph, no dependency index, no blast radius. Every new conversation starts blind.

Real tasks, real repo, real numbers

Effectiveness benchmark on a production multi-language repo (Python, TypeScript, Rust; 50K+ lines). Same model, same tasks, multiple repeats. Interception hooks deliver graph context transparently.

Without Graphite

14.5
median turns per task
89.8s
median wall-clock
6.5
files read per task
7.0
calls before first edit

With Graphite

11.5
median turns per task
68.7s
median wall-clock
3.0
files read per task
5.0
calls before first edit

Pilot C2 vs A2 on issue-form tasks (hard/medium difficulty, cross-module). Hook latency median 27ms. Full methodology in benchmarks.

Extract, persist, serve

One daemon per repo keeps the graph always hot. Every agent session queries the same indexed graph through a local socket.

01

Extract

Tree-sitter parses source code into symbols, calls, imports, inheritance. Python today; Rust and TypeScript next. Deterministic IDs, edge confidence tags.

02

Persist

CozoDB (embedded Datalog) holds facts and derives confidence by rule. In-memory adjacency serves traversals in microseconds. Atomic per-file updates; reads never wait for writes.

03

Serve

CLI, MCP shim, and interception hooks deliver blast radius, source inline, covering tests. The agent gets the answer and the code in one call.

What the agent sees

Interception hooks rewrite the agent's grep into an enriched graph-aware answer. The agent gets structural context without changing its habits.

terminal
$ graphite blast rebase_onto_base

# Blast radius: 4 symbols in 3 files (depth 3, trusted edges only)
# Confidence: 3 EXTRACTED, 1 INFERRED (resolved)

EXTRACTED  rover/git_ops.py:142    rebase_onto_base()
    def rebase_onto_base(repo_path, base_branch, ...):
        """Rebase current worktree onto the given base branch."""

EXTRACTED  rover/git_ops.py:198    rebase_main_onto_current()
    calls rebase_onto_base (depth 1)

EXTRACTED  runner/engine.py:87     pre_hook()
    calls rebase_main_onto_current (depth 2)

INFERRED   runner/engine.py:245    execute_task()
    calls pre_hook (depth 3, resolved via call chain)

# Covering tests: tests/test_rover.py, tests/test_engine.py
# graph_rev: 1847  stale: false  latency: 0.4ms

The agent knows when to trust the graph

Every edge carries a confidence tier and provenance. Responses disclose when a result is a lower bound and why. Assertiveness from transparency, not from hiding uncertainty.

EXTRACTED

Parsed directly from source. Static call, explicit import, type annotation. The graph saw it in the AST.

INFERRED

Derived by rule. Duck-typed call resolved to a likely target. Marked with provenance so the agent can verify if needed.

AMBIGUOUS

Multiple possible targets. Dynamic dispatch, reflection, generated code. The graph says "I don't know which one" instead of guessing.

Hybrid engine, measured

Source code Tree-sitter CozoDB facts + Datalog rules, RocksDB derived In-memory adjacency ONE DAEMON PER REPO unix socket CLI Bash MCP shim stdio Hooks grep / edit Runner bridge

Always-hot graph

File watcher indexes eagerly. Queries hit an already-indexed graph. At most a short freshness barrier, never a rebuild.

mtime check + BLAKE3 per file

Microsecond traversals

In-memory adjacency serves blast radius in plain Rust BFS. CozoDB handles facts, rules, and search.

19-80 µs on worst real hub

Source inline

Responses return verbatim source with line numbers alongside graph context. One call = dependency context + actual code.

Zero follow-up file reads

Single binary

Tree-sitter grammars, CozoDB, daemon, clients, file watcher. One Rust executable. No runtime, no npm, no venv.

~7K lines of Rust

Different priorities, different architecture

Competing tools optimize for ease of adoption. Graphite optimizes for agent execution speed. Background watcher, source inline, consolidated queries, runner integration.

ToolLanguageStorageSpeed focusStars
GraphifyPythonNetworkXToken reduction120K+
CodeGraphTS + RustSQLite + FTS5Tool call reduction71K+
GitNexusTypeScriptKuzuDBCommunity clustering47K+
codebase-memoryCKnowledge graphSub-ms queries44K+
GraftTypeScriptJSON + markdownPre-query freshness9K+
GraphiteRustCozoDB (Datalog)Always-hot, source inline, zero exploration-

Three commands

terminal
# Build from source
$ cargo build --release

# Start the daemon (indexes your repo immediately)
$ ./target/release/graphite-cli daemon

# See what your current diff will break
$ ./target/release/graphite-cli diff-impact