Skip to content

codebase-rag

A Python RAG system for chatting with codebases: chunking source code into a vector store, then using LLMs for semantic search and natural-language Q&A over code.

Python RAG LLM Vector Search

Why I built it

I learn new technology by building something real with it. When RAG took off, I didn’t want to read about it; I wanted to find out where it breaks. Source code is a harsher test than prose: identifiers carry meaning, context windows fragment logic, and retrieval quality is immediately visible when an answer cites the wrong function.

What it does

Indexes a codebase into a vector store, then lets you ask natural-language questions and get answers grounded in the actual source. Chunking, embedding, retrieval, and generation are all explicit steps you can inspect and tune.

What it taught me

Retrieval is the whole game; the LLM only ever sees what the pipeline hands it. That lesson pushed me toward the knowledge-graph and hybrid-retrieval experiments I now write about on this blog.