Skip to main content

What It Is

The symbol graph is a per-workspace pgvector index of the codebase at function/class/interface/enum granularity. Rows live in symbol_graph_nodes. Each row carries the symbol’s kind, file, line range, neighbour symbols (who calls whom), and a semantic embedding of its signature + leading docstring.

How It Stays Fresh

A lightweight ts-morph extractor runs on every agent write via the postToolUse hook. It re-parses only the file that changed and upserts its top-level declarations. The graph is eventually consistent with the repo state within a few hundred milliseconds of an edit.

What It Powers

FeatureHow the graph helps
Symbol-level file reservationsNarrow a lock to createUser instead of the whole src/users.ts
Affected-test discoveryThe test gate traces symbol-to-test edges to decide what to run
Living decisionsDecisions auto-link to the symbols they mention; staleness is detected when those symbols change
Negotiationsnegotiate_open targets specific symbols by id or name
Knowledge graph UIThe dashboard visualization renders nodes + call edges

Reservations vs Graph

File reservations are a coordination primitive — a lock. The symbol graph is a data structure — a map. They interact via granularity='symbol' on a reservation: the lock scopes down to the symbol’s line range. The graph decides what counts as a symbol; reservations enforce the lock.

Language Support

Today: TypeScript and JavaScript (via ts-morph). The extractor is pluggable; Python and Go are next on the roadmap. For languages without an extractor yet, file-level reservations still work — you just lose symbol-level precision.