Partha Chakraborty

02 AI retrieval · Case study

Making code search answerable—and inspectable.

A useful code assistant should do more than produce a plausible explanation. It should help a developer find the code that supports the explanation.

01

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.

02

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.

03

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.

04

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.

05

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.

← Back to the engineering journal