Start with repository structure
I built repository ingestion around source files and metadata such as language and path. Rather than passing an entire repository to a model, I split code into searchable units so the system can retrieve relevant context for each question.
Why hybrid retrieval matters
Embeddings help match conceptual questions, while lexical search can match exact identifiers, filenames and APIs. Combining semantic search with BM25 and symbol-oriented retrieval reduces the chance that a precise code reference gets lost in a broad semantic match.
Rerank and ground the answer
The application uses reranking to refine retrieved results before generation. Source paths and line ranges are important parts of the user experience: they let someone verify a claim instead of trusting a confident answer without evidence.
Specialize the workflow
The project supports distinct investigation modes for architecture, code review, bug finding and documentation. Different questions require different evidence and answer structures, even when they share the same retrieval layer.
Keep evaluation modest and transparent
An initial eight-question evaluation on the itsdangerous repository produced 87.5% Hit@5 and 0.750 MRR. That is a useful sanity check, not proof of general performance. I want to expand the test set and improve index persistence and evaluation coverage.