您如何衡量您的 Dify 聊天机器人中多轮对话的质量?

大家好,

我一直在用 Dify 构建聊天机器人,遇到了一些只在多轮对话中出现(而不是在单轮问答中)的质量问题。

问题

单轮测试很简单:提问,检查答案。但一旦用户进行多轮对话,就会出现不同类型的故障:

  • RAG检索漂移:随着对话变长,检索查询会混杂多个主题。知识库开始返回相关性较低的片段,机器人会自信地用错误文档中的信息进行回答。

  • 指令稀释:在8-10+轮对话后,机器人会逐渐偏离其系统提示词的约束——语气转变,开始回答本应拒绝的超出范围的问题,或者停止遵循格式规则。

  • 静默回归:更新工作流(系统提示词更改、RAG参数调整、模型替换)后,之前运行良好的对话模式会中断——但在日志中却没有错误。

这些问题很难捕捉,因为日志中没有显示“错误答案”的任何内容。大语言模型 (LLM) 调用成功,响应看起来很流畅,但信息不正确或行为已偏离您的预期。

我研究过的内容

Dify 集成了多种可观测性/评估工具:

工具 提供内容
LangSmith 数据集 + 评估器,LLM作为裁判,人工反馈
Langfuse 数据集,LLM作为裁判,人工反馈,自定义分数
Opik LLM作为裁判,8个对话特定指标,数据集评估
Arize AX LLM作为裁判,会话评估,人工标注
Phoenix LLM作为裁判,评估器中心

这些工具对于追踪和单轮评估非常有用。但据我所知,它们都无法让您设计一个多轮对话场景(例如,“问X,然后根据回答问Y或Z”)并对其进行端到端的 Dify 聊天机器人测试。

我搜索了这个论坛和 GitHub 讨论区,惊讶地发现几乎没有关于系统性聊天机器人质量评估的讨论——尽管有211个 GitHub 问题提到了更新后的回归,524个问题关于可观测性。

我向社区提出的问题

  1. 在发布更改之前,您如何测试 Dify 聊天机器人的质量? 使用上述工具?在预览中进行手动测试?自定义脚本?还是其他方法?

  2. 更新工作流或 RAG 配置后,您是否经历过静默回归?您是如何捕捉到它们的?

  3. 有人在进行多轮评估吗——测试整个对话流程而不是单个问答对?

我很乐意听听对您有效(或无效)的方法。

This is a interesting feedback. :slight_smile:

Yeah, this is a real problem, especially the retrieval drift and instruction dilution you mentioned. We ran into similar issues where everything looked fine turn-by-turn, but the overall conversation would go off the rails after a few steps.
Most traditional eval tools are still focused on single-turn Q&A, but I think newer agent eval tools are shifting towards multi-turn.

One thing that’s been tricky in practice is actually making those simulations realistic and systematic enough to catch regressions reliably across different scenarios.

Tools like Arksim are starting to explore this, you can run conversations with different user goals/personas and see how the system behaves over time. It’s not perfect, but it gets closer to how these failures actually show up in practice.

Not sure if you’ve already found other alternatives but you can try out Arksim and see how it does
https://github.com/arklexai/arksim

Curious if others have found good ways to systematically test multi-turn flows?