Why We Built Database for Document Retrieval
Vector search is fast. It's simple to set up. And for document search, it keeps giving you the wrong answer. We ran into this repeatedly while building at Brainfish. Agents querying contracts, policy documents, technical specs — documents where structure and context matter. The queries looked reasonable. The retrieved chunks looked plausible. But the answers were wrong. Not hallucinated-wrong. Wrong-context wrong. The right words, from the wrong place in the document. That pushed us to build something different: Hierarchical Reasoning Retrieval (HRR) . The Problem With Flat Retrieval Standard RAG works like this: Split the document into chunks Embed each chunk as a vector At query time, find the top-k chunks by cosine similarity Pass them to the LLM The flaw is step 3. Similarity search finds text that sounds like your query. It doesn't find text that answers your query. A contract's termination clause isn't semantically similar to "what are the exit conditions?" — but it's the answer.
Continue reading on Dev.to
Opens in a new tab




