Coding agentsRAG & knowledge

Code Graph RAG

vitali87/code-graph-rag

Monorepo code RAG via Tree-sitter for knowledge graph queries and edits.

Repository
Stars
1.7k
Forks
110
Open issues
14
Language
Python
Licence
MIT
Created
2026-06-15
Last push
2026-08-11
Effort to adopt

Engineering project

Weeks, not days. Treat it as infrastructure with an owner and a budget.

01

What it actually does

Standard RAG is terrible at code because it splits files into random chunks, destroying the context of functions and classes. Code Graph RAG fixes this by using Tree-sitter to parse your entire monorepo into an intelligent, semantic knowledge graph. When an AI agent asks 'Where is the auth logic?', it traverses the actual syntax tree of your code, understanding exactly how `AuthService` calls `validateToken`. It natively supports massive monorepos and allows agents to surgically edit the graph structure.

02

Who it's for

  • 01

    Engineering teams with monolithic codebases that confuse standard AI coding assistants

  • 02

    Platform teams building internal 'Ask the Codebase' chat bots for developer onboarding

  • 03

    AI tooling startups needing a robust backend for analyzing large-scale repository dependencies

EngineeringSaaSAgency
03

Where it earns its keep

  • Providing perfect context to an AI agent trying to refactor a deeply nested React component hierarchy
  • Creating a semantic search engine for your company's undocumented legacy Java monolith
  • Allowing agents to automatically trace and document all the downstream effects of deprecating an API endpoint
04

Use it, or skip it

Reach for it when

  • Your codebase is larger than 100k lines of code and standard RAG returns garbage
  • You need your agent to understand complex inheritance and cross-file function calls

Skip it when

  • You are working on a small, simple project where throwing the whole repo into the prompt window works perfectly fine
  • You code in an obscure proprietary language that Tree-sitter doesn't have a grammar for
05

10 automations

  1. 01Engineering

    Automated Code Review Context

    When a PR is opened, the agent queries the graph to pull in all files affected by the change, even if they weren't edited, to review for breaking side-effects.

  2. 02Engineering

    Legacy Code Documenter

    Agent systematically traverses the graph of an undocumented monolith, generating rich markdown docs that explain exactly how data flows through the system.

  3. 03Operations

    Security Vulnerability Tracer

    When a vulnerable npm package is flagged, the agent traces the graph to find every single function in your codebase that eventually calls the compromised library.

  4. 04Founders

    Onboarding Chatbot

    A Slack bot that answers new hire questions like 'Which services write to the User table?' with 100% accurate, graph-verified answers.

  5. 05Engineering

    Automated API Deprecation

    Give the agent a deprecated endpoint, and it uses the graph to find and rewrite every client-side invocation across the entire frontend repo.

  6. 06Engineering

    Dead Code Sweeper

    Run a monthly script that identifies unreferenced nodes in the syntax graph and automatically opens a PR to delete the dead code.

  7. 07Engineering

    Architecture Enforcement

    CI script that fails the build if the graph detects a UI component directly importing a database controller, bypassing the API layer.

  8. 08Engineering

    Monorepo Splitter

    Agent analyzes the graph to find logical boundaries and completely separates tightly coupled code into distinct, clean microservices.

  9. 09Engineering

    Test Coverage Generator

    Agent finds complex, highly-connected graph nodes with missing tests and writes targeted unit tests for those critical junctions.

  10. 10Engineering

    Impact Analysis Report

    Before starting a major refactor, generate a report showing exactly which teams own the code that will be impacted by the changes.

Want one of these running by Friday?

LimeDock builds these as real workflows inside your stack — deployed to your cloud, wired into your Slack and CRM, with the code in your repo. You pay a build fee and your own API keys, nothing else.

Book a workflow call
07

Source

Repository stats were read from the GitHub API and reflect the last time we refreshed this entry. The editorial breakdown above is LimeDock’s own analysis — we are not affiliated with vitali87.

https://github.com/vitali87/code-graph-rag