Noureddine RAMDI / Graphify: Local AST parsing and AI-enhanced knowledge graphs for codebases

Created Sat, 09 May 2026 11:42:26 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

safishamsi/graphify

Navigating complex codebases with traditional text search or static file browsing often feels like using a map with only street names but no landmarks. Graphify addresses this by turning any project folder into a rich, interactive knowledge graph that AI coding assistants can traverse semantically. This hybrid approach combines local syntax parsing with AI-inferred relationships to deliver context-aware insights without sacrificing code privacy.

How graphify transforms projects into semantic knowledge graphs

Graphify is a Python CLI tool designed to generate interactive knowledge graphs from project directories. Its core mechanism is using tree-sitter, a widely adopted parsing library that provides local Abstract Syntax Tree (AST) extraction for more than 25 programming languages. This local parsing ensures that your source code never leaves your machine, a crucial consideration for privacy-sensitive environments.

Beyond parsing code, Graphify supports a diverse set of assets including documentation files, PDFs, images, videos, and even URLs. These non-code assets are processed with the help of AI models to infer semantic relationships layered on top of the syntactic structure extracted from code.

The tool produces three main outputs:

  • An HTML visualization that lets you explore the knowledge graph interactively in a browser.
  • A structured JSON graph suitable for consumption by other tools or further automated processing.
  • A markdown report highlighting key concepts, unexpected connections, and suggested queries to guide exploration.

Graphify integrates with over 15 AI coding platforms such as Claude Code, Codex, Cursor, Gemini CLI, Copilot, and Aider. This integration happens via slash commands and optional hooks that can automatically inject graph context before file reads, enhancing the AI’s ability to navigate and understand the codebase semantically. Additionally, Graphify offers an MCP server mode that exposes the knowledge graph for structured tool-call access.

Local AST extraction with tree-sitter and AI relationship layering

The standout technical feature is Graphify’s use of tree-sitter for fully local, language-specific AST parsing. Supporting 25+ languages, this approach avoids sending source code to external services, addressing privacy and security concerns common in AI-powered tools.

On top of this deterministic syntax tree, Graphify layers AI-inferred semantic relationships. This hybrid model brings together the precision of static parsing with the contextual richness AI can provide, especially for non-code assets like documentation or multimedia.

The codebase is written in Python, which serves as a glue layer orchestrating tree-sitter parsing, AI calls for non-code asset processing, graph construction, and multi-platform integrations. The architecture balances the breadth of supported languages and asset types with the depth of semantic analysis.

Tradeoffs include the local parsing constraint limiting AI use on source code itself, relying on static ASTs rather than deeper dynamic analysis. However, this tradeoff is deliberate to keep code privacy intact.

Integration hooks for 15+ AI coding assistants demonstrate a strong focus on developer workflows. These hooks automatically enhance assistant context with graph data, improving AI responses without requiring manual context management.

The MCP server mode is another interesting architectural choice, providing a programmatic interface to the graph that can be queried by AI tools or other systems, enabling structured, context-aware tool interactions.

Quick start with graphify

To install Graphify, you need Python 3.10 or higher. The official package is named graphifyy on PyPI (note the double ‘y’). Here are the installation options:

uv tool install graphifyy && graphify install

# or: pipx install graphifyy && graphify install

# or: pip install graphifyy && graphify install

If you encounter a “graphify: command not found” error, it usually means the CLI is not on your PATH. Using uv tool install graphifyy or pipx install graphifyy automatically adds it to PATH. With plain pip, you may need to add the local binary directory (~/.local/bin on Linux or ~/Library/Python/3.x/bin on macOS) to your PATH, or run the CLI as python -m graphify.

Graphify supports platform-specific installs for integration with AI coding assistants. For example, to install for GitHub Copilot CLI, run:

graphify install --platform copilot

Or for VS Code Copilot Chat:

graphify vscode install

The README provides a list of supported platforms with corresponding install commands, making it straightforward to integrate Graphify with your preferred AI assistant.

Verdict

Graphify is a practical tool for developers and teams who want to enhance AI-powered code navigation without compromising code privacy. Its use of tree-sitter for local AST extraction is a solid architectural choice that avoids sending proprietary code to external services. The addition of AI-inferred relationships on top of this syntax base enriches the semantic graph, especially for documentation and multimedia assets.

The integration hooks and MCP server mode demonstrate an understanding of real developer workflows across multiple AI platforms, which makes it versatile.

Limitations include the reliance on static parsing rather than dynamic code analysis, and the complexity of managing multiple AI assistant integrations. Still, if you work in sensitive environments or want a richer AI-assisted way to explore large codebases, Graphify is worth a try.

The install commands are clear and straightforward, lowering the barrier to experimentation. Overall, this repo offers a strong foundation for semantic codebase understanding that balances privacy, semantic richness, and multi-platform support.


→ GitHub Repo: safishamsi/graphify ⭐ 43,163 · Python