Graft

Knowledge graph for Grok

Stop re-exploring the repo every session.

Graft indexes a project once, then injects only the files, symbols, and call paths Grok needs. Fewer tokens. Faster sessions. Local map, MCP tools, auto-update on save.

fewer tokens
~40%
files indexed
28
session map
314
28 files · 43 symbols

Live explore

One question. Surgical context.

Naive crawl 8,136 tokens · Graft 939

Returned files

  • src/auth/middleware.tsL2
  • src/auth/jwt.tsL10
  • src/auth/session.tsL9
  • src/auth/jwt.tsL17
  • src/auth/jwt.tsL2

middleware.ts → session.ts → jwt.ts

Snippet

  2  import { AppError } from "../lib/errors";
  3  
  4  export async function authMiddleware(c: any, next: () => Promise<void>) {
  5    const header = c.req.header("authorization") ?? "";
  6    const token = header.startsWith("Bearer ") ? header.slice(7) : "";
  7    if (!token) throw new AppError("unauthorized", 401);
  8    c.set("session", await readSession(token));
  9    await next();
 10  }

Built for Grok sessions

Index once

Tree-sitter-style parse of files, symbols, imports, and call edges. Stored as a local map — not a vector dump.

Ask the graph

graft_explore returns ranked snippets, the path between symbols, and blast radius. One call instead of a grep loop.

Stay current

Watch the tree. A save reindexes that file, marks stale neighbors, and the next session starts from the map.

MCP tools

graft_explore

Answer a structural question from the knowledge graph. Returns ranked source snippets, call paths, and blast radius. Use instead of glob/grep/read.

graft_search

Full-text symbol search across the index.

graft_impact

Inbound blast radius of changing a file or symbol.

graft_session

Compact map to inject at the start of a Grok session.

graft_status

Index stats: files, symbols, edges, last sync.