Bistro Innovation LabsSearch & AI consulting · Berlin
External write-up

Evaluating Retrieval Augmented Generation using RAGAS

Part two of a three-part RAG evaluation series for Superlinked: generating a synthetic evaluation dataset with RAGAS, understanding its four core metrics, and using them to tune the retrieval window of a naive RAG built on Qdrant documentation.

This write-up was first published at superlinked.com. Below is a summary and what we would add today.

Published on Superlinked (originally VectorHub) as the second of three articles on RAG evaluation, with Mór Kapronczay and Robert Turner as editors. The first article set out a framework; this one applies it with RAGAS, the open-source framework based on the paper by Es et al., and the third continues with Arize Phoenix.

What the article covers

The starting point is ground truth. Classic retrieval evaluation uses triplets of query, document id and relevance score; RAG evaluation adapts this to questions, reference context chunks and ground-truth answers, optionally tagged with question complexity. Writing hundreds by hand is tedious and the questions tend to be too easy, so the article compares question-generation approaches and settles on RAGAS, which produces a diverse baseline set from the source documents with little code.

The metrics section explains the four RAGAS measures and what each one tells you. Context recall and context precision cover retrieval: was the right evidence retrieved, and was it ranked high enough to be used. Faithfulness and answer relevancy cover generation: is the answer grounded in the retrieved context, and does it answer the question that was asked. Their mean is the ragas score, useful for tracking and dangerous if read without its components.

The worked example builds a naive RAG over Qdrant's documentation, using a pre-compiled Hugging Face dataset, chunks and embeds it into Qdrant, and runs the evaluation set through the pipeline. The experiment then changes one variable, the retrieval window, from 3 to 4 to 5 chunks, and compares the scores side by side. The lessons: retrieval parameters move recall and precision, chunk size and overlap matter, the embedding model matters, and reranking helps, at the cost of more context tokens per request. RAGAS's aspect critique is shown as an extra lens, and the notebook is in the qdrant-rag-eval repository.

What I would add today

Synthetic question generation solved the cold-start problem and still does, but I would now be explicit that a synthetic set is a starting point to be replaced with real user questions as soon as logs exist; generated questions are drawn from the documents, so they rarely include the unanswerable ones users actually send. I would also keep LLM-judged metrics honest with a recurring human audit of a sample of grades. The structure of the article, one variable at a time against a fixed evaluation set, is the part worth copying.

RAG systems

Working on rag systems?

We build and fix retrieval-augmented generation systems by treating retrieval as the product: chunking and indexing strategy, hybrid retrieval, reranking, grounded citations and abstention, all measured by an evaluation harness before anything reaches users. Tell us what you are building and we will say whether this is the kind of engagement we take on.