All posts

"Evals for RAG: test retrieval and generation separately"

When a RAG system answers wrongly, teams tune the prompt for days — while the real failure sits in retrieval, and the model never saw the passage it needed. Test retrieval and generation as separate systems, and the debugging gets dramatically faster.

RAG4 min read18 September 2026by Ahmed
"Evals for RAG: test retrieval and generation separately"

The RAG system gives a wrong answer, so the team does what feels natural: they tune the generation prompt. Two days of wordsmithing later, nothing has improved — because the model never saw the passage containing the answer. The failure was in retrieval, and no prompt on earth fixes an answer whose source material didn't arrive.

Have an AI feature stuck between demo and production?

The gap — reliability, evals, cost control, the plumbing that keeps it running unattended — is exactly the work I do. If that sounds familiar, a short conversation is usually enough to point you the right way.

Book a free consultation

© 2026 Ahmed Fareed. All rights reserved.

LOADING