GitHub

Code-Graph-RAG for Trustworthy Codebase Intelligence

Match each claim to evidence, coverage, and freshness

8 chapters81 min total
Keywords
Code-Graph-RAGcodebasegraphprovenanceTree-sitterMemgraphretrievaldata-flowCypherruntime
Overview

Code-Graph-RAG turns a polyglot repository into a shared structural graph of definitions, imports, calls, implementations, and, when enabled, resources. This series follows parsing, edge provenance, query choice, reversible editing, runtime and data-flow evidence, and security boundaries. It supports inspectable, bounded decisions—not complete runtime knowledge or automatic correctness.

Learning outcomes
  • A structural graph answers relationship questions that text search alone cannot establish.
  • Sites, resolution labels, coverage, and freshness determine how far a graph result can support a claim.
  • Semantic search and model-generated queries aid discovery, while deterministic lookups and source checks anchor structural conclusions.
  • Static calls, runtime traces, and data-flow paths describe different evidence and should not be conflated.
  • Edits are safer when staged, verified, reversible, re-ingested, and followed by impact review and tests.
Keywords
Code-Graph-RAGcodebasegraphprovenanceTree-sitterMemgraphretrievaldata-flowCypherruntime

Chapters

Preview every chapter · Unlock full text, audio, and video from chapter 4

Plans
Ch.1-3 FreeCh.4-8 Premium

FAQ

What does Code-Graph-RAG add beyond text search?

Code-Graph-RAG adds a queryable graph of code entities and relationships, letting readers inspect definitions, imports, calls, implementations, and—when enabled—resource flows instead of only matching words.

Can a Code-Graph-RAG result be treated as proof?

No. A result is evidence bounded by its relationship type, resolution method, language and capture coverage, graph freshness, and the source or tests used to verify it.

When should I use deterministic tools, model queries, or semantic search?

Use deterministic tools for known names or locations, model-generated queries for open-ended structural exploration, and semantic search when behavior is clearer than a symbol’s name. Confirm material results in the graph and source.

What does UNKNOWN mean in Code-Graph-RAG data-flow analysis?

`UNKNOWN` means no modeled data-flow path was found, but some relevant modules are outside flow coverage, so the result cannot rule out a path.

How can Code-Graph-RAG support a safer code change?

Use the graph to identify targets and impact, stage a span-preserving transaction, verify it, commit atomically, re-ingest affected files and dependents, and run appropriate tests. A clean parse or structural delta does not prove behavioral correctness.