RAG EngineeringAdvanced18 minModule · Evaluate & operate

RAG in production: freshness, access & cost

Keep the index fresh, enforce who can see what, watch quality in the wild and control cost and latency.

See it on the map

Freshness: decide how stale an answer may be, then pick change detection to match. Content hashes, webhooks or change feeds trigger re-ingestion of only what changed. Handle deletions explicitly, since a removed document that stays in the index will keep being cited. Version your index builds so you can roll back.

Access control belongs in retrieval, not in the prompt. Store permissions as metadata and filter on the asking user's identity before results leave the store, so restricted text never reaches the model. Test it with accounts that must not see certain documents.

Operate it like any service. Set a latency budget across stages and watch p95. Cache embeddings of repeated queries and the stable parts of prompts. Monitor retrieval hit quality, refusal rate, user feedback and cost per answer, sample production traffic into your eval set, and alert on drift after content or model changes.

Key points

  • Detect changes with hashes or feeds. Handle deletions. Version index builds.
  • Enforce permissions with metadata filters at retrieval time.
  • Budget latency per stage and track p95 and cost per answer.
  • Feed sampled production queries and thumbs-down answers back into evals.

Answer these out loud

  1. 1A document is deleted at the source at 10:00. Describe how it disappears from answers and how long that takes.
  2. 2Write the test that proves a user without access to a folder can never receive text from it.

Use this from an agent

Any MCP client, including Grok, can read this lesson. See how to connect.

REST
curl https://engineeros-delta.vercel.app/api/v1/topics/rag-production-and-operations

This unlocks