高风险 AI 智能体如何做评估:Langfuse 的银行助手实操,Doneyli De Jesus 与 Annabell Schäfer
原题Evals for High-Stakes AI Agents — Doneyli De Jesus & Annabell Schäfer, Langfuse
看前速览
Langfuse 工程师以银行助手演示完整评估闭环,将执行轨迹和专家反馈转化为数据集、混合评估器、CI 门禁与业务质量信号。
追踪实际行为,避免只相信成功状态
记录输入、输出和工具调用:请求状态正常,也可能漏掉退款动作。银行等敏感场景应在持久化追踪前完成 PII 脱敏。
从专家复核的案例中建立评估标准
筛选生产样本和已有测试用例,收集轻量的领域专家反馈,再将真实失败归纳为可测量的类别。
结合确定性检查与经过校准的 LLM 评估
精确匹配和稳定规则交给代码,上下文判断交给 LLM,再用人工标注样本对齐评估器与领域预期。
让提示词变化触发可量化的 CI 门禁
配置变化时运行数据集实验,逐项执行评分门槛。通过评估提供的是复核证据,并非对安全性的全面保证。
让业务指标与人工判断持续参与闭环
仪表盘帮助按失败类别、反馈和风险缩小排查范围。人负责真实基准和硬性边界,智能体负责埋点与实验自动化。
完整摘要
Annabell Schäfer 与 Doneyli De Jesus 解释了为什么基础设施指标正常,并不代表 AI 智能体完成了用户要求的操作:退款助手可能报告成功,却根本没有调用退款工具。他们将追踪、监控、代表性数据集、受控实验和评估组织成持续迭代的工程闭环。银行助手演示涵盖不同客户身份、写入追踪前的个人信息脱敏、投资建议请求识别,以及工具调用和评分检查。数据集既可来自已有 CSV 测试用例,也可来自经过筛选的生产轨迹。领域专家只需对代表性样本打简单分数、留下自由评论,再由 LLM 将实际失败归纳成评估类别。讲者建议混合使用确定性检查与 LLM 评估,并用人工标注校准评估器。提示词版本变化可以触发 GitHub CI 实验,逐项检查评分门槛,为部署决策提供证据,而非自动证明满足监管要求。仪表盘将失败模式、用户反馈和风险类别连接到运营复核。一个七天示例显示约 1,400 次交互、成本不到 7 美元,但没有提供经验证的业务效果对照。最后的建议是让人保留领域判断和硬性边界,将埋点、失败发现与实验执行交给自动化。
章节
文字稿
简要描述Brief Description
Annabell Schäfer 和 Doneyli De Jesus 通过一款银行助手,演示如何评估高风险 AI 智能体。本次研讨会将追踪与个人身份信息(PII)脱敏、专家审核的数据集、确定性评估器和 LLM 评估器、自动化质量门禁,以及面向业务相关方的仪表板结合起来。Annabell Schäfer and Doneyli De Jesus demonstrate how to evaluate high-stakes AI agents using a banking assistant. The workshop connects tracing and PII masking with expert-reviewed datasets, deterministic and LLM evaluators, automated quality gates, and dashboards for business stakeholders.
目录Table of Contents
- 为什么评估很难Why evals are hard
- AI 工程循环The AI engineering loop
- 演示:具备追踪和个人身份信息脱敏功能的银行助手Demo: a banking assistant with tracing and PII masking
- 构建数据集Building datasets
- 专家审查与失效模式Expert review and failure modes
- 选择评估者Choosing evaluators
- 每次提示词更改时自动运行评估Running evals automatically on every prompt change
- 面向利益相关者的仪表板Dashboards for stakeholders
- 与您的编程代理协作Working with your coding agent
- 问答Q&A
为什么评估很难Why evals are hard
Annabell:好,我们开始吧。欢迎大家参加我们关于如何使用 Langfuse 评估 AI 应用的研讨会。我叫 Annabelle,是 Langfuse 的 AI 工程师、AI 解决方案工程师。今天和我一同参加的还有我的同事 Donelli,他负责 Langfuse 的 AI 解决方案架构,致力于与我们最大的客户合作,确保他们真正能够将可靠的智能体部署到生产环境中。我自己在我喜欢称作“前世”的阶段——因为那感觉就像是过了一辈子——曾在一家为医疗器械合规领域构建 AI 智能体的公司工作。在这个行业里,确保我们正在运行……非常重要。Annabell: All right, let's get started. Welcome everybody to our workshop on evaluating AI applications with Langfuse. My name is Annabelle. I'm a AI engineer AI solutions engineer at Langfuse. And I'm today joined by my colleague Donelli who is leading AI solution architecture at Langfuse. So working with our biggest customers on making sure they actually shipping reliable agents to production. I myself was in my previous life how I like to call it because it feels like a lifetime in a company building AI agents for medical device compliance. And in this industry it was super important to make sure we are running.
我们确保拥有经过客户验证的真实数据集,也运行了很多人在回路系统。我有很多时间其实都花在了 Langfuse 上。后来我想,何不转换阵营,也帮助其他团队交付智能体,尤其是那些处于受监管行业的团队呢?于是大约七个月前,我加入了 Langfuse 团队。We're making sure we have ground truth data set that is validated by our customers and we also ran a lot of human in the loop systems and a lot of my time I actually spent in Langfuse and at some point I decided okay why not swap sites and also help other teams that are shipping agents especially also in regulated industries and joined the Langfuse team roughly seven months ago.
不过,在我们直接深入之前,我们想先了解一下今天有哪些人在这里,以及我们今天是和谁一起交流。所以我们想知道,你们当中有谁之前参与过将 AI 代理投入生产环境?我的意思是,你本人曾是参与这件事的团队成员,不只是公司里有人做过,而是你实际参与过将它投入生产环境的过程。好的,太棒了,很多人都有这方面的经验。我们也希望能有这样的参与者。那你们当中有谁以前用过各种编程语言?好的,不少人。还有谁在 Evas 工具中做过其他类型的可观测性工作吗?好的。是的,也有几位。太棒了。So but before we dive right into it we wanted to get a little bit of a feeling of who is here today and who we are yeah coming together with. So we were wondering who of you has brought AI agents to production before and with that I mean been part of a team doing it not necessarily yes someone in the company did it so actually like been part of a process to bring it to production okay that's good amazing it's a lot of people and we hoped to have this also and who of you has worked with languages before okay quite some and any other kind of observability in evas tool Okay. Yeah, also a few amazing.
最后,谁已经解决了 AI 应用中的 EVAs 问题?有信心的朋友,欢迎来我们的展位,给我们讲讲你们是怎么做到的。因为这确实相当难,我想如果你在做 AI,或者只是和 ChatGPT 或 Claude 聊天,都体验过这一点。And then finally, who has solved EVAs for AI applications? For the confident hands, I would love you to come by at our booth and explain us how. because actually it is quite hard and I think all of you have experienced it if you're working with AI or also just chatting with Chat GPT or Claude.
嗯,这确实相当棘手,因为 AI 智能体可能会出错,而系统指标本身看起来却一切正常。比如看这个例子:这里有一个用户支持智能体,用户问能不能退款。智能体收到请求后查阅了一些政策,然后回答:“当然可以,我已经为你办理了退款。”用户说了声谢谢。过几天,用户才会知道退款到底有没有成功,而此时状态显示为绿色。从传统可观测性的角度来看,一切都正常,也没有延迟问题。但如果我们深入调查实际发生了什么,就会发现智能体根本没有办理任何退款,也就是说,它从未调用过相关工具。H it is quite tough because AI agents can fail while the system metrics themselves look green. So if you for example look at this example here we have a user support agent and the user is asking can I get a refund. The agent takes in the request looks up some policies and then it's like yeah sure I issued your refund and the user is like thank you and it will take some days until the user sees if it actually worked out and the status is green. Nothing went wrong in traditional observability terms. There's also no latency issues. But if we dig deeper into what actually happened, the agent never did refund anything. So the tool was never called.
这件事从未执行过。而且代理还对用户撒谎,说自己已经处理了。几周后,等用户回来跟我们说:“嘿,顺便问一下,我没拿到——我一直都没收到退款。”我们才会知道这件事。It was never executed. And the agent lied about doing it to the user. And we will only know about it in a few weeks when the user come backs and is like, "Hey, by the way, I never get I've never gotten my refund."
这就是我们面临的非确定性系统的问题。它们可能会告诉我们自己做了什么,但实际上并没有做到。这就是为什么你必须找到一种方法,持续挖掘那些表明事情出了问题的信号,并确保同样的问题不再发生,或者最好从一开始就避免发生。三年前,我们的创始人在 Y Combinator 孵化营期间也遇到了这个问题。他们意识到,AI 应用没有类似单元测试的东西,而我们需要为此找到解决方案。And this is the problem that we have with those non-deterministic systems. They might tell us they do things, but they actually don't. And this is why you have to find an approach and a way to continuously mine for those signals where things are going wrong and make sure they don't happen again or maybe not even at all in the first place. And this is a problem our founders also faced three years ago when they were in the way combinator batch and they realized okay there's nothing like a unit test for AI applications and we need a solution for it.
于是他们打造了 Langfuse。如今,它已成为一个开源平台,可用于持续追踪、监控和改进你的 AI 系统。虽然我们最初主要将它作为开发者工具,但如今领域专家也成为了我们的目标用户群。我们会与 AI 工程师协作,确保系统真正做到它应该做的事。So they built Langfuse which is by now an open source platform to continuously trace monitor and improve your AI systems. And while we started out as a dev tool mostly by now we also have domain experts as a target group. So collaborating with AI engineers to make sure the system does what it actually should be doing.
但在过去大概 8 到 12 个月里,还出现了一个新的用户群体:编码智能体。它们也在帮助我们的工程师开发和改进 AI 应用。如今,全球已有超过 15 万名开发者采用 Langfuse,这在很大程度上得益于我们的开源模式。当然,《财富》50 强中有 21 家在交付 AI 应用时,将 Langfuse 纳入其核心技术栈。每个月,超过 900 亿条观测数据会被摄取到 Langfuse 实例中。随着智能体采取越来越多的步骤、接手越来越多的任务,这个数字当然还在不断增长。but also a new user group for the past probably 8 to 12 months which are coding agents that are helping our engineers also to work with AI applications and improve them. Langfuse is by now adopted by more than 150,000 developers globally also largely driven by our open source setup. Of course, 21 of the Fortune 50 have us as part of their core tech stack when shipping AI applications. And every month more than 90 billion observations are ingested into Langfuse instances. of course increasing tendency as agents are taking more and more steps and also taking over more and more tasks.
RAMP、Canva、Khan Academy 和 SUP 等公司都与我们合作。过去三年里,我们当然也花了很多时间与他们相处。与这些公司合作时,我们发现,那些成功交付可靠智能体并持续改进它们的公司,都遵循一套我们称之为“AI 工程循环”的做法。这套做法通过系统化的方法,帮助你持续改进系统。Companies like RAMP, Canva, Khan Academy and SUP work with us and over the last three years we of course spend a lot of time with them and one thing we realized working with those companies is that the ones that successfully manage to ship reliable agents and also continuously improve them follow something that we call like some form of this and the AI engineering loop and it is about a set of practices that help you to continuously improve your system by taking a systematic approach.
这背后的基础始终是追踪。追踪就是把智能体执行的所有步骤记录下来,形成一份日志,最好还能让人查看和检查。The foundation to this is always tracing. Tracing is about getting all the steps of what your agent is doing into a more or less log, but ideally also in a way you can inspect it as a human.
AI 工程循环The AI engineering loop
监控的目的是找出值得关注的案例。哪些地方出了问题?哪些地方做得不错?我们应该深入探究哪里?同时,也要了解它的平均表现如何。构建数据集,就是找出一组有代表性的示例,涵盖你希望应用能够处理的情况,以及你希望它如何处理这些情况,然后在这组示例上运行实验。Monitoring is about finding the interesting ones. So what is going wrong? What is going right? Where should we look deeper into? But also understanding how is it performing on average. Building data sets is about finding a representative set of examples that you want your application to be able to handle and also how you want it to handle it and then you want to run experiments on it.
因此,你要尝试系统的不同变体,检查它的表现和运行情况。当然,你还需要评估效果。这不是一次性的工作,而是要持续闭环,不断改进 AI 智能体,从生产环境中汲取经验,并将这些经验纳入数据集。接下来,我们来更详细地看看每个步骤。对于追踪数据,最重要的是深入了解智能体实际在做什么。So try different variations of your system to check how it is performing, how it's going and then of course you want to evaluate how it's going and this is not something you do once but you continuously close this loop and want to improve those AI agents and learn from production and get it back into data sets. but let's dive in each of those steps a little bit more into detail. So for traces, the most important goal is that you want to get deep insights into what your agent is actually doing.
在屏幕右侧,我们可以看到一条 trace,它也是 Langfuse 的截图。在这个例子中,它是一个 IT 支持智能体,也就是一个替你回答父母问题的智能体,这样你就不用亲自回答了。我们可以看到,首先是根 trace,还能看到这一步的总耗时和成本。此外,我们还可以看到该智能体各个步骤的明细,包括生成调用(也就是 OpenAI 聊天调用),以及工具调用;工具调用前面会显示一个小工具图标。On the right side of the screen, we can see a trace that is also a screenshot from Langfuse and in this case it's an IT support agent. So an agent that is answering questions from your parents so you don't have to do it. And we can see that there's first like the root trace and we can see aggregate time and also costs of this step. But we then also get a breakdown of each of the individual steps that agent is taking. So both the generations which are the OpenAI chat ones and also the tool calls which we can see with a little tool in front of it.
这样我们就能详细了解发生了什么;如果屏幕再宽一些,我们还可以看到输入、输出以及涉及的所有元数据。这为追踪成本、延迟和 token 数量奠定了基础,也提供了一份日志,供你作为人类检查并深入了解具体情况,同时也能让你的编程代理使用这份日志、从大规模角度进行查看,从而获得一份可供检查的记录,了解实际发生了什么。So we have a detailed view of what's going on and if the screen would be wider we would also see that we can see the inputs and outputs and all the metadata involved. This is then the foundation to track the cost, the latency, the tokens involved, and also have a log to inspect for you as a human to really dig into what's going on, but also for your coding agents to work with it and look at it at scale and just have this inspectable log of what's actually been going on.
因此,监控的关键在于能够大规模地理解系统运行情况。尤其是现在,自动化程度越来越高,调用轨迹越来越长,用例也越来越多,人工逐条查看日志已经不再可行。我们真正需要的是一种获取整体指标、了解实际运行状况,并检测问题信号的方法。例如成本和延迟指标,也可以是质量信号,比如合规护栏是否得到遵守,或者究竟有多少用户对我们的系统感到不满。Monitoring is then about making sense of it at scale because especially now with increasing automation levels, longer traces and like a lot of use cases. It's just not feasible anymore for you as a human to look through those logs completely manually. But you actually want a way to get aggregate metrics on what's actually going on and also detect signals where things are going wrong. So for example, cost and latency metrics, but maybe also quality signals like our compliance guardrails kept true to or also like how many users are actually frustrated with our system.
有多少人会因为对代理刚才的所作所为有点不满,而发全大写的消息?然后,嗯,把这些都汇总起来,当然你也能找到想进一步深入探究的有趣内容。How many are writing all caps messages because they are maybe a bit upset with what the agent just did and yeah all of this aggregating and then u of course also finding the interesting stuff that you want to dig deeper into.
通过这种监控从生产环境中获得的信息,也是你可以用来构建数据集的基础之一。归根结底,数据集代表了你希望智能体在生产环境中处理的内容。因此,其中应涵盖它可能遇到的所有情况,也包括超出范围的请求;对于这类请求,你希望智能体能正确地将其转交处理,并确保它不会提供投资建议,也不会回答纽约的天气如何——毕竟,它只是一个已停用的 IT 支持智能体。what you get from production through this monitoring is then also one of the foundations that you can use to build out your data sets and data sets are in the end a representation of what you want your agent to handle in production. So all the cases that it might be getting also maybe out of scope requests that you want to like correctly also be deferred and make sure that like the agent is not trying to give investment advice or also answering what the weather in New York is going to be like if it's actually just a dead IT support agent.
这些条目可以包含输入,也可以包含你期望的输出,比如示例回复、你希望看到的预期行为,或者希望涵盖的关键词。然后,这些内容就可以作为稳定的基准,用于离线改进和迭代,也可以纳入 CI/CD 流程。And those items you can then have like the input but also what you expect it to have as the output which can both be like a sample reply or also expected behavior that you want to see or keywords you want to have covered. And this can then be used as a stable benchmark either for like improving and iterating offline or also as part of your CI/CD.
然后会用这些数据集来开展实验。实验嘛,如果你回想一下大学里学过的统计学,或者你做过的任何类似的事情,归根结底就是改变设置中的某个因素,然后观察会发生什么。比如,修改提示词、更换模型、调整上下文或工具描述,看看这样是否能更好地处理你真正想处理的问题,并且理想情况下将各个因素隔离开来。Those data sets are then used to run experiments on and experiments are if you maybe look back into university and statistics or anything that you might have done. It's in the end this idea of varying something about your setup and looking what happens then. So for example, changing a prompt, changing a model, changing the context or the tool description and to see if it's then better dealing what you actually what you with what you actually wanted to deal with and ideally isolating concerns.
因此,如果你想检查同一个模型换用不同提示词后表现是否更好,理想情况下只改变提示词,而不是同时改变其他五个因素;否则,你很难解读自己实际观察到的结果。最后,你还需要评估或评估方法,确保能够衡量这些实验中发生的情况,因为同样地,你不想什么都亲自检查。So if you want to check if the same model performs better with a different prompt, you ideally only change the prompt and not five other things because otherwise it's going to be hard for you to interpret what you actually see. And then finally, you need evals or evaluation approaches to make sure you can also measure what's happening in those experiments because again you don't want to look at everything yourself.
顺便说一句,你们可能确实应该时不时这样做。不过,你们也需要可扩展的方法,例如让 LLM 担任评判者,也就是用另一个 LLM 来检查这个 LLM 做了什么;或者使用基于代码的评估,适用于分类任务等场景,在这些场景中,你可以检查是否完全匹配。检查行为也可以通过确定性检查来完成,或者在检查是否全部使用大写字母之类的情况时也是如此。这就是 AI 工程循环。我们观察到,许多客户会根据自己的使用场景,从几个不同的切入点开始。which you by the way should should probably sometimes do. but still you also want the scalable approaches which are for example LLM as a judge. So using another LLM to check what the LLM did. or also code based evals for things like classification tasks where you can check for an exact match or also checking behavior can be a deterministic check or if you are checking for all caps type things. So this is the AI engineering loop and what we observe with many of our customers is that there's depending on your use case a few different entry points into this.
所以,比如说,如果你处在一个低风险环境中,而且只是在构建内部聊天代理,一开始可能完全没有部署可观测性工具;之后也许会从链路追踪入手,再添加一些监控,看看用户在哪些地方感到沮丧,但起初你并不太在意评估环节。So if you're for example in a low stakes environment and you're only building your internal chat agent, you might first not have a observability tool in place at all and then you maybe get started with tracing and add some monitors to just check where are people getting frustrated but you don't care about the eval part too much in the first place.
你只需随着时间逐步完善它,并在推进过程中添加测试用例,不过也可以直接投入生产环境。但如果你要构建面向客户的应用,尤其是在受监管的环境中,就可能不想冒险让智能体执行它不该执行的操作。因此,在这些受监管行业中,我们看到一些逐渐兴起的做法,而其基础始终是追踪。你始终要了解实际发生了什么、它采取了哪些步骤、看到了哪些输入和输出,以及调用了哪些工具。You just build it out over time and just like add those test cases as you progress but you can go to production directly. However, if you're building a case that is customer-facing and especially if you're building a case that is in regulated environments, you probably don't want to risk the agent doing something that it's actually not supposed to do. So for those regulated industries, we've seen a few approaches emerging and the foundation is always tracing. So you always want to know what is actually happening, what steps is it taking, what inputs and outputs is it seeing and also what tools are being called.
此外,受监管行业的这些团队还找到了一些构建真实标注数据集的方法,之后可以围绕这些数据集反复迭代、持续改进。你们可能也都听说过自动改进。And then on top of this those teams in regulated industries found a few approaches on how to go about building out these ground truth data sets that you can then also loop on improve on and also you probably all heard about auto improvement.
这一切确实都需要以一个真实数据集为基础,而要构建它,你也有几种方法。例如,专家整理,也就是与公司内部的领域专家合作,确保你们构建出真实数据集。然后是影子运行:你持续手动执行流程,同时让智能体并行运行。这样你就可以随时比较:智能体会如何处理这件事?它会怎么做?通过这种方式来衡量准确率,同时构建真实数据集。最后,就像我们在我之前的公司做过的那样。all of this definitely needs the foundation of a ground truth data set and you yeah have a few approaches to get there. For example expert curation so working with your domain experts within the company to make sure you're building out the ground truth data set. Then for example shadow runs. So you run the process continuously manually but in parallel you also have the agent running and you can always compare how would the agent have handled it? How would the agent have gone about it and then like this measure the accuracy but also build out your ground truth and then finally like we did it also in my previous company.
运行一个完全由人工参与的系统,并随着时间推移将数据划分为两部分:一部分是你有信心实现自动化的,另一部分则是你始终希望有人参与其中的。关于引言就说这么多。Run a fully human in the loop system and over time slice the data into parts where you are confident to automate versus things where you always want a human in the loop. So, so much on the introduction.
现在我们来看一个更实际的例子。为此,我也再次欢迎 Donelli 登台。接下来,我们将一起看看如何将智能体的执行过程追踪到 Langfuse,如何评估和改进系统,以及如何持续闭合这一反馈循环。we now want to go in a more practical example. And for this, I'm also welcoming Donelli again on stage and we're going to look together into how to trace your agent execution into Langfuse, how to evaluate and improve your system, and how to continuously close this loop.
Doneyli:大家好。就像 Annabelle 说的,我叫 Don,不过为了让大家叫起来方便,你们可以叫我 Don。只有我闯祸的时候,我妈妈才会叫我 Don。对,没关系,很好。我听到有人笑了几声。你知道,这是个不错的破冰开场。所以,这是第一次评估,进行得非常顺利。接下来我要给大家看的,是我们为几家合作中的金融机构构建的一个示例,因为他们正处于这样一个阶段:他们做出了第一个原型,也做了第一次演示,但随后领导层或团队可能会提出这样的问题。Doneyli: Hi everybody. Like Annabelle said, I'm Don, but you can call me Don to keep it easier for everybody. Only my mom calls me Don when I'm in trouble. yeah, that okay, that's great. heard a few giggles. So, you know, nice nice icebreaker. So, that's the first eval. It went perfectly. so now what I'm going to show you is an example that we built for a few financials institutions that we're working with because they're in the in kind of this process of they build their first prototype, they build their first demo, but then the question comes from leadership or maybe from the teams.
我们该如何评估正在构建的这些面向客户的智能体解决方案?在座有多少人来自金融服务或金融行业?对,我们在纽约,所以你们当然都是。还有没有来自金融服务以外行业的?比如医疗保健这类受监管行业?How do we evaluate this customer-facing agentic solutions that we're building? How many of you here are in financial services or in finance? Yeah, we're in New York. So, of course, you all are. any other industries others than financial services, regulated industries like healthcare and stuff like that?
演示:一款支持链路追踪和个人身份信息脱敏的银行助手Demo: a banking assistant with tracing and PII masking
好的,不错。太棒了。我觉得这个话题会让你们很有共鸣。基本上,我这里展示的是一个典型的银行助手。我们每个人只要使用银行服务,可能都在各自的银行见过这样的助手,对吧?不过,幕后发生的一切对银行本身或金融机构来说都非常重要,这样才能向你提供准确的信息,因为这涉及财务责任,也涉及法律责任。Okay, cool. Awesome. So, I think this is going to this going to speak to you very much. so basically what I have here is, you know, a typical, you know, banking assistant. Everybody, anybody of us that has a banking services probably have seen this in each of your banks, right? However, the all the stuff that happens behind is you know very important for the bank itself or for the institution to provide you with very accurate information because there is like financial liability, there's legal liability.
银行自身推出这类由 LLM 驱动的解决方案,存在不少风险。众所周知,LLM 本质上具有非确定性。因此,我们希望尽可能降低不可预测性、复现结果,并找出失效模式,以及智能体在什么情况下会给出我们不想要的结果,这样我们就能据此加以改进。There's a bunch of you know risk for the bank itself to put out these type of solutions when they are powered by LLMs which as we all know are inherently non-deterministic. So we want to make sure that we reduce the unpredictability and that we can then reproduce the outcomes as much as we can and figure out where are the failure modes and where is the agent giving us the results that we don't want so that then we can you know improve upon those.
在这个示例中,我想向你展示几件事。首先,我可以扮演几种不同类型的客户,因为银行显然总会有各种各样的客户,比如像我这样的普通人——我在银行里也就存了几块钱;但银行也会有超高净值人士之类的客户。所以,我们可以在这里扮演不同类型的客户。这一点很重要,因为我们想知道,当面对这些不同类型的客户时,智能体是否能够遵守我们设定的各种防护规则。In this example I have a few things that I would like to show you. The first thing is that I can impersonate, you know, a few different type of clients because obviously a bank is always going to have customers that are like, you know, your everyday Joe like myself. I only have a couple of bucks in the bank, but then you're going to have your ultra high net worth individuals and all of that. So, we can have here impersonation of different kinds. And this is important because we want to be able to know if the agent is able to respect any guard rails that we have put in place when it comes to those type of personas that we have.
另一点是,如果你注意这里的话——我放大一下。我们还启用了个人身份信息(PII)识别,任何被视为 PII 的数据在持久化到 Langfuse 之前都会自动屏蔽。The other thing is if you notice here maybe let me blow it up. We also have PII identification enabled and any sort of data that is deem as PII is automatically masked before it gets persisted into Langfuse.
再次强调,这是金融机构尤其关注的一项重大要求:他们不希望将客户的信用卡信息、社会安全号码等数据持久化存储在可观测性系统中。他们希望将这些数据保留在记录系统中,并尽可能存储在自己拥有的系统里。这项功能也已支持,接下来我会展示几个示例,说明如何实现。然后,我们还会检查智能体本身是否遵守了我们设置的某些控制措施、如何对其进行评分,以及我们定义的质量门禁是否也得到了执行。Again, this is another very big requirement for spec specifically financials institutions that they don't want to, you know, persist in an observability system their credit card information or social security numbers or their clients. They want to keep that on the systems of record and as much as possible in their systems that they own. So, that is also enabled and I'll show you a couple examples on how we can get that to work. And then we're also going to see if the agent itself is respecting some of the controls that we have put in place and how is being scored and if the quality gates that we have defined are also being enforced.
接下来我们会衡量所有这些内容。我会给你看几个例子,然后带你深入产品内部,演示如何进行设置,以及端到端的流程是什么样的。So we're going to me measure all of that. I'm going to show you a few examples and then take you behind the scenes in the product itself to show you how you can set that up and then how an end-to-end flow looks like.
比如说,在这个例子中,我以 Anna 的身份进入系统,询问国际电汇手续费。这是个非常简单的问题,答案只需从知识库中查找。几秒钟后,系统就会返回知识库中的查询结果。好了,你看这里,我展示了一些显然不会展示给客户的信息,不过我在这里这样做是为了演示。我还指出了调用了哪些工具、使用了哪些数据源,以及在这个智能体生成回答时,构成其配置的一些细节。So let's say that I am, you know, in this case I'm coming in as Anna. I'm asking about international wire fees. Very simple question, just a knowledge base. And then in a few seconds, it's going to come back and give me the results from our knowledge base. And here you go. You see in here, I'm surfacing information that obviously I wouldn't surface to a customer, but I'm doing it here for the purposes of the demo. But I'm calling out here the tools that are being called, the data sources that are being called as well and some of the details as well that make up the configuration of this agent when it comes to giving back this answer.
如果我接着说:“好吧,你看,我的卡丢了。这是我的卡号。它被冻结了吗?”我就是在明文中输入信用卡号,对吧?显然,这可不太好。If I were to then say, okay, look, I lost my card. This is my number. Is it blocked? I'm putting my credit card number in clear text, right? So that is obviously that's not great.
因此,你要确保:尽管无法控制用户在系统中输入什么,但在添加埋点和构建评估时,都能捕捉到这些内容。现在我们可以在追踪记录中看到,信用卡信息确实被隐藏了。如果我来到 Langfuse 并打开这条追踪记录,你会看到问题现在显示为“我的卡号是”,后面的内容在传到 LA 时已被完全隐藏。这是因为我设置了一个屏蔽函数,会自动屏蔽我定义的任何个人身份信息,因此这些信息不会以明文形式持久化保存在系统中。So you want to make sure that even though that the user you cannot control that you cannot control what your uses your users input in the system you want to make sure that you catch that whenever you are instrumenting and whenever you are building your evals so now we'll see in the trace itself that the credit card will be indeed redacted if I come here to langfuse and I open my trace you'll see that now the question is my car number is and then it landed in LA completely redacted That is because I have a masking function that automatically any sort of PI information that I have defined will be immediately masked and then is not persisted in plain text in my system.
我只是想向大家展示一下,一次典型的交互是什么样的。从顶部可以看到,这是用户发送的提示。但正如大家所知,幕后其实发生了很多事情,我们不一定会把这些内容展示给最终用户,但作为平台团队和开发人员,我们必须了解智能体的行为、表现以及输出质量。</numerusformSo just to show you in terms of what a typical interaction looks like and I can see from the top here this was the prompt that the user sent but then as you all know behind the scenes there's a lot of stuff going on that we don't necessarily surface to our end users but are critical for us as the platform teams as the developers to understand how the agent is behaving performing and the quality of the outputs as well.
我可以看到他采取的所有步骤构成的完整树形结构。你看,这里是他发起的 Anthropic LLM 调用,以及可用的工具。这里调用了一个工具列表,列出了账户等等。这些是输出。但更重要的是,在顶部这里,我可以看到我为这个特定用例定义的所有评分。I can see the entire tree of all the steps that he took. You know, here the anthropic LLM call that he made, the tools that are available. Here it called a list of tools. It listed the accounts and so forth. And these are the outputs. But then more importantly here on the top, I can see all the scores that I have defined for this particular use case.
你会看到,每当系统捕获到新的交互或新的追踪记录时,这些指标都会自动计算出来。我还可以捕获一些信息,比如我提供给客户的信息是否符合银行业务相关要求。也就是说,如果客户问的是天气,我就不会提供这类信息,因为这不符合要求;还可以捕获各种故障模式,以及我们是否设置了防护机制,拦截了我们要回复给客户的某些内容。You see that they're they're automatically calculated whenever there's a new interaction or a new trace being captured by the system and I can capture things if you know down from if the information that I gave to the customer is compliant with banking information meaning that the customer is asking about the weather I'm not going to give that information it's not compliant if there's any sort of failure modes if there's any guard rails that we're blocking any any answers that we're giving back to the customer.
举个例子,可能有人会来问:“我能把存款投到比特币里吗?”银行本身不应该就此提供信息,因为这会带来一些影响。代理正确地处理了这个问题,但同时也将其标记为投资建议,因此需要这个人去咨询顾问或采取其他方式。我们用一个分数来判断这一点。如果我再次查看追踪记录,就能看到具体情况。这里有输入防护栏,它告诉我主要风险是投资建议。One example of that is for instance I can come someone can might come and ask can I put my savings in bitcoin right so that is something that the bank itself shouldn't be providing information about that because that is you know that has some ramifications and the agent you know correctly does that but at the same time it is flagging it as investment advice and this requires you know for the person to either talk to an advisor or something else and we are using a score to do that. And if I go again to my trace, this is how I see it. I have the input guard rail here that tells me that this is the primary risk is investment advice.
而在这里的评分中,我可以看到客户在这次评分中的意图确实是寻求投资建议。这样我就可以很轻松地专门筛选出这类内容。And in the score here, I can see that the intent of the customer on this score was indeed investment advice. So that way I can very easily go out and filter for those in particular.
不过总之,我想给你们展示一下这个流程的大致情况。在深入介绍如何端到端地构建数据集和评估流程之前,最后要说的一点是,我们也支持多模态。比如,假设客户不是通过聊天机器人给你们发消息,而是打电话到你们的联络中心。我们可以看这里。But anyways, I wanted to show you kind of a simple flow of this. The last one before getting into the end to end on how you build a data set and how you build an evaluation flow is that the fact that we can also support multimodal. So let's say that instead of you having the customers writing via chatbot they're calling your contact center. We can come here.
我们可以说,我想处理这通电话。系统会将语音转换成文本,然后评估文本,判断其中是否存在违规内容。接着我可以在这里看到客户询问如何冻结他的卡,也确实能看到相关的追踪记录,甚至能看到发给客户的媒体的实际链接,也就是那段音频,或客户拨打的那通电话,以及通话转录文本和助手给出的回复。We can say I want to process this call and this going to do a speech to text and then the text is going to be evaluated to figure out if there's any violation on here and I can come then in here it says that the customer was asking about blocking his card and I can indeed see the trace here and I can even see the actual link to the media that the customer was sent or in terms of that audio or that call that the customer made and also the transcript and what the assistant gave back.
所以,关于追踪,如何才能捕获所有这些活动呢?现在,当我开始思考如何构建或建立一个框架,来评估客户将通过我的系统发起的这些交互时,我们都知道,客户是不可预测的。我们可能会出于特定目的设计一个系统或解决方案,但客户总能找到非常巧妙的方法,以不同的方式使用系统。So that is in terms of the tracing how can I capture all of those activities. Now when I am trying to then think about okay how do I then put together or put in place a framework on how to evaluate this interactions that my customers are going to be sending through my system because as we all know customers are unpredictable. We might design a system or a solution with a specific intention, but our customers are always going to find very clever ways to use a system in a different way.
构建数据集Building datasets
而且,我们也无法预先设想到,当我们将基于 LLM 的解决方案发布给客户使用、投入实际应用时,究竟会发生哪些情况。因此,这时我们就开始依靠制定评估标准,而对我们来说,其核心是构建数据集。那么,什么是数据集?我们先来看这个通用定义。数据集本质上就是一组问题及其预期输出,借此你就能衡量 LLM 或 AI 解决方案输出的质量。And we also cannot anticipate every single outcome specifically with LLM power solutions that are going to happen when we release this into the wild for customers to use. So that is when we start relying on building our evaluation criteria and for us the anchor of that is building data sets. So what is a data set? A data set is basically and let's go to this one that is the generic one. A data set is basically your set of questions and expected outputs that allow you to then measure the quality of the outputs of your LLM or AI solution.
如果你有软件开发背景,我喜欢这样理解这件事:这些就是你的测试用例。我认为,在座各位只要曾经将软件发布到生产环境,就不会在未经 QA 测试的情况下发布任何东西,除非你是直接合并到 main 或 prod 分支。我相信你们大多数人都这么做过,但这并不是最佳实践。If you come from a software development background, the way that I like to think about this is that these are your test cases. And I don't think anybody here that has shipped software into production will ship anything without passing into QA unless you merge into main or prod, which I'm pretty sure most of you have done it, but it's not a best practice.
我知道我做过,不过随便吧。但与此同时,你可以让智能体经过一系列步骤或要求的检验,从而获得证据,衡量你想要捕捉的所有内容。这里要注意的是,预期输出不一定非得是智能体将给出的答案。你也可以衡量智能体的意图,或者它应该做什么。如果你想衡量行为,可以通过不同方式来衡量输出质量。I know I have, but whatever. but at the same time, this is the way that you can then have the evidence that you pass the agent through a series of steps or requirements that measure all the things that you want to capture. And one thing to note here that the expected output doesn't necessarily need to be the answer that the agent is going to give. It could also you want to measure maybe the intent of the agent. You want to measure what the agent is supposed to do. If you want to measure behavior, there are different ways that you can measure the quality of the output.
这就是为什么你通常最终会有不同的数据集,来衡量智能体集群中特定事物或特定质量领域。你可以看到,我这里有一个数据集,基本上是在对我的智能体进行红队测试,寻找提示注入攻击,以及任何可能让人绕过我们设置的防护措施、进而获取不该获取的信息的攻击。And that is why you typically end up with different sets of data sets to measure a specific things or specific areas of quality in your agent fleet. You see here how I have one that is like basically red teaming my agent and looking for prompt injection attacks and any sort of attack that will allow someone to come in and circumvent the guardrails that we have put in place to then provide information that they shouldn't get.
我这里还有另一个,非常具体地针对某个使用场景:我想知道哪些案例存在争议,以及哪些争议尚未解决。重点在于,我可以针对特定使用场景,以及对该智能体的技术要求,整理出特定的数据集。在这里,我会说并非如此,因为我仍然认为人类非常重要。因此,你仍然需要领域专家参与其中,与开发团队一起定义这些内容。The other one I have here is like very specifically for a use case that I want to know which which cases have been disputed and where the dis the that dispute has not been solved. So the point here is that I can come and curate a specific data sets that are very specific to not only the use case but also the technical requirements that I have for that agent. This is where I would say that not unfortunately because I think I still think humans we are very important. So this is where you still need your domain experts in the loop working with the development teams defining what are these.
基本上,你可以通过两种主要方式来创建黄金数据集。我见过这两种方式的不同变体。第一种是你有一个团队,他们已经在某处准备好了一份电子表格,里面列出了所有想在我的智能体上测试的内容,然后直接上传就行,这很简单。There are two main ways that you can basically create your golden data sets. You either have a team and I've seen variations of both. You either have a team that already has a spreadsheet somewhere. these are all the things that we want to test on my agent and just upload it and that's pretty easy.
你可以来到这里说:“好,太棒了,我想创建一个测试数据集”,然后上传一个 CSV 文件。上传后,它就会完全呈现出你之前看到的所有内容。还有一点我想提一下:我向你展示的所有操作,你也都可以通过我们的 CLI 或 NCP,使用我们的 API,以完全相同的方式完成。只是我觉得,与其让 Claude 从头到尾完成这些操作,不如通过 UI 展示给你看。千万别弄错。You can come here and say okay perfect I want to create a test data set and then I want to upload a CSV and you can upload the CSV and it will exactly bring up everything that you just had before. The other thing I like to mention here everything that I'm showing you can do it as well identically through our CLI or NCP in our APIs. It's just that I think it's very it's better for me to show it in a UI rather than telling claude to do it end to end. Make no mistakes.
好,这部分就到这里。不过我也可以来到这里,说我想把一些项目添加到我的数据集中,比如那些已经包含在生产环境追踪数据中的项目。假设你已经看到我如何从应用程序中收集了大量活动数据。我可以来到这里,说我想把所有这些数据都添加到我的数据集中,然后选择我想要使用的数据集。Okay. so that is that on that but then I could also come here and say that I want to add you know items into my data set for instance that are already as part of my production traces. So let's say that you saw how I was already collecting a lot of activity from my application. I can come here and say I want to add all of these into my data set and then select the data set that I want to select.
这样一来,只要你确认这些都是符合你对未来输出或轨迹预期的好示例,就可以通过查看智能体生成的生产环境轨迹,以一种「用自家产品」的方式来检验你将要使用的数据集。这里还有一件重要的事,是我一直喜欢特别强调的一个流程,叫作错误分析。对吧?错误分析基本上就是:我想查看自己的轨迹。我觉得 Annabelle 之前作为 Langfuse 的用户时,也非常清楚地谈到了这一点;她当时不得不……我们今天早些时候还聊到了这个。So this way you can kind of dog food in a way the data set that you're going to use by looking at the production traces that your agent is producing as long as you have determined that yes these are good examples of what I want future outputs or traces to look like. Now an important thing here to do is a process that I always like to call out which is error analysis. Right? So error analysis is basically this idea that I want to look at my traces and I think Annabelle kind of talked about this very eloquently as well when she was on the other side as a user of Langfuse that she had to like and we were talking earlier today.
专家评审与失效模式Expert review and failure modes
她花了好几天查看追踪记录。这就是她的工作:查看追踪记录、结构、里面有什么、输出是什么,诸如此类。这仍然是一个非常重要的过程,因为查看追踪记录时,你首先会开始了解智能体的行为方式:它是否采取了你需要的所有步骤,是否调用了它需要调用的所有工具,以及是否给出了你想要的输出。这一点非常重要。但要如何简化这个过程呢?因为显然,系统投入生产后,我作为一个人,不可能去查看成千上万条追踪记录。She spent days looking at traces. That was her job: looking at the trace the structure what was what were the outputs and all of that. And that is still a very important process because when you look at the trace you first start understanding how the agent is behaving if it's taking all the steps that you needed to take if it's calling all the tools that it needs to call and if it's giving you the output that you want. That's you know very important. But then how do you simplify that process? because obviously it is not feasible for me as a human to go out and look at thousands of traces once the system is in production.
我们通常会做的是,挑选一批能够代表生产系统中轨迹的样本,让人类专家来查看并给我反馈。对吧?这就像是说,嘿,我有这么多活动记录。So what we typically do is we want to curate a sample that is representative of our production system on of traces for a human expert to come look and give me feedback. Right? It's the same as like hey I have all this activity.
我只抽取 10% 或 20%,然后可以说,我只想关注客户正在谈论的那些内容,比如争议或信用卡信息。你想用什么条件筛选都可以。然后,你可以为他们构建我们所说的“标注队列”,对吧?在这个标注队列中,你实际上是在告诉一位领域专家——比如说我——“嘿,你是风险专家。我需要你看看这个智能体给我们的,或者给我们的客户的输出,并告诉我你的看法。”I'm just going to take 10% or 20% and I can say I just want to focus on the ones that the customer is talking about, you know, disputes or credit card information, whatever filter that you want, you can do that. And then you can build for them what we call an annotation queue, right? In this annotation queue, effectively what you're doing, you're telling a domain expert, in this case, let's say me, that, hey, you are the risk expert. I need you to take a look at this output that the agent is giving us or is giving our clients and give me your input.
关键是,你要让领域专家觉得这件事非常简单,因为他们显然还有自己的本职工作,没法花好几个小时来查看这些内容。所以我通常建议,你可以给他们几个评分项,让他们来打分,比如是或否、真或假,或者 1 到 10 分的量表,具体形式都可以。And the thing is here you want to make it very simple for the domain expert because obviously they have their day job. They cannot spend just hours looking at this. So the typical things that I recommend is you can give them like a couple scores that they can give you, you know, yes, no, true, false, a scale 1 to 10, whatever that is.
然后他们也可以到这里给你留一条评论。比如说,这里的失败模式——姑且假设这个案例是缺少引用。然后我会添加一条评论:这里没有引用。所有这些情况都需要补上,对吧?你会走完这个流程,看看,你知道,这对我来说很简单。大概花了我 10 秒钟。假设我有……我也不知道,一百个这样的案例,每个花 30 秒,那就是 50 分钟。等等,不对,甚至不到。对吧?我今天数学不太好。不过你懂我的意思吧?And then they can also come here and give you a comment. So let's say here failure mode, let's just say for the sake of argument that in this case is missing a citation. And then I'm going to put a comment. Citation is not there. Needs to be included in all these cases, right? You're going to go through this process and look how you know it was simple for me. It took me what 10 seconds maybe. So let's say I have I don't know a hundred of these and it takes me 30 seconds each. That is what 50 minutes. No, no, not even. Right. I'm I'm I'm bad at math today. But anyways, you get the idea, right?
这样你就可以跟你的领域专家说:“嘿,给我一个小时。我会为你整理一批活动内容,你只要给我反馈、提几条意见就行。”So you can tell your domain expert, hey, give me an hour of your time. I'm going to curate a bunch of activity for you. Just give me your feedback. Just give me a few comments.
现在有了 Whisper Flow 之类的工具,他们只要口述就行了,甚至都不用打字。对吧?所以要把这件事做得非常简单。接下来要做的第二件事是,我会把它标记为已完成。现在,这个人工标注会作为证据保存在追踪记录中。但我想做的第二步,是把他们提供的所有信息和标注都收集起来,然后用 LLM 找出所有反馈中反复出现的失败模式或类别。对吧?也就是说,你不是让主题去凭空创造类别。And now with whisper flow or something, they can just dictate it. They don't even need to type it. Right? So make it very simple. The second thing that you're going to do with this, I'm going to mark this as completed. Now this human annotation lives with the trace as evidence. But then the second step that I want to do is take all this information, all this annotation that they gave us and then actually use an LLM to find all the failure modes or categories that are patterns across all of their comments. Right? So it there might be you're not asking the theme to invent categories.
你只是在告诉他们,把你对这些追踪记录未经筛选的原始评论给我,然后你会用 LLM 来归纳类别,因为这正是它们擅长的。它们很擅长模式匹配。You're just telling them, give me your unfiltered raw commentary on these traces and then you're going to use an LLM to then figure out the categories because that's what they are great at. They are great at pattern matching.
它们非常擅长从文本中提取信息。这样一来,你就能让领域专家的工作保持简单,同时让 LLM 去做它们最擅长的事情。现在,当你收集齐所有这些类别后,我们就可以深入讨论失败模式。如果我来到这里查看我的实验,这些失败模式就是你每次运行评估时会看到的内容——你会看到我正在针对所有这些指标进行衡量。也许我把它调出来给你看一下。现在,在领域专家给出输入之后,我提取出了基于领域专家的判断,在我的数据语料中最常出现的类别有哪些。They are great at extracting information from text. So that way you keep it simple for the domain expert and use LLM for what they are great at. Now once you have all those categories that is where we can then get into our failure modes and those failure modes if I come here and look at my experiments that is what you're going to see whenever I run an evaluation you see all of these things that I'm measuring against. Maybe let me brought it up here. So now after I have my domain expert give me the inputs I extracted what are the most common categories that appear in my corpus of data based on my domain expert.
接下来我就可以定义一下质量的向量或维度,怎么说呢。我们就叫它们分数吧,不过我喜欢用些花哨的词来表达事情。I can then define what are my vectors or dimensions of you know quality. Let's just call it we just call it scores right but I like to come up with fancy words to say things.
不过你可以看到,其中一项是专家希望源文本在正式语域方面准确。也就是说,在某些语言中,你可能希望用更正式的语气称呼客户;如果语言与客户使用的语言相符,就必须包含未经请求的内容,等等。But you see here how one of them was sites experts expected source correctness for formal register meaning that you know in some languages you want to address your customers with a more formal tone if the language matches what the customer came in with u must include non solicited and so forth.
选择评估器Choosing evaluators
现在我已经有了这些类别作为基础,用来衡量输出质量,接下来就可以决定该怎么评分了,对吧?评分类型是什么?评估器又是什么类型的?为此,我可以来这里构建自己的评估器库,对吧?这样,正如你所知道的,跟踪记录传入时,它们就会自动为我计算这些分数;与此同时,我也可以让客户端应用在在线实时发生事件时直接计算分数,然后再把分数反馈给系统。So now that I have that foundation of the categories that I'm going to measure on the quality of my outputs, then I can decide okay cool. So now how am I going to grade that right? What type of score is that? What type of evaluator is that? And for that I can either do come here and build my kind of library of evaluators, right? So that those as you know traces coming in they're automatically calculating those scores for me but at the same time I can have the scores being calculated directly from the client application whenever something happens online in real time so that then I can surface it back to the system.
但基本上,我希望有一种方法,既能通过 LLM 作为评审给出的评分或评估器,也能通过确定性评估器来衡量智能体的输出。But basically, I want to have a way of me measuring the outputs of the agent across both LLM as a judge scores or evaluators, but also deterministic evaluators.
我们与这些客户合作还得到了另一个经验:根据你所确定的类别,在“由 LLM 担任评判者”的评估器和确定性评估器之间进行合理、均衡的搭配,越充分越好。因为如果你百分之百依赖 LLM 担任评判者,部分输出就有非零概率不准确——这正是 LLM 的本质所决定的。Another lesson that we've seen working with these clients is that the more that you can have a mix a balance mix that is depending on the type of categories that you identify between LLM as a judge evaluators and deterministic evaluators the better because what that's going to do is if you rely 100% just on LLM as a judge there's a nonzero chance that some of the outputs are going are not going to be accurate because that's just the nature of the LLMs.
但是,如果你把一些确定性检查也考虑进去——对于相同的输入,无论发生什么,这些检查的结果始终完全相同——那么你就可以综合评分,或者对智能体的质量进行综合评估。这正是我们通常希望看到的效果。你可以看到,在这里,当我试图定义一个新的评估器时,我可以选择将它设为一个由 LLM 担任裁判的评估器,也可以设为代码评估器,并且可以详细定义如何评估特定的智能体活动。But if you factor in some deterministic checks that are always going to be exactly the same for the same inputs irrespective of what happens, then you can have a blended score or a blended assessment on the quality of your agent. So that's what we typically would like to see. And you see here when I'm def trying to define a new evaluator I can come and say I want it to be a new LLM as a judge evaluator or I want it to be a code evaluator and I can define all the details on as to how I'm going to evaluate that particular agent activity.
就是这样。然后,如果我想要一个代码评估器,你看,这只是代码。它是一个函数,就是代码。非常简单,只是一个正则表达式。它执行的是精确匹配。但它每次都会给我相同的输出。它不会是 95% 或 80% 的一致性,而是对于相同的输入,输出总是 100% 一样。所以再说一遍,这里的经验是,你要把两者结合起来。这就是评估方面的内容。现在我们已经谈到了安娜贝尔说的内容,也许我回到这里的 AI 工程循环。我们已经谈到了构建数据集。So that's that. And then if I want to have a code evaluator, you see this is just code. It's a function. It's code. This is very simple. It's just a reax. This is doing an exact match. But this is going to give me the same output 100% of the time. This is not going to be well 95% or 80%. It's always going to be 100% the same output for the same input. So again, the lesson here, you want to have a mix of both. So that's on the evaluation side. So now we've talked about like Annabelle said and maybe let me go back here to the AI engineering loop. So we've talked about here building the data sets.
我们刚才谈到了如何将对这些运行实验的智能体进行质量测量这件事落地。然后,也许让我回到这里。基本上,实验是以一个数据集为基础的。We've we touched on how we can then operationalize the measurement of the quality of those agents running experiments. And then maybe let me go back here. So basically an experiment is anchored on a data set.
这些就是我的测试用例,也就是我准备拿来测试我的智能体的任务。现在我会想:你知道吗,这个智能体今天用的是这个系统提示词、这个模型和这些工具。如果我换个模型会怎样?如果我修改系统提示词会怎样?如果我突然给它权限,让它使用新工具、访问新数据,又会怎样?所以,在把它推向生产环境、然后纯凭感觉上线之前,你应该能先对这些改动进行原型测试。我们大家基本上一直都是这么做的,对吧?就是:“啊,看起来还不错。直接推到生产环境吧。”That's my test cases. Those are my tasks that I'm going to run against my agent. And now I'm going to say, you know what, this agent is running today with this system prompt, this model, these tools. What happens if I change the model? What happens if I make a change on the system prompt? What happens if I now all of a sudden I give it access to new tools to access new data? So you want to be able to kind of prototype that before, you know, promoting into production and just running on Vibes, which is pretty much what all we've all been doing, right? It's like, ah, yeah, it looks kind of good. Let me just push it into prod.
但这是你系统性地完成这件事的一种方式。几分钟后,我会向你展示如何将其集成到 CI/CD 流水线中,这样你就不必亲自参与其中了。But this is a systematic way of you doing that. And in a few minutes, I'll show you how you can incorporate this as part of your CI/CD pipeline, so you don't have to be in the loop.
这样,每当你的智能体发生变更时,CI 作业就会启动,针对数据集运行实验。它会使用新的配置评估你的智能体,并根据我之前提到的所有评分和评估器,为你提供一个通过/失败门禁。这样一来,你就能用一致的方式评估和衡量这些智能体的输出。明白吗?好,太好了。这就是实验。很好,我们已经谈到了实验、数据集,以及如何通过人工标注将人类及其专业知识纳入流程。那么,现在该如何把这一切整合起来呢?对吧?So that anytime a change hits on your agent, then a CI job is going to kick off to run the experiment against the data set. It's going to evaluate your agent with a new configuration and it's going to give you a pass fail gate effectively across all of the scores and evaluators that I mentioned before. So you have a consistent way on how you evaluate and measure the outputs of these agents. Make sense? Okay, perfect. So that's experiments. That's great. So we touched on experiments. We touched on data sets and human annotation to bring those humans and their expertise into the loop. So now how do I bring it all together? Right?
如果我来到这里,并且有我的提示词,也就是我在 Langfuse 中进行版本管理的系统提示词。你可以直接在 Langfuse 这里操作。你知道,我们没有也没关系。If I come here and I have my prompt this my system prompts that I'm versioning here in Langfuse. You can do it either here in Langfuse. You know we don't have it's okay.
我们甚至不为此收费,所以没关系。很多客户的做法是,他们在系统里还有另一个版本,也会在 GitHub、GitLab 或其他平台上保存一个版本。We don't even charge for this. So that's fine. A lot of our customers what they do is they have another version in system. they have a version in GitHub, GitLab, whatever that is.
每次提示词更改时自动运行评估Running evals automatically on every prompt change
不过,你应该把它看作是启动自动化流程的触发器,让评估完全自动进行。具体来说,我已经在这里定义了一个自动化流程。你可以看到,配置设置为在我这里的提示词发生任何变化时触发。触发后的操作是在我的 GitHub 中启动一个 CI 任务,就是这里这个。希望我不会……我没有从 GitHub 那里拿到独角兽。所以,就是这里这个。我已经设置好了 CI,它会一直等待我的智能体配置发生任何变化。我把它放大一点。然后我就可以过来查看我的提示词。But you should look at this as your trigger for kicking off the automation to do your eval completely automatically. So the way that this happens is I already have defined an automation here. And if you see the configuration is triggering on any prompt changes that I have here. And then the action is it's going to launch a CI job in my GitHub, which is this guy right here. Hopefully I don't I'm not get I'm not getting the unicorn from GitHub. So it's this guy right here. So I have already my CI set it up set up waiting for any changes in the config of my agent. Let me bring it closer here. And then I can come and see my prompt.
我们就来看一下这个。我有五个版本的提示词。你可以看到提示词是如何随着时间推移不断演变的。第一个版本原来是这样的,到了第二个版本,做了一点小改动。然后第三个版本嘛,我们尝试了一种不同的做法。Let's just see this one. I have five versions of the prompt. You see how the prompt has evolved over time. Version one, it used to have this and then version two, a slight change. Then version three, it was, you know, we tried something different.
这是用于开发的。然后到了版本四,我们添加了更多细节,还向智能体的配置传入了不同的参数。但我现在可以这样做:你知道,我目前使用的就是这个生产系统提示词。我想用版本 4 再测试一次,因为我发现了一些回归问题。所以我可以来到这里,将它提升到生产环境。再说一次,我是像个原始人一样手动点击操作给你看的。这些都可以通过 CLI 上的 API 完成,所以你完全不必手动操作。This is for development. Then version four, we added more details and also passing different parameters into the configuration of the agent. But what I can do now is I can say, you know what, this is the production system prompt that I have right now. I want to test again with version 4 because I saw some regressions. So I can come here and do promote into production. And again, I'm showing you this as a human, you know, like a caveman like clicking through. All of this can be done via the API on the CLI. So you don't even have to do this by hand.
你只需调用 API,并说“将这个提示词版本标记为生产环境”,它就会为你启动流程。我有生产标签。我要保存并将其提升到生产环境,这就是新的配置。几秒钟后,这里应该会启动一个新的 CI 作业,接着启动实验来运行我的评估任务。You can just call the API and say promote this prompt version with a production tag and it will kick it off for you. I have the production tag. I'm going to save and promote promote to production which is the new configuration. In a few seconds we should have a new CI job that is going to launch here that then is going to kick off the experiment to run my evaluation run.
好了,就是这样。感谢 GitHub,真的非常感谢。太完美了。现在我有了一个会自动运行的任务。每当我对 agent 的配置做出任何更改并推送时,就会触发 CI,运行评估门禁,告诉我是否通过了之前定义的各项评估。这样一来,我就能获得证据和保障,确认能否安全地将这套新配置投入生产环境,也能知道 agent 的质量究竟是在下降还是提升,甚至是否违反了我设置的任何防护规则。Okay, there you go. Thank you GitHub. Thank you so much. So perfect. So now I have this job that is running automatically. So any time that I push any changes in the config of my agent, it's going to hit the CI. It's going to run the eval gates to tell me if I'm passing or failing any of the evaluators that we have defined from before. And then with this way, I can have the evidence and also the assurance if I can go into production, you know, safely with this new configuration. if it's actually the agent is degrading or improving in quality or maybe even violating any sort of guard rails that I have put in place.
这会运行几分钟,不过我先给你看看我之前运行的一个。要查看结果,我可以到这里看看输出是什么。它告诉我发送的提示词、版本、标签,然后告诉我他们给出的结果是 passed,对吧?That's going to run for a few minutes, but let me show you one that I run earlier. And to show you the result, I can come here and see what the output is. And it's telling me that this was the prompt that was sent, the version, the labels, and then it's telling me that they gave passed, right?
很好。这些就是我用来评估智能体的指标,包括来源召回率、语言匹配度、正确性,以及是否存在未经请求的追加销售。我还可以设定最低标准,也就是说,可以指定某项分数必须达到的最低门槛。如果没达到这个门槛,就不能算通过,也不能投入生产。当然,在这个例子里,我还不至于直接说:“好,过了,合并进去,然后推送到 main 分支。”我只是先让它放在那里。So, perfect. And these are the evaluators that I measured my agent against. I have here the most include, the source recall, the language match, the correctness and not unsolicited upsell. And I can also define minimums. I can say this is the minimum threshold I have for this specific score. If it doesn't clear that bar, it's not going to be considered as a pass to go into production. Now, obviously, in this case, I'm not crazy enough to just say, okay, cool. So you pass, go merge it and push into into main. I'm just letting it sit there.
不过说实话,你完全可以搭建一套端到端流程,让它自动为你创建 PR,然后等着别人来审查 PR。或者,如果你也像现在很多人那样,只要达到标准就直接把 PR 合并到主分支,至少你手头有证据,对吧?But admittedly, you could have a full end to end process that it will just create the PR for you and it will just wait for someone to review the PR or maybe if you are, you know, like everybody's doing today, just pushing the PR into main straight up if it's clearing the bar, but at least you have the evidence here, right?
所以你不是仅凭感觉,或者仅凭你认为 agent 擅长做什么,就提交一个 PR。可以说,你确实有完整的记录和证据,说明你为什么要为这个新的 agent 配置做出这样的决定。很好。那么现在我想再给你看一两个实际用例,对吧?因为我们一直在谈 Langfuse 的技术层面,而越来越多的组织也开始非常关注 token 经济学了,对吧?我觉得 2025 年到 2026 年初,大家都在追求 token 用量最大化;现在大家则开始关注 token 的价值。So you're not pushing a PR just running on vibes or just running on what you think that the agent is good at doing. You're actually have the paper trail so to speak and the evidence on why you make that decision for this new configuration of the agent. Perfect. So now I want to show you one couple more things as an actual like use case, right? because we've been talking a lot about the technical aspects of Langfuse and more you know organizations are focused a lot on tokconomics right I think 2025 in beginning 2026 everybody was token maxing now everybody is like token valuing.
面向利益相关者的仪表板Dashboards for stakeholders
不管他们现在怎么称呼它,大家都在想方设法从自己的 tokens 中榨取尽可能多的价值。接下来我来给你展示几种方法,你可以用来向老板、领导或其他相关人员展示;或者,你也可以为业务利益相关方制作一份报告,让他们更放心,确信你正在打造的 agent 解决方案确实能为业务带来收益。这不仅仅是我们在做一件很酷的事情。我这里有一个仪表板,正尝试整理一些指标,并根据从 agent 收集的数据向业务部门汇报。Whatever they're calling it now so everybody's like trying to extract as much value as they can of their tokens. So now let me show you a couple of ways that you can then show your bosses or your leaders or whoever or maybe you want to build this for your business stakeholders for them to feel a little bit more reassured that whatever agent solution that you're building is actually bringing benefits to the business. This is not just like oh the cool thing that we're building. Now I have here a dashboard that I'm trying to put together a few metrics that I can report on to the business based on the data that I'm being collecting from my agent.
对吧?第一个是……这也是你可能会质疑其背后逻辑的地方,不过你知道,每个组织都不一样。但我想在这里展示的是,过去七天里,这个智能体有 1,400 次交互不需要转给人工客服,对吧?Right? The first one is and this is where you might argue with me in the logic behind this but you know every organization is different. But what I'm trying to show here is that I've had 1,400 interactions of this agent over the last seven days that didn't need to go to a human agent, right?
这太好了。也就是说,我省下了人力,不必花时间和客户交谈,然后再做计算。那这花了我多少钱?过去七天里还不到7美元,对吧?So that's great. So that means that I'm saving, you know, human capital from spending time to talking to customers in and do the math then. How much has that cost me? It has cost me less than $7, right? Over the last seven days.
如果你看任何一位客服人员——我大概 20 年前曾在呼叫中心工作过——你知道要付给那个人多少钱:每小时 15 到 20 美元,对吧?所以,那个人不可能一小时处理 1,400 个电话。光这一点,你就已经能看出部署这套解决方案至少带来了一些显而易见的业务效益,对吧?这是第一点。第二,你还可以开始找出客服人员在哪些方面会出问题,对吧?如果你还记得,我们定义了各个类别,也就是业内所说的失效模式,指客服人员无法给出我想要的结果或答案的情况。If you take any contact I used to be a contact center employee back in the day 20 years ago you know what you gonna pay that person $15$20 an hour right so that person is not going to handle 1400 calls in one hour so already you're showing at least some directional business benefit by having this solution in place right so that's the first thing the second thing is you could also start pinpointing what are the areas where your agent is tripping Right? If you remember, we define the categories or the failure modes as we call them in the industry where the agent is not giving me the results or the answers that I want.
这些是我按过去七天内出现的顺序记录下来的问题。你可以看到,现在排名前三的是超出范围、语体过于随意和争议未解决,而且它们一直在逐渐增加。这样一来,我就不必再去翻查成千上万甚至几十万条跟踪记录,试图找出哪个智能体活动导致的错误最多或问题最大;我可以直接来这里缩小范围。我已经知道,这种失败模式是最主要的问题:超出范围、语体过于随意和争议未解决。And these are the ones that I'm capturing in order of occurrence over the last seven days. You see here that now out of scope, informal register, and dispute not resolved are my top three and they've been creeping up over time. So now, instead of me having to go through thousands or hundreds of thousands of traces trying to figure out which one is the activity from the agent that is causing the most errors or the most trouble, I can come here and scope it down. And I know already that this failure mode is my top one, the autoscope, the foremost registered and the dispute not resolved.
现在我可以在追踪界面里来到这里,设置一个非常简单的筛选条件,比如“争议未解决”。我可以把它保存为一个视图,这样就不用每次都重新筛选了。你看,它已经在上方帮我筛选好了。So now I can come here in my tracing and do a very simple filter and say dispute not resolved. I can save it as a view. So I don't even need to every time filter it. You see how it's filtering up top for me.
而且我还可以在侧边栏这里输入“争议未解决等于零”。这样就能显示所有客户提出了争议,或要求对某个产品提出争议,但客服人员尚未解决的情况。这些情况要么需要转交给人工客服,要么就一直搁置着,直到会话关闭,最后什么也没发生。这样一来,我就不用逐条查看成千上万条记录,而是可以把范围缩小到几十条或几百条。然后,我就能开展更有针对性的调查,也能找出我的客服代理在哪些方面会把事情搞砸。这就是其中一个例子。And even on the side I can come here and say dispute not resolved equals zero. So that shows all the instances where the customer had a dispute or was asking for a dispute of a product and it hasn't been resolved by the agent. So it either had to go to a human agent or it just lingered and the session closed and nothing happened. But now I can then spend my time instead of going through thousands, I can scope it down to maybe dozens or hundreds. And now I can do an investigation that is more targeted. And now I can also find where are the areas where my agent is actually tripping itself up. So that's that's one.
第二点是,如果我想在仪表板中查看,我希望能够知道客户给我点赞或点踩的次数分别是多少。The second one is that if I want to come here in the dashboards, I want to then be able to say okay what are the number of times where my customers are giving me either thumbs up, thumbs down.
我可以很轻松地把它记录成一个分数。你看,在这里,每次我都可以点个赞或点个踩,然后直接在仪表板上展示出来,非常容易理解。任何业务人员、用户,实际上任何人都能看到这些数据,然后说:“好吧,大多数人都点了赞,这不错。不过那些点踩的呢?我们来关注一下。你知道,有 18% 的人点了踩,这些人遇到了什么情况?”另一个方面是安全情况。好消息是,我们的智能体与客户的大多数交互都没有发现任何风险。I can capture that as a score very easily. You see here every time I can come here thumbs up thumbs down and I can just show it here in a dashboard very easy to consume any business person any user any human actually is going to be able to see this and say okay most of them are thumbs up that's cool but what about the thumbs down let's focus on that you know 18% of them what's been happening and then the other one is around the security mix more in here good news most of our interactions from the agent is not catching any sort of risk in the interaction that is having with the customers.
但我们在这里看到,过去七天的89个案例中,客户实际上是在询问投资建议,而客服可能已经给出了投资建议,或者试图给出投资建议。因此,我们可以进一步筛选并重点关注这些案例。But we see here that in 89 cases over the last seven days, it actually the customer was asking for investment advice and the agent might have given or might have tried to give investment advice. So we can then go out and focus on those.
还是一样。我可以在这里说,让我回到默认视图。现在,我可以把数值评分改为类别评分,添加一个条件。然后问,意图或安全风险是什么?假设安全风险是投资建议。现在,我可以看到有哪些具体示例中,投资建议被判定为触发标记的原因,而且代理不应就此与客户互动。你可以看到,这里甚至包含我之前给你看的那个示例。And again, same thing. I can come here and say, let me go back to my default view. And now I can say instead of the numeric score, I can come and say the categorical scores add a condition. And then say what is the intent or the security risk and then the security risk, let's say investment advice. And now I can see what are the specific examples where investment advice was identified as a reason for being flagged and that the agent shouldn't engage on that with the customer. And you see here even from the previous example that I was showing you.
这就是我想展示的内容:首先,端到端地构建一个优先面向客户的解决方案是什么样的。显然,这会带来许多重大的影响,包括责任方面的影响、财务影响,以及声誉方面的影响,因为你肯定不希望向客户提供不准确或由模型幻觉生成的信息。你还可以遵循一套系统化流程,展示证据并验证这些智能体的输出确实遵循了你设定的防护措施和控制机制。So that's kind of what I wanted to show in terms of first the nature of going end to end on a solution that you're putting customer-facing first. Obviously, which has a lot of critical implications in terms of liability, you know, financial implications for and reputational as well because you don't want to be putting out information that is not accurate or is hallucinated in front of your customers and how you can follow a systematic process so that then you can show evidence and validate that the outputs of these agents is actually following the guardrails and the controls that you have put in place.
接下来,我想再次把时间交给 Annabelle,以便我们结束本次活动,之后也许可以在最后回答几个问题。谢谢。And with that I would like to leave you with Annabelle again so we can close and then maybe we can take a couple of questions at the end. Thank you.
与您的编程智能体协作Working with your coding agent
Annabell:我们看到一些公司或团队试图做的事情是这样的:“帮我修好我的智能体。不要犯任何错误。”我们大概还有几件事不太建议这么做。即使你的智能体通过 MCP 或 CLI 接入了你在 Langfuse 或其他工具中的数据,我们仍然看到,这种做法产出的往往是些粗制滥造的东西,而不是真正能帮到你的东西。当然,我们也非常支持借助编程智能体持续改进你的应用。所以我们想把这张图分享给大家,或许能帮你记住这一点。Annabell: So what we see some companies trying to do or some teams trying to do is this. Please fix my agent. Make no mistakes. And there's probably a few things that we can recommend less than this. Even though your agent might be hooked up via MCP or CLI with your data in Langfuse or in whichever tool you might be using. this is something that we just see producing rather slop than anything that is actually helping you. But of course we're also very much in favor of working with your coding agents to continuously improve your applications. so we wanted to share this just as a picture how you can maybe memorize it.
所以这里有两个这样的维度。一个是时间投入,也就是花很多时间或很少时间;另一个是系统质量,也就是低质量或高质量,而你不希望处于低质量的那一端。So we have two of those a here. We have one being the time invest. So, a lot of time spent or very little time spent and then also a low quality system or a high quality system and you don't want to be down there.
如果你把这一切都完全自动化,只让你的智能体放手去做,然后告诉它“把所有问题都修好,替我搞定”,结果不会太理想。最终质量会很低。没错,你什么都不用做,但你的客户也不会特别满意。与此同时,你也不想再完全采用手动方式了。你不想再亲自为应用添加监测埋点。这些事情可以自动化。你也不想亲自捕捉所有故障模式,再把所有数据重新审核一遍。这些也可以自动化。但与此同时,有些事情还是应该融入你自己的判断和品味。If you fully automate it and just let your agent go for it and just be like fix everything, do it for me. this is not going to turn out well. You will end up with low quality and yes, you don't have to do anything, but also your customers will not be super satisfied. At the same time, you also don't want to go go the full manual way anymore. You don't want to instrument your app yourself anymore. This is something that can be automated. You don't want to catch all the failure modes yourself and re review all the data yourself. This can be automated. but at the same time, for some things, you should get your taste in.
你应该让领域专家参与进来,共同构建和整理数据集,明确应用真正要解决的问题,以及希望它朝哪个方向发展。You should get your domain experts in the room to build out the data sets to curate what is actually what actually is the problem that your application should be solving and in which direction you want it to go.
而你希望最终落在这里附近。也就是说,在理想状态下,你既要审查数据、融入自己的品味和领域专业知识,也要借助编码代理完成所有可以自动化的事情,比如为系统添加监测、找出失效模式、运行评估,甚至进行 20 次实验,而不只是做你原本会想到的那一次。总之,尽量别落到左下角,而是努力成为一名有品味的 AI 工程师:融入自己的判断,确保评估做得出色,同时随着时间推移,逐步将这个循环中的更多环节自动化。And for this you want to land somewhere here. So where the ideal balance is between like you reviewing data, bringing in your taste, bringing in your domain expertise, but also working with your coding agent for all the things that you can automate like instrumenting it, finding failure modes, running the evals, maybe making also 20 experiments instead of only one that you would come up with and yeah, just like avoid getting down there in the left down corner, but try to be the tasteful AI engineer that is bringing in the taste, making sure the evals are great and then you can also more and more automate this loop over time.
如果我们是你,而且必须明天就开始,我们会这样做。我们会安装 Langfuse 技能,它是一个,嗯,是一个代理技能。If we were you and we would have to get started tomorrow, h this is what we would be doing. We would install the Langfuse skill which is a yeah it's an agent skill.
所以,这是一组 Markdown 文件,帮助你的编码代理理解如何使用 Langfuse,以及如何落实这些最佳实践。它关联了我们的文档,涵盖所有集成页面;也关联了我们的 Academy,我们会在那里深入讲解数据集相关的最佳实践、如何进行埋点、如何编写评估器等内容。因此,这是一个很好的起点:既可以自动完成那些本该自动完成的事情,也可以整理出一组数据供你人工查看。So it's a set of markdown files that is helping your coding agent to wrap its head around how to work with Langfuse and how to implement those best practices. It is hooked up with our documentation with all our integration pages. it is hooked up with our academy where we ingrain the best practices around data sets and how to instrument and how to write evaluators and all of this. So it's a great starting point to do the things automatically that you should be doing automatically but also to maybe curate a set of data that you should look manually at.
接下来,你还应该开始收集真实标注数据,以便据此评估你的智能体。这些数据可以来自历史数据、生产环境,也可以来自你与领域专家一起运行的一些样本。如果你身处受监管行业,就要明确设定严格的界限,确保某些事情绝对不会发生。比如在金融服务领域,智能体绝不能提供投资建议。因此,要确保将这一点也纳入评估集,理想情况下,这种情况永远不会发生;但至少,万一发生了,你会及时发现。我们还为你准备了一些资源。you should then start to collect also ground truth that you can evaluate your agent against maybe from historical data also from production or from some samples that you're running with your domain experts and if you're in a regulated space define your hard limits in a way to make sure these are the things that definitely shouldn't happen for financial services for example it should never give investment advice so make sure that you're ingraining this also in your evaluation set that ideally never happening but at least you will know about it when it's going to happen and we have a few resources for you.
因此,Donelli 向你展示并使用的那个代码仓库也可以在网上找到。你可以亲自去看看,想要什么都可以从中获取,也可以将它用于自己的场景。So the repository Donelli showed you and used is also available online. you can check it out yourself. You can take everything that you want from it and also use it for your own use cases.
当然,这些都是虚构数据,并非实际从客户那里获取的。我想这次会议也会录制下来,所以你之后可以再回看。我们还推荐 Langfuse Academy,那里有一份更详尽的指南,再次介绍了 AI 工程的完整流程。我们也提供自助式工作坊,基本上会引导你完成所有步骤,让你先完整了解一遍,然后就可以着手开发自己的应用了。接下来几天还有机会和我们交流:Donelli 将于周三发表一场关于为 AI 智能体构建部署门禁的演讲。如果你想了解如何确保投入生产的 AI 模型确实通过质量门禁,欢迎来听听。It's of course fictional data and not not something that actually was taken from our customers and I think also this session will be recorded so you can take a look again. we then also recommend the Langfuse academy which is like a larger writeup of how to go about AI engineering the whole steps described again and we also have a self-serve workshop that is basically guiding you through all the steps so you understood it once and then yeah can go ahead with your own application there's some opportunities to bump into us over the next days one is Donelli is giving a talk also on building deployment gates for AI agents on Wednesday so Check it out if you want to understand how you can make sure that AI models that go to production are actually clearing quality gates.
我们也设了一个展位,9号展位。我还没去看过它在哪儿,不过我相信你们一定能找到。你可以在那里见到团队,还可以定制贴纸:拍一张自己的脸部照片,AI 就会生成印有你的脸和 Langfuse 的贴纸,里面可能还会加上一些笑话。你可以把贴纸带回家,贴在任何东西上。最后,我们还会举办一场社区跑步活动。如果你想走出会议中心和团队见面,我们有两位创始人也在这里,还有几位团队成员,而且我们都很喜欢跑步。we're also having a booth, a booth 9. I haven't checked out where it is, but I'm sure you will find it. you can meet the team there, but also you can get custom stickers. So you take a picture of your face and then it AI generates stickers of your face and Langfuse with a maybe some jokes also included. and you can take them home and sticker it on everything you have. And then finally, we also have a community run. So if you want to step out the conference center and meet the team, we also have two of our founders here and a few more team members and we're all big runners.
所以我们想,也许可以邀请其他所有人也一起来参加。所以,欢迎大家也来参加这场活动。我们也很乐意利用剩下的时间回答各种问题。这里还有一些非定制贴纸。So we thought we just might invite everyone else as well to join us for this. So yeah, please come for this one as well. And we're super happy to use the remaining minutes for any kind of questions. They also have some non-custom stickers here.
它只是一张很长的贴纸,不过我觉得还是挺酷的。所以如果你们想要,可以上来拿。我们很乐意回答任何问题。还有,请、请来找我们,别见外。我把话交给 Delli。It's just a lengthy sticker, but I think it's still pretty cool. So if you want some, you can come up and get them. We're happy to take any questions. and ple please meet us and don't be a stranger. I'm handing this to Delli.
Doneyli:是的。嗯,Langfuse 本身对 ClickHouse 有硬性依赖,用它来存储数据。这只是因为你知道,随着产品的发展,它最初使用的是 Postgres。但后来 Postgres 无法处理我们达到的规模,比如每天数十亿乃至数百亿条事件。于是我们转而使用 ClickHouse。Doneyli: Yeah. Well, the Langfuse per se has a hard dependency for their stores with click house. that is just because you know in the evolution of the product it started with Postgress. but then Postgress couldn't handle the scale that we achieved and like billions of billions of events per day. That's when we moved over to Clickhouse.
所以就数据平面而言,是的,在 ClickHouse 里。不过我想接着问你:你对数据存储有什么需求?我们也支持导出数据,可以导出到 S3。你可以通过 API、CLI 或 MCP 使用数据,也可以从 Langfuse 获取数据,完全由你决定。So in terms of that data plane yes in clickout so but maybe the followup for you what is the need for you in terms of that data stores because we also offer the ability for you to export the data you can export it to S3 you can use the a yeah you can use the API the CLI or the MCP if you want to consume the data from langfuse so it's totally up to you yeah
受众:我想把它托管在Audience: I want to host it on
Doneyli:是的,你完全可以把它托管在 Amazon 上。你知道,我们也提供自托管部署。你可以选择使用我们的云服务,它是完整的 SaaS 交钥匙方案,你什么都不需要做,它运行在 Amazon 上。但如果你想自己运行基础设施,比如你手头正好有一些 EC2 实例想用,我们也提供相应的部署模式,而且所有组件都已预先打包好。Doneyli: yeah you can host it 100% on Amazon it's you know we have a self-hosted deployment as well you can either use our cloud offering that is fully SAS turnkey you don't need to do anything it runs on Amazon but if you want to run the infra yourself because you have I don't know some you know EC2 instances lying around there you want to use we also have a deployment model for that and it comes prepackaged with all the components.
问答Q&A
Annabell:一个超级重要的问题。这个问题问的是评定者间信度,也可能只是想确保 LLM 作为评审的评估器保持一致,确实能捕捉到你想让它捕捉的内容。其实,这项语言技能的一部分也包括处理这件事,并帮助你……这有个术语,我一时想不起来了。归根结底,就是要确保 LLM 的评判方式和人类的评判方式一致。基本做法是,你先亲自评判一个样本,最好是有代表性的样本,然后运行你的 LLM 评审,再对它进行优化,使其判断结果与你们人类评分者的判断一致。理想情况下,你会有几位人类评分者。这就是学术界采用的方法。Annabell: A super important question so the question was about inter-rater reliability and also probably just consistency of LLM as a judge evaluators to make sure it's actually catching what you want it to catch there's actually also part of this language skill is handling this as well and helping you to h there's a term for it. it fell out of my head but it's in the end about the process of making sure the LLM is judging like a human would judge and what you do basically is you judge a sample ideally a representative sample yourself and then you run your LLM as a judge and you then optimize for the LLM as a judge being coherent with what your human human raters do and ideally you have like a few human raters and that's academic approach to it.
所以,比较实用的做法可能是先让一个人给一些数据打标签,然后针对这些真实标注进行优化;理想情况下,之后只需定期检查,确保你的数据集仍具有代表性。尤其是如果你要用它处理生产环境中的数据,理想的起步方式是让误报稍微多一些,这样能多捕捉到一些内容,而不会漏掉任何东西,然后再逐渐调整,降低误报率。So probably the practical approach to it is have one human label some data and then optimize against this ground truth and then ideally you just check it over time to make sure your set stays representative and especially if you are using it for running on production data it's in the end ideally you just start with having a few too many false positives so you catch a little more than necessary but don't miss anything and then you just tune it down over time.