Pranav Srivastava

10 lessons

0/10 done
Lesson 10 of 10·13 min·Advanced

Operating It: Cost, Observability & the Frontier

What you will learn
  • Trace requests so any bad answer can be replayed and debugged
  • Control cost and latency with caching and right-sized models
  • Close the feedback loop from real failures back into your eval set
  • Know where RAG is heading: agentic RAG and GraphRAG

A live RAG system is a system to operate, not just ship.

Observability — replay any answer

Trace every request end to end: the query, what was retrieved (with scores), the exact prompt assembled, the answer, and the cost/latency of each stage. When someone reports a bad answer, you must be able to replay exactly what happened — otherwise you're debugging blind. Log to a tool like Langfuse.

Cost & latency

Retrieval, re-ranking, and generation each add time and money. Two levers:

  • Cache aggressively — embeddings for repeated queries, and full answers for common ones.
  • Right-size the model per stage — a small, cheap model for query rewriting; your best model only for the final answer.

Close the loop

Capture thumbs, corrections, and "that's wrong" signals, and feed the failures back into the golden set from Module 8. Your evaluation suite should grow every week — that's how the system gets better instead of drifting.

You've got the whole picture

Two pipelines and a loop; the quality levers at each stage; and the edge cases that decide whether people trust the thing. Build it in this order — ingestion, retrieval, grounding, evaluation, then the hard cases — and measure every step.

Chapter summary
  • Trace every request so any bad answer can be replayed and debugged
  • Control cost and latency with caching and right-sized models per stage
  • Turn real failures into golden-set cases every week — the loop is how it improves
  • Agentic RAG and GraphRAG are the next steps, built on these foundations
Check your understanding
  1. Name two things you must log for every request so a bad answer can be debugged later.
  2. How does agentic RAG change the pipeline compared to the fixed one in this course?

Where to go next: do the minimal RAG lab for the hands-on starting point, the guardrails lab for the safety layer, and the AI Ops course for running AI systems reliably at scale.

Finished this lesson?

Mark it done — your progress is saved automatically.