Skip to main content
Post

Code graph vs language server: which does your agent need?

A language server and a code graph answer different questions, and Graphify says most agent setups end up using both. In a comparison post, the team sets out what each one knows and where each fits better.

What each one knows

A language server speaks the Language Server Protocol to the editor. It parses files as you type and answers go-to-definition, find references, hover types and diagnostics, usually with compiler precision for one language. Its answers reflect unsaved edits, but it is scoped to one language and an open workspace.

A code graph is a stored index of the whole repository. It records symbols and the edges between them, such as calls, imports and inheritance, across every file at a given commit. Agents can query it without opening an editor, including for repositories no one has open. Graphify builds its graph with tree-sitter, using 63 grammars in the hosted product and about 40 languages in the open-source CLI.

How they compare

  • Scope: a language server covers the open workspace in one language. A code graph covers a whole repository across many languages.
  • Freshness: a language server is live, including unsaved edits. A code graph reflects a committed build.
  • Best question: "What is this symbol?" for a language server, "What does this connect to?" for a code graph.
  • Consumer: the editor for a language server. An agent, reviewer or wiki for a code graph.

When each fits better

Graphify points to a language server for type errors, renames inside one project, completions, diagnostics on unsaved changes, and precise type resolution in heavily dynamic code. A graph built from the default branch does not see uncommitted edits, so for the current file the post says to trust the editor and read your own changes from disk.

A code graph fits questions that span the repository or cross services: impact before a change, callers in files nobody opened, unreferenced code, review context and generated docs. Because the graph is stored, an agent, a pull request review and a wiki can read the same structure.

Trying it

The post suggests connecting a repository in Graphify while keeping the language server running in the editor. To try the graph locally, run uv tool install graphifyy and then graphify update ..

On precision, Graphify says the graph is not as exact as a language server for every symbol, trading some precision for whole-repository coverage. It also says some agents can use a language server directly, but that still answers per workspace and per language.

Loading replies…
Loading replies