agents-optimize

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

optimize

优化

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
can be:
  • 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
agentcore --version
. This skill requires v0.9.0 or later.
运行
agentcore --version
。本技能需要v0.9.0或更高版本。

Step 1: Read project context

步骤1:读取项目上下文

Read
agentcore/agentcore.json
to understand existing evaluators, online eval configs, and agent setup.
If
agentcore/agentcore.json
is not found:
"This skill requires an AgentCore project. Use
agents-get-started
to create one."
读取
agentcore/agentcore.json
以了解现有的评估器、在线评估配置和agent设置。
如果未找到
agentcore/agentcore.json
"本技能需要AgentCore项目。请使用
agents-get-started
创建一个。"

Step 2: Determine the workflow

步骤2:确定工作流

Developer intentAction
Measure quality, add evaluator, run eval, CI/CD gate, online monitoringLoad
references/evals.md
and follow its workflow
Set up observability, CloudWatch, X-Ray, logs, metrics, dashboardsLoad
references/observability.md
and follow its workflow
Understand or reduce AgentCore costsLoad
references/cost.md
Both — "I want to understand and improve my agent"Start with observability setup, then add evals
开发者意图操作
衡量质量、添加评估器、运行评估、CI/CD质量门、在线监控加载
references/evals.md
并遵循其工作流
设置可观测性、CloudWatch、X-Ray、日志、指标、仪表板加载
references/observability.md
并遵循其工作流
了解或降低AgentCore成本加载
references/cost.md
两者兼顾——"我想了解并优化我的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
    agents-harden
    for production readiness
  • If eval results reveal agent issues, suggest
    agents-debug
    for root cause analysis
  • 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 步骤同时覆盖追踪读取和评估查询;无需单独等待索引完成