MCPFast / Tools / Deterministic code graph for AI coding agents
A deterministic code knowledge graph using Tree-sitter and SQLite/FTS5, providing stable representation for AI coding agents.
View on GitHub→This tool provides a foundational component for AI coding agents by generating a deterministic code knowledge graph. Leveraging Tree-sitter for robust code parsing and SQLite with FTS5 for efficient querying, it creates a stable, structured representation of code. This enables AI agents to understand, navigate, and manipulate codebases with greater accuracy and predictability, crucial for complex development tasks.
The deterministic code graph tool parses source code files using Tree-sitter, a powerful parser generator. It then builds a knowledge graph representing the code's structure, including abstract syntax trees (ASTs), relationships between code elements (functions, variables, classes, etc.), and their dependencies. This graph is stored in an SQLite database, optimized for fast full-text search (FTS5) capabilities, allowing AI agents to quickly retrieve relevant code segments and contextual information. The deterministic nature ensures that for the same input code, the generated graph will always be identical, eliminating variability that can hinder AI agent performance.
This tool is specifically designed for AI developers and researchers building AI coding agents. It is ideal for those who require a stable and queryable representation of code to power functionalities such as code generation, code completion, bug detection, code refactoring, and automated code analysis. If your AI agent needs to deeply understand and interact with codebases, this deterministic code graph provides the necessary structured knowledge.