06 · AI systems

RAG Document Search

A retrieval-augmented search tool over a set of PDFs: ask a question, get an answer grounded in the documents, with the source shown.

Problem

Large language models answer fluently whether or not they know. For questions about a specific set of documents, the answer has to come from those documents and say where it came from, or it is not usable.

Method

The full retrieval pipeline, built rather than wrapped: documents are chunked, embedded, and stored in a vector database; a question is embedded the same way, the closest chunks are retrieved, and the model is asked to answer only from those chunks and cite them. A Streamlit interface on top, deployed with a public link.

Evaluation

Corpus: eight NINDS neurology leaflets, 71 chunks. On ten test questions with known answers, the correct document surfaced as the source in 10/10 and the answer was drawn from the retrieved passage in 10/10, including a question aimed at the thinnest document in the set. Small test, but it checks the thing that matters: every answer can be traced to a passage a reader can open.

The decision it drives

Whether an answer can be trusted, because the source is one click away. The same pipeline is the foundation of the natural-language query layer in Mograh Analytics.