@businessbarista: A few of my smartest friends in AI called me a "idiot" for not deeply understanding evals. So...I found the smartest pe…
Summary
The article explains evaluation methods for AI agents, covering easy, hard, and advanced modes with practical advice on tools like Harbor and LangSmith for safe testing and self-improvement.
View Cached Full Text
Cached at: 09/15/26, 03:40 AM
A few of my smartest friends in AI called me a “idiot” for not deeply understanding evals.
So…I found the smartest person I know on evals & made them teach me.
@Vtrivedy10 (leads Labs at @LangChain) took me from easy mode to god mode for a 38-minute masterclass on all things evals.
Easy Mode: what an eval actually is
Definition: did the AI agent do the job correctly?
You need two building blocks:
-
Tasks. The checkable jobs you care about. Log the meeting. Draft the email. Find Acme across the right Salesforce tables.
-
Verifiers. Something that can say right or wrong after the task. A script. Another model. A human with a clear checklist.
Hard Mode: what are environments
Definition: a safe practice field for your agent to do work & for you to evaluate its performance.
Rules of thumb:
-
Never test on production. Agents will cheat because they’re optimizing for the score you gave them.
-
If you’re not an engineer, you still have options for running environments/evals.
- Harbor (open source primitives for tasks, verifiers, sandboxes)
- LangSmith Engine (UI for people who can judge good vs bad without living in GitHub).
- Steal a published Harbor-format eval, ask Claude Code or Codex to explain it, then tweak it for your agent.
God Mode: what is a self-improving loop
Definition: Run the agent in the real world –> turn that production behavior into evals/environments –> change the agent so failures stop happening –> repeat
Rules of thumb:
-
Turn on tracing first. Traces = receipts of every action (tool calls, Salesforce pings, web searches, dead ends).
-
Store those logs somewhere (LangSmith at org scale, or even “have the agent read its own output files” at small scale).
-
Point a second agent at the first agent’s traces to spot patterns (“always searches the wrong tables,” “multi-company asks collapse to one company”) and propose fixes overnight if your eval suite is solid.
Full episode: https://youtube.com/watch?v=zLeG-XJtbIE…
TL;DR:评估(evals)是验证AI智能体是否按预期正确工作的系统化方法,核心是将“正确”的定义编码为可检查的规则(验证器),并通过在模拟的“环境”中测试以确保安全。
理解评估:从简单验证到环境模拟
什么是评估?
评估(evals)的核心目的是检查一个AI智能体(agent)所做的事情是否正确。其关键是将人类对“正确”的理解或组织的标准,编码到软件中进行自动验证。评估的复杂度因任务而异:对于狭窄、具体的任务(如“CRM中添加一条备注”),可以通过检查数据库状态(如字段是否从空变为有值)进行简单判断;而对于更开放的任务(如“起草完整的公司调研报告”),则需要更复杂的验证。
“简单模式”下的评估实践
对于刚刚开始使用评估的团队,可以从一个基础流程入手:
- 起点:从一个已经在生产或半生产环境中工作的智能体开始,例如一个与Salesforce、Gong等外部系统交互的智能体。
- 定义任务:设计能反映真实业务场景的小任务。例如:
- 撰写一封邮件。
- 更新一条客户记录。
- 在多个表格中查找关于某个人的信息。
- 构建验证器(Validator):创建能够判断任务完成正确与否的检查规则。验证器本质上需要给出一个“是”或“否”的判断。例如:
- 简单检查:一个Python函数,用于检查“已发送邮件”标签是否已被添加到人员记录中。
- 复杂检查:验证邮件草稿是否符合公司品牌指南(例如,是否包含三个段落,长度是否合规)。
为什么倾向于“是/否”的二元评分? 研究表明,如果让LLM进行1-10的评分,它容易陷入“中间值问题”(总是给出7或8分)。而二元的“是/否”判断迫使模型做出明确选择,难以含糊其辞。因此,对于难以直接自动验证的事项,将其转化为一个基于规则的检查清单(checklist)是有效方法,这需要预先投入大量人力将人类专家的知识和偏好条目化。
“困难模式”:引入“环境”(Environment)概念
随着智能体从简单的“输入-输出”对话发展到需要在真实世界中完成复杂工作,评估也需要升级。仅仅在提示-回答的层面衡量已不足够,我们需要构建更复杂的评估“环境”。
什么是环境?
环境是智能体工作的场所,是进行安全、隔离评估的“训练场”。其关键在于:
- 模拟而非生产:直接让智能体在真实的生产数据(如真实的CRM数据)上操作风险很高。因此,环境是现有工具和数据的模拟副本(digital clone)。
- 提供上下文和权限:环境需要镜像智能体在实际工作时所接触的所有资源,例如文件系统、浏览器访问权限、特定的应用程序接口(如Salesforce、Notion)以及相应的操作权限。
- 支持行为测试:在隔离的环境中,可以安全地让智能体执行各种任务(如查找联系人、添加备注、创建草稿),并观察其行为,而不会影响实际业务。
如何创建和使用环境?
创建环境本质上是构建一个与真实工作场景相似但完全隔离的测试空间:
- 镜像真实系统:分析生产系统(如Salesforce)的结构,获取其数据模式(schema),但不复制全部敏感数据。
- 填充模拟数据:在测试环境中放入模拟数据,使智能体“认为”自己在操作一个真实的CRM系统。
- 执行评估任务:让智能体在该环境中执行预设的任务(来自“简单模式”中的任务定义)。
- 运行验证器:使用预定义的验证器检查任务结果,评估智能体的表现。
这种方法确保了评估的安全性、可重复性,并允许针对特定方面(如数据查找、格式遵循)进行深度测试。
工具与实践:使用Harbor框架
构建从任务管理、环境模拟到验证器运行的全套评估体系对团队来说是项工程挑战。幸运的是,开源框架可以简化这一过程。
- Harbor框架:一个被广泛使用的开源评估框架,提供了良好的抽象层,帮助团队管理评估的关键组件:
- 任务管理:按团队或项目分类管理不同的评估任务(例如,GTM工程任务与软件工程任务)。
- 环境构建规范:提供定义和创建模拟环境的标准方法,可以轻松填充特定任务的数据或模拟数据。
- 验证器抽象:提供编写和运行验证器的通用接口,避免了从零开始构建所有逻辑。
- 社区与生态优势:
- 复用现有环境:许多常见任务(如GTM工作)已经有现成的Harbor环境模板,可以直接下载使用,加速评估启动。
- 借鉴行业实践:由于评估仍是一个快速发展的领域,采用广泛接受的框架有助于借鉴其他前沿实验室和公司的最佳实践。
- 灵活性:框架提供了高层次的抽象以方便使用,同时也允许在需要时深入底层细节进行定制。
初学者建议
对于刚开始的非工程师用户,工具生态已经大大降低了门槛。使用像Harbor这样的框架,可以通过配置而非从头编码来搭建基本的评估环境,使团队能够更专注于定义有意义的任务和验证规则本身。关键是从一个具体的、小范围的内部使用场景开始,逐步构建评估体系。
Similar Articles
Demystifying evals for AI agents
Anthropic provides a guide on designing rigorous automated evaluations for AI agents, addressing the complexities of multi-turn interactions and state modifications.
@businessbarista: Hot take: evals are the #1 thing keeping companies from becoming AI-native. If you want to understand evals, read this …
文章主张评测(evals)是企业成为 AI-native 的最大障碍,并给出了 eval-driven development 的指南:定义好的行为、对 agent 进行测试、将失败案例转化为回归测试,并介绍了 grader、case、run、trace 四个核心概念以及确定性检查、参考答案比对等四种打分方式。
@IntuitMachine: https://x.com/IntuitMachine/status/2058141021842571510
This essay argues that evaluation is the hardest problem in production AI, not generation, and decomposes AI self-knowledge into calibration, discrimination, and expression, with implications for system design.
Best patterns for evaluating AI agents?
A practitioner shares their deterministic evaluation harness for QA/coding agents — fixed corpora, injected bugs, hidden tests, and pass^k/token metrics — and asks the community how others balance smoke tests vs full benchmarks, whether LLM-as-a-judge adds value, and whether tools like Promptfoo or DeepEval reduce maintenance burden.
Everyone says write evals for your agent. But what should you actually test?
A practical guide on writing effective evaluations for AI agents, focusing on starting from observed failures and using a mix of deterministic checks and LLM judges.