Building DeepEval Assertion Gates for RAG Evaluation
A Juejin AI tutorial documents a DeepEval-based RAG evaluation workflow using a self-developed Agent platform, a 16-document knowledge base and three sampled questions. It separates sample collection from scoring, uses deepseek-chat as the judge, and shows how non-zero exit codes can block CI pipelines. On the reported sample, answer relevancy averaged 0.83 and faithfulness 1.00, while contextual relevancy averaged 0.28 against a custom 0.7 threshold.
The tutorial provides reusable commands and a practical division of responsibilities among DeepEval, RAGAS, Langfuse and hit@3, showing how assertion-based quality gates can complement aggregate RAG metrics.
摘要:跑完 RAGAS 四维还不够?RAG 评测除了看均值,还需要一套可卡点的断言门禁。本文基于自研 Agent 平台,用同一套知识库、同一份样本,完整走通 DeepEval 评测:从环境安装、样本采集、指标打分到结果解读,讲清 DeepEval、RAGAS、Langfuse、hit@3 各自分工,以及 CI 门禁怎么落地。
很多人跑完 RAGAS 四维评测之后,都会有同一个疑问:能不能搞一套断言式门禁?指标不达标直接在 CI 里失败阻断流水线?毒性、偏见、幻觉这类安全项能不能单独卡点校验?
今天就用我本地自研的 Agent 平台,沿用和 RAGAS 评测完全一致的两段式思路,完整实操 DeepEval。
先说最重要的前提:本次被测知识库一共 16 条语料,评测样本复用之前的 rag_samples_20261125.jsonl;DeepEval 本身不会去检索知识库、不会生成回答,它只负责读取我们导出的 JSONL 样本做打分判断。
本次真实落地实验信息:
- 被测平台:自研 Agent Platform
- 评测样本:3 条知识库问答(产品价格、API 接入、支持模型)
- 裁判模型:deepseek-chat(OpenAI 兼容接口,和 RAGAS 使用同一裁判体系)
- 本次结果:回答相关性均值 0.83 ✅、忠实度均值 1.00 ✅、上下文相关性均值 0.28 ❌