Graphify: AST-Based Knowledge Graphs for Agent Code Navigation
Agents need to navigate codebases, SQL schemas, and documentation to answer questions like "which functions call this API endpoint?" or "what tables does this migration touch?" Vector embeddings give you semantic proximity. AST-based knowledge graphs give you structural certainty. Graphify parses code into a queryable graph using tree-sitter, stores relationships as explicit edges, and partitions…
Graphify is an open-source project with 132K stars that provides AST-based knowledge graphs for agent code navigation. Unlike vector embeddings, which lose contextual relationships like call graphs and type hierarchies, Graphify's AST graphs preserve structural certainty through deterministic edges. The system parses code into concrete syntax trees using Tree-sitter, extracts entities and relationships, and partitions large codebases using community detection algorithms.
This results in a queryable graph where nodes represent code entities and edges represent relationships.
Graphify's architecture includes parsing source files into ASTs, extracting entities and relationships, partitioning the graph into subgraphs for large codebases, and providing query tools for agents to retrieve context. The system does not rely on vector stores or cloud dependencies, and every edge is explicit and explainable. Graphify exposes an MCP server that allows agents to run queries like `graphify.query(pattern)` to find relationships and `graphify.community(entity)` to retrieve the subgraph containing an entity.
The approach addresses failures in AST parsing, such as dynamic languages, metaprogramming, and incomplete parses, by marking nodes as uncertain or using manual annotations. Graphify balances structural queries (e.g., "what calls this function?") with semantic search capabilities (e.g., finding similar code), making it suitable for agent code navigation tasks.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.