> ## Documentation Index
> Fetch the complete documentation index at: https://agent-compass.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Analyzers

> 配置和运行 AgentCompass 后置分析。

Analyzers 是 AgentCompass 的后置分析层。任务产生 `RunResult` 后，analyzer 会检查 trajectory、metrics、error、latency、模型输出和工具调用，并把结果写入每个 attempt 的 `analysis_result.<AnalyzerId>`，再聚合成 `analysis_summary.json` / `analysis_summary.md`。

<CardGroup cols={2}>
  <Card title="Badcase 检测" icon="badge-alert">识别异常、截断、JSON 错误、重复、延迟、终端误用等问题。</Card>
  <Card title="统计指标" icon="chart-no-axes-combined">统计 step 数、tool call 数、耗时、token 长度和 value-count 分布。</Card>
  <Card title="定性分析" icon="sparkles">用 LLM-backed analyzer 标注轨迹阶段、总结行为并生成 segment graph 报告。</Card>
  <Card title="组件注册表" icon="list">`agentcompass list analyzer` 会在终端输出 analyzer 列表，`agentcompass list dump` 会导出到 `agentcompass_components.md`。</Card>
</CardGroup>

## 随评测运行

```bash theme={null}
agentcompass run \
  terminal_bench_2 \
  terminus2 \
  your-model \
  --env <env-provider> \
  --benchmark-params '{"sample_ids":["git-leak-recovery"]}' \
  --model-base-url "$MODEL_BASE_URL" \
  --model-api-key "$MODEL_API_KEY" \
  --model-api-protocol openai-chat \
  --enable-analysis \
  --analysis-params '{"analyzers":["ExceptionAnalyzer","TruncationAnalyzer"]}'
```

## 对已有结果重新分析

```bash theme={null}
agentcompass analysis \
  --input results/terminal_bench_2/your-model/20260703_120000 \
  --analysis-params '{
    "analyzers": ["ExceptionAnalyzer", "QualitativeAnalyzer"],
    "QualitativeAnalyzer": {"render_mode": "file"}
  }' \
  --task_concurrency 8
```

默认情况下，`analysis` 会复制输入 run 到一个新的 timestamp sibling。使用 `--output` 指定复制目标，或使用 `--override` 原地覆盖。

## 选择规则

| 字段                  | 含义                                      |
| ------------------- | --------------------------------------- |
| `analyzers`         | 白名单；设置后只考虑这些 analyzer。                  |
| `exclude_analyzers` | 黑名单；即使兼容也会跳过。                           |
| `<AnalyzerId>`      | 单个 analyzer 的参数，例如阈值、qualitative 模型配置等。 |

当前 `agentcompass list analyzer` 输出包含 25 个 analyzer，覆盖基础统计、异常检测、效率分析、行为模式检测、reward-hacking 检测和 qualitative 分析。
