Skip to projects
← all projects

Graph-Augmented RAG Platform

CodeSage

Predicts the blast radius of a code change by combining a Neo4j knowledge graph with Qdrant vector search over AST-parsed codebases — not another chat-with-your-PDF wrapper.

View on GitHubLive deploy pending — GitHub has the full Dockerized stack and CI.
0%
impact-prediction accuracy
P@10 0.00
graph retrieval precision

The problem

Vector search alone treats a codebase as a bag of similar-looking chunks. It can find code that looks like your query; it can't tell you what breaks when you change it. Impact analysis needs structure — call graphs, imports, ownership — which embeddings throw away. CodeSage keeps both: the graph for structure, the vectors for semantics.

Architecture & approach

  1. tree-sitter parses source into ASTs across multiple languages; functions, classes, imports and call relationships become nodes and edges in a Neo4j knowledge graph, with cross-language symbol normalization.

  2. The same units are chunked, embedded, and indexed in Qdrant, so retrieval can start from semantic similarity and then walk the graph outward to find structurally connected code.

  3. Celery workers on a Redis broker handle GitHub repo ingestion, embedding generation, and heavy analysis asynchronously so large repositories don't block the query path.

  4. Propagation and risk scorers rank high-impact changes to prioritize tests and reviews; a RAG layer combines vector retrieval with OpenRouter LLM prompts to produce human-readable impact explanations and recommendations.

  5. A FastAPI backend (REST + WebSocket) serves it over PostgreSQL for projects, jobs and users, with Alembic migrations and a Next.js/TypeScript frontend; the whole stack runs on Docker Compose and is tested in CI via GitHub Actions.

  6. Evaluated directly: 87% impact-prediction accuracy and Graph Retrieval Precision@10 of 0.83.

Stack

  • Python 3.11
  • FastAPI
  • Neo4j
  • Qdrant
  • PostgreSQL
  • Celery
  • Redis
  • tree-sitter
  • OpenRouter
  • Next.js
  • Docker
  • GitHub Actions