Pocket Concepts.
Portfolio ↗Editor
BIG IDEAS, POCKET-SIZED.
RAG, Developer Tools, GenAIBy Amir Haeri

RepoMentor: Ask Your Codebase

Understanding an unfamiliar codebase can mean jumping between files just to answer one question. RepoMentor is a local RAG assistant I built to make that easier. It combines semantic and keyword search to find relevant code, then generates an explanation with source-code citations so you can check the evidence yourself. If the retrieved code doesn’t provide enough support, it acknowledges that instead of filling in the gaps. The pipeline processed 188 repository files into 324 searchable chunks. The goal is simple: spend less time hunting through files and get a clearer starting point for understanding how the code works.

A visualization of RepoMentor
The takeawayA useful code assistant should help you find and verify an answer, including recognising when the evidence is insufficient.
RAG, Information TheoryBy Amir Haeri

RAG Doesn’t Need the Entire Suitcase!

RAG gives an LLM retrieved documents to help answer a question, but useful evidence often arrives with extra baggage. An ACL 2024 paper applies information bottleneck theory to train a filter that preserves information useful for answering while compressing the context. Think of packing a suitcase: bring what the answer needs, not the entire wardrobe! In their question-answering experiments, the filter reduced the retrieved text to about 2.5% of its original length while improving answer accuracy. That doesn’t mean everything removed was useless, or that every system can achieve the same result. The goal is enough evidence for a correct answer, with fewer distractions.

The takeawayMore context isn’t automatically better. The goal is to preserve useful evidence while reducing distractions, then check whether the answer actually improves.
Scroll to explore