agents-optimize
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseoptimize
优化
Measure and improve your AgentCore agent's quality through evaluation, monitoring, and observability.
通过评估、监控和可观测性来衡量并提升你的AgentCore agent的质量。
When to use
使用场景
- You want to know if your agent is giving good answers
- You want to set up continuous quality monitoring in production
- You want to add a quality gate to your CI/CD pipeline
- You want to understand agent behavior through logs, metrics, and traces
- You want to set up CloudWatch dashboards or X-Ray tracing
Do NOT use for:
- Debugging a specific broken agent (wrong answers, errors) → use
agents-debug - Production security hardening (IAM, auth) → use
agents-harden
- 你想了解你的agent是否能给出优质回答
- 你想在生产环境中设置持续质量监控
- 你想为CI/CD流水线添加质量门
- 你想通过日志、指标和追踪来了解agent的行为
- 你想设置CloudWatch仪表板或X-Ray追踪
请勿用于:
- 调试特定故障的agent(错误回答、报错)→ 使用
agents-debug - 生产环境安全加固(IAM、认证)→ 使用
agents-harden
Input
输入
$ARGUMENTS- An eval goal: "add a quality gate", "set up monitoring"
- An observability goal: "set up CloudWatch dashboard", "understand my traces"
- A specific evaluator: "llm-as-a-judge", "code-based"
- Empty — the skill will guide based on project context
$ARGUMENTS- 评估目标:"add a quality gate"、"set up monitoring"
- 可观测性目标:"set up CloudWatch dashboard"、"understand my traces"
- 特定评估器:"llm-as-a-judge"、"code-based"
- 空值——本技能会根据项目上下文提供引导
Process
流程
Step 0: Verify CLI version
步骤0:验证CLI版本
Run . This skill requires v0.9.0 or later.
agentcore --version运行。本技能需要v0.9.0或更高版本。
agentcore --versionStep 1: Read project context
步骤1:读取项目上下文
Read to understand existing evaluators, online eval configs, and agent setup.
agentcore/agentcore.jsonIf is not found:
agentcore/agentcore.json"This skill requires an AgentCore project. Useto create one."agents-get-started
读取以了解现有的评估器、在线评估配置和agent设置。
agentcore/agentcore.json如果未找到:
agentcore/agentcore.json"本技能需要AgentCore项目。请使用创建一个。"agents-get-started
Step 2: Determine the workflow
步骤2:确定工作流
| Developer intent | Action |
|---|---|
| Measure quality, add evaluator, run eval, CI/CD gate, online monitoring | Load |
| Set up observability, CloudWatch, X-Ray, logs, metrics, dashboards | Load |
| Understand or reduce AgentCore costs | Load |
| Both — "I want to understand and improve my agent" | Start with observability setup, then add evals |
| 开发者意图 | 操作 |
|---|---|
| 衡量质量、添加评估器、运行评估、CI/CD质量门、在线监控 | 加载 |
| 设置可观测性、CloudWatch、X-Ray、日志、指标、仪表板 | 加载 |
| 了解或降低AgentCore成本 | 加载 |
| 两者兼顾——"我想了解并优化我的agent" | 先设置可观测性,再添加评估器 |
Step 3: Follow the loaded reference
步骤3:遵循加载的参考文档
The reference file contains the full procedure. Follow it step by step.
参考文档包含完整的操作步骤,请逐步执行。
Cross-references
交叉参考
- After setting up evals, suggest for production readiness
agents-harden - If eval results reveal agent issues, suggest for root cause analysis
agents-debug - If the developer needs to add capabilities first, suggest
agents-build
- 设置评估器后,建议使用确保生产环境就绪
agents-harden - 如果评估结果显示agent存在问题,建议使用进行根因分析
agents-debug - 如果开发者需要先添加功能,建议使用
agents-build
Output
输出
Depends on the workflow — see the loaded reference for specific outputs.
取决于工作流——请查看加载的参考文档获取具体输出。
Quality criteria
质量标准
- Evaluator configuration uses only valid CLI flags
- Online eval sampling rate is appropriate (not 100% in production without discussion)
- CI/CD quality gate has a clear pass/fail threshold
- Observability setup includes both tracing and logging
- The developer understands the eval data delay: ~10 seconds put-to-get, end-to-end — one ingestion step covers both trace reads and eval queries; there is no separate indexing wait
- 评估器配置仅使用有效的CLI参数
- 在线评估采样率合理(生产环境中未讨论的情况下不设为100%)
- CI/CD质量门有明确的通过/失败阈值
- 可观测性设置同时包含追踪和日志
- 开发者了解评估数据延迟:端到端约10秒的写入到读取延迟——一次 ingestion 步骤同时覆盖追踪读取和评估查询;无需单独等待索引完成