From GenAI Pilots to Production
Nikita Kozodoi
Applied Scientist at AWS
A practical workflow for RAG eval: user tasks, gold examples, retrieval checks, answer checks, citations, review, traces, and feedback.
When you run a RAG evaluation workflow, separate retrieval from generation:
Start with user tasks and gold examples, then test retrieval and answers. Review failures, add traces, and feed production behavior back into the next eval set.[1][2]
Representative gold tests should be small enough to run often, but broad enough to reveal common failure modes. Failure analysis and traces show whether a bad answer came from retrieval, prompting, formatting, or another part of the system.[1]
RAG evaluation work covers measurement and quality judgment across eval tasks and labels, plus traces, review, and feedback. Retrieval-Augmented Generation covers the concept boundary, RAG Portfolio Projects covers project-type choice, and the Search and RAG Project Checklist covers implementation review fields. The LLM and RAG Production Roadmap covers the wider learning and rollout sequence.
Search evaluation starts before answer scoring because chunking and embeddings affect the evidence the model sees. Prompt context, citations, offline tests, and human review determine whether the final answer can be trusted. That makes RAG evaluation a context engineering workflow, not only an answer-scoring workflow.[2][2] RAG evaluation therefore connects Retrieval-Augmented Generation with Production Search Evaluation instead of reducing the work to answer scoring.
Write the eval set around real user tasks, not around generic questions. A support assistant might need to answer from current product documentation. An internal knowledge assistant might need to find the policy, cite it, and refuse when the policy doesn't exist. A research assistant might need to compare multiple retrieved sources before summarizing.
RAG evaluation belongs in the product system, not in a standalone demo. The same AI engineering skill stack includes full-stack product work, knowledge management, and the discipline needed to ship AI products.[3]
In a LLM system design interview, start from that same task record. Name the user, source collection, answer format, and refusal behavior before choosing the architecture.
For each task, record:
When the evaluation backs a portfolio project or project README, link the task records from the Search and RAG Project Checklist. Don't duplicate the project checklist here.
Gold examples should be representative, cheap to run, and easy to review. Eval size is a coverage and cost tradeoff. A tiny set lets the team move quickly, but it can overfit to a few hand-picked cases. A huge set may become so expensive that nobody runs it during prompt, retriever, or chunking changes.[1]
Create examples that include:
Changing knowledge makes retrieval a better fit than continuous retraining. Gold-standard examples and human evaluation still belong in the quality loop.[4] Link to RAG vs Fine-Tuning when the failure might belong to retrieval, model behavior, or both.
The same production tradeoff appears in an older LLM deployment discussion: re-index a changing knowledge base instead of retraining model weights for every documentation edit, and reserve fine-tuning mainly for style or behavior rather than frequently changing facts. For generation, a small gold set plus human review remains a practical quality anchor because there is no single automatic score that captures every acceptable answer. These are evaluation and update policies, not a reason to skip retrieval or automated regression checks.[4][4][4]
Evaluate retrieval before answer quality. If the right document or chunk isn't in the candidate set, the model can't reliably answer from it. If the right evidence is present but buried or poorly formatted, the fix may belong in ranking or filtering. It may also belong in chunking, metadata, or context packaging. For large-document tasks, add long-context LLM evaluation before treating retrieval as the only possible fix.[5]
Evaluate the full RAG path.[2]
Human review belongs in the loop because retrieval metrics can miss whether a passage actually answers the user's task or supports the final claim.
The search-side evaluation is layered. Start with embedding and chunking choices, then test retrieval strategy, answer quality, and citations together. That makes a failed answer actionable because the team can decide whether to change corpus preparation, retrieval, prompting, or review policy.[2]
Treat ingestion and query handling as two coupled, versioned paths. Document changes may require re-embedding and re-indexing; a new embedding model can change the vector space; and the query path has different latency constraints from the batch ingestion path. Keep the corpus snapshot, chunking and overlap rules, embedding model, index, and retrieval configuration in the run record so that a score change can be traced to one decision.[6]
Use this retrieval-first comparison sequence:
The output of this stage is a reproducible retrieval comparison: corpus and index versions, expected evidence, retrieval metrics, latency/cost observations, and the decision about what to test next. This keeps Production Search Evaluation connected to the generation checks below.
For each gold example, record:
This is the measurement view of retrieval in Retrieval-Augmented Generation, Search, and Information Retrieval. It also gives the team concrete context engineering inputs to look at before rewriting the prompt. Link to Vector Database vs Search Engine when the evaluation shows a storage or search-stack decision.
After retrieval passes, evaluate the generated answer. The answer should be correct, grounded in retrieved evidence, useful for the task, and honest about uncertainty. It should include citations when the product depends on source trust.
RAG references support explainability and user trust, while generator-evaluator patterns add repeatable checks for output quality. Simple assertions can handle structured outputs, required fields, and required citations. More subjective answers may need human review or an LLM judge. Teams still need to compare that judge with human labels.
When those answer labels become reusable gold examples, teams need guidebooks and agreement checks. They also need the model-assisted review rules described in Annotation Quality Workflows.[2][1]
An automatic judge can speed up batch comparisons, but it is not a sufficient release gate for open-ended generation. Keep a human-checked subset and compare the judge's decisions with those labels; for generative tasks, there are many valid answers and no simple universal score.[4][2]
Score answers on separate dimensions:
Keep formatting failures separate from factual failures, and categorize errors before deciding what to fix.[1] That boundary keeps LLM Evaluation Workflows from becoming one undifferentiated score.
Nikita Kozodoi describes a concrete production loop for multilingual generation: define a score sheet for spelling, accuracy, and natural language; have subject-matter experts create the golden evaluation; use an independent LLM judge for fast batch iterations; and return to human experts for major releases and edge cases. Few-shot examples can move the judge toward human decisions, but perfect agreement is not a realistic acceptance criterion.[7][7][7]
Use human review to discover the failure taxonomy and label the failure source. When reviewers produce labels that will train an LLM judge or define a gold set, connect the review work to Annotation Quality Workflows. The same boundary applies when reviewers decide whether answer evidence is trustworthy.
The problem may be missing documents, poor chunking, or weak ranking. It may also be bad prompt context or model behavior. Stale data, missing citations, and product policy can each get separate labels.
Custom datasets and system benchmarks belong in the same evaluation workflow. When retrieval is part of an agentic workflow, add mocked tools, integration tests, and regression tests. The production version of that workflow also needs Agent Ops practices for tool-call traces, permissions, and feedback. Outcome assertions matter more than exact path matching because multiple traces can still produce the same correct result.[8]
For a plain RAG assistant, a correct answer can come from different retrieved chunks. A bad answer can look fluent while hiding a retrieval miss. Reviewers should look at both the answer and the evidence the model saw.
Store review labels as structured fields:
Link to Agent Engineering only when the workflow needs planning, tools, or action. Some products only need RAG. Others need an agentic system that uses retrieval as one tool among several.[8]
Every eval run should leave enough trace data to reproduce the failure.
Log:
Logs and traces make debugging possible because a bad answer can come from source preparation, retrieval, or context packaging. It can also come from prompt wording, model choice, or output policy.[1]
Provider drift can change behavior, while latency, cost, and serving choices also become production constraints. Use versioned traces to compare runs when the model, index, embedding model, or prompt changes.[4] That comparison sits inside the broader LLM tools stack when the team changes model access, retrieval infrastructure, prompts, or observability together.
These logs connect RAG evaluation to Model Monitoring, MLOps, and Production Search Evaluation. Link to LLM Production Patterns when traces become a monitoring and operations design question.
Offline gold tests decay as production users ask new questions, documents change, and retrieval failures appear in segments the original eval set didn't cover. Add production feedback to the workflow without letting raw user traffic become an unreviewed benchmark.
Useful feedback sources include:
Offline tests and human-in-the-loop review belong together. Reviewers turn production observations into failure categories and traces for the next eval run.[2][1]
For product search and RAG systems, connect feedback to the task outcome, not only to answer style. Production Search Evaluation covers relevance, freshness, latency, and business metrics. It also covers A/B tests and monitoring. The same discipline applies when the search result is fed to a model instead of shown directly to a user.
Use this sequence for a RAG evaluation run:
If the workflow needs structured relationships instead of similar text, compare Graph RAG vs Vector RAG and Knowledge Graph vs Vector Search. Pair this workflow with RAG Portfolio Projects when the project is still being scoped. Once implementation is ready, use the Search and RAG Project Checklist. For the broader production sequence, use the LLM and RAG Production Roadmap.
S24 · Episode 4
Nikita Kozodoi
Applied Scientist at AWS
S23 · Episode 1
Paul Iusztin
Senior ML and MLOps engineer
S22 · Episode 4
Hugo Bowne-Anderson
Head of Developer Relations at Outerbounds
S22 · Episode 1
Ranjitha Kulkarni
Staff Machine Learning Engineer at NeuBird.ai
S20 · Episode 7
Lavanya Gupta
Senior AI/ML Applied Scientist at JPMorgan Chase
S17 · Episode 9
Daniel Svonava
Co-founder of Superlinked
S17 · Episode 2
S15 · Episode 3
How it started, who's here, and everything that goes on here: courses, events, Slack, and more.