Cookbook: RAG Evaluation
criteria.rag plus Knowledge Bases and sources toggles.
Cookbook 2 — RAG Evaluation
- Upload policy docs on Studio
/knowledge(PII redacted before persist). - Attach the KB to a rubric (
knowledge_base_id) or passkb_id/sources.documents=true. - Score with
criteria.ragfaithfulness / citation criteria.
result = client.evaluate(
messages=[...],
criteria=["Penalize responses that invent policy details not present in retrieved context."],
kb_id="kb_...",
sources={"documents": True, "annotations": True, "memory": False, "calibration_tau": True},
)