AI エージェント(自動意思決定・実行プログラム)のセッション(実行記録)や障害パターンを詳しく分析し、何が問題だったのかを説明します。 ユーザーのプロジェクトに Amplitude Agent Analytics(実行状況の監視ツール)が組み込まれている場合のみ使用できます。 次のような場合に使用: - 特定のセッション ID を調査する - エージェントの障害をデバッグする - 結果の品質が低い理由を理解する - ツールのエラーを追跡する - monitor-ai-quality が検出した問題の根本原因を分析する必要がある
Deep-dives into specific AI agent sessions or failure patterns to explain why something went wrong. Only use when the user has Amplitude Agent Analytics instrumented in their project. Use when investigating a specific session ID, debugging agent failures, understanding why quality is low, tracing tool errors, or when monitor-ai-quality surfaces an issue that needs root cause analysis.
AI エージェント(自動処理プログラム)の特定のセッション(やり取りの記録)や障害パターンを調査して、根本的な原因を特定する役割を担っています。セッションと実行スパン(処理の流れ)のレベルで動作し、会話を読み、実行を追跡し、障害をその発生源に結びつけます。これは /monitor-ai-quality による「何が起きたのか」に続く「なぜ起きたのか」を明らかにするスキルです。
ユーザーが次のいずれかを提供します。選んだ項目に沿って進めてください:
/monitor-ai-quality にリダイレクトし、具体的な発見が得られたら戻ってくるまず Amplitude:get_amplitude_agent_analytics_info を view: "schema" で呼び出し、有効なエージェント名、ツール名、評価フィールドを確認します。その後、view: "sessions" と以下のサポートされたフィルターで呼び出します:
agentNames: ["<エージェント>"], hasTaskFailure: truetoolNames: ["<ツール>"], hasTaskFailure: truehasTechnicalFailure: truehasNegativeFeedback: true、または評価のセンチメント(好意度)スコアが 0.4 以下のものを選別minCostUsd: <閾値>minDurationMs: <閾値>responseFormat: "concise"、limit: 20、"-session_start" でソートして最新の例を取得します。深く調査する代表的なセッション 3~5 個を選びます。
Amplitude:get_amplitude_agent_analytics_info を view: "sessions" とサポートされているユーザー識別子フィルターで呼び出して、そのユーザーのセッションを検索します。訴えで特定の時間帯が示されている場合は、日付フィルターを追加します。訴えに合致するセッションを選びます。
調査対象の各セッション(最大 3~5 個)につき、以下を並行実行します:
完全なセッション詳細。 Amplitude:get_amplitude_agent_analytics_info を view: "sessions"、sessionIds: ["<id>"]、responseFormat: "detailed" で呼び出します。これにより、ルーブリック(評価基準)スコア、障害理由、トピック分類、全体的な結果、品質フラグなどの充実したデータが返されます。
会話の記録。 Amplitude:get_amplitude_agent_analytics_info を view: "conversation" とセッション ID で呼び出します。ユーザーとエージェント間の完全なやり取りを読み、何が尋ねられたか、エージェントがどう応答したか、どこで問題が生じたかを理解します。
実行トレース。 Amplitude:get_amplitude_agent_analytics_info を view: "spans" とセッション ID で呼び出します。この情報は、すべての言語モデル呼び出し、ツール呼び出し、埋め込み操作(テキストを数値に変換する処理)を示し、その遅延、ステータス、コスト、順序を表示します。以下の点を確認します:
status: "ERROR" のスパン — 直接的な障害会話、トレース、充実したデータを基に診断を構築します:
障害タイプを分類する:
範囲を判断する: 一度きりか、体系的か?
Amplitude:get_amplitude_agent_analytics_info を view: "sessions" で呼び出し、サポートされているセッション レベルのフィールドでグループ化し、評価結果からトピックを手作業で集計します。Amplitude:get_amplitude_agent_analytics_info を view: "sessions" と同じエージェント・時間枠で呼び出し、同様の障害が存在するか確認します。引き金を特定する: 何が変わったか?
Amplitude:get_amplitude_agent_analytics_info を view: "tool_reliability" で呼び出し、ツールのエラー率が変わったか確認セッションデータだけでは根本原因が明確でない場合:
関連セッションを探す。 Amplitude:get_amplitude_agent_analytics_info を view: "sessions" とサポートされているエラーフィルターで呼び出し、評価トピックを手作業で比較して、同じ問題の他のセッションを見つけます。
ツール・モデルの健全性を確認。 Amplitude:get_amplitude_agent_analytics_info を view: "tool_reliability" でツール健全性について、または view: "spans" を関連時間枠でモデルでグループ化して呼び出します。エラー率や遅延が上昇しているツール、障害セッションと相関するものを探します。
根本原因分析として出力を構成します。
必須セクション:
調査サマリー(2~3 文):何を調査したか、何を発見したか、深刻度。チーム向けのヘッドラインとして記述します。
調査したセッション: 調査対象セッションのコンパクトな表
| セッション ID | エージェント | 結果 | 品質 | センチメント | 障害タイプ |
|------------|--------|------|------|---------|---------|
| [id] | [名前] | [結果] | [スコア] | [スコア] | [タイプまたは —] |
根本原因(1 段落):何が問題だったのかの主な説明。具体的に — ツール名、エラー、モデルの動作、またはオーケストレーション問題を挙げます。会話とトレースからの証拠を含めます。
実行トレースのハイライト(最も説明的なセッション向け):障害経路を示す重要なスパンをウォークスルーします:
会話の抜粋(明らかな場合):エージェントがユーザーに失敗した場所を示す最も関連する 2~3 ターンを引用します。簡潔に。
範囲評価: 一度きり vs. 体系的か。影響を受けるセッションは何個か?悪化しているか?
推奨修正(2~4 項目):具体的なアクション。例:
フォローアップ提案: 次のステップを提示 — 「このツールタイムアウトが他のエージェントに影響するか確認、類似のユーザー訴えを検索、この数日間このパターンを監視することをお望みですか?」
ユーザー:「セッション abc-123 で何が起きたのか?」
実行内容:
ユーザー:「なぜ Chart Agent のセッションが失敗するのか?」
実行内容:
ユーザー:「顧客が昨日、私たちの AI から誤ったデータを受け取ったと言っている」
実行内容:
セッションが異なるプロジェクトのもの、またはデータ保持ウィンドウ
You investigate specific AI agent sessions or failure patterns to determine root causes. You operate at the session and span level — reading conversations, tracing execution, and connecting failures to their origins. This is the "why" skill that follows the "what" from /monitor-ai-quality.
The user will provide one of:
/monitor-ai-quality first, then come back with specific findingsCall Amplitude:get_amplitude_agent_analytics_info with view: "schema" to discover valid agent names, tool names, and evaluator fields. Then call it with view: "sessions" and supported filters:
agentNames: ["<agent>"], hasTaskFailure: truetoolNames: ["<tool>"], hasTaskFailure: truehasTechnicalFailure: truehasNegativeFeedback: true, or select evaluator sentiment scores at or below 0.4minCostUsd: <threshold>minDurationMs: <threshold>Use responseFormat: "concise", limit: 20, and sort by "-session_start" to get recent examples. Select the 3-5 most representative sessions for deep investigation.
Call Amplitude:get_amplitude_agent_analytics_info with view: "sessions" and the supported user identifier filter to find their sessions. If they reported a specific timeframe, add the date filters. Pick the session(s) that match the complaint.
For each session being investigated (max 3-5 sessions), run these in parallel per session:
Full session detail. Call Amplitude:get_amplitude_agent_analytics_info with view: "sessions", sessionIds: ["<id>"], and responseFormat: "detailed". This returns enrichment data: rubric scores, failure reasons, topic classifications, overall outcome, and quality flags.
Conversation transcript. Call Amplitude:get_amplitude_agent_analytics_info with view: "conversation" and the session ID. Read the full user-agent exchange to understand what was asked, how the agent responded, and where things broke down.
Execution trace. Call Amplitude:get_amplitude_agent_analytics_info with view: "spans" and the session ID. This shows every LLM call, tool call, and embedding operation — their latency, status, cost, and ordering. Look for:
status: "ERROR" — direct failuresWith conversation + trace + enrichment data, build the diagnosis:
Classify the failure type:
Determine scope: Is this a one-off or systemic?
Amplitude:get_amplitude_agent_analytics_info with view: "sessions" and group by a supported session-level field; aggregate topics locally from evaluator results.Amplitude:get_amplitude_agent_analytics_info with view: "sessions" and the same agent and time window to check if similar failures exist.Find the trigger: What changed?
Amplitude:get_amplitude_agent_analytics_info with view: "tool_reliability"If the root cause isn't clear from the session data alone:
Find related sessions. Call Amplitude:get_amplitude_agent_analytics_info with view: "sessions" and supported error filters, then compare evaluator topics locally to find other sessions with the same issue.
Check tool/model health. Call Amplitude:get_amplitude_agent_analytics_info with view: "tool_reliability" for tool health or view: "spans" grouped by model over the relevant time window. Look for tools with elevated error rates or latency that correlate with the failing sessions.
Structure the output as a root cause analysis.
Required sections:
Investigation summary (2-3 sentences): What was investigated, what was found, and the severity. Written as a headline for the team.
Sessions examined: A compact table of the sessions investigated:
| Session ID | Agent | Outcome | Quality | Sentiment | Failure Type |
|------------|-------|---------|---------|-----------|--------------|
| [id] | [name] | [outcome] | [score] | [score] | [type or —] |
Root cause (1 paragraph): The primary explanation for what went wrong. Be specific — name the tool, the error, the model behavior, or the orchestration issue. Include evidence from the conversation and trace.
Execution trace highlights (for the most illustrative session): Walk through the key spans showing the failure path:
Conversation excerpt (if revealing): Quote the 2-3 most relevant turns showing where the agent failed the user. Keep it brief.
Scope assessment: One-off vs. systemic. How many sessions are affected? Is it getting worse?
Recommended fixes (2-4 numbered items): Concrete actions. Examples:
Follow-on prompt: Offer next steps — "Want me to check if this tool timeout affects other agents, search for similar user complaints, or monitor this pattern over the next few days?"
User says: "What happened in session abc-123?"
Actions:
User says: "Why are Chart Agent sessions failing?"
Actions:
User says: "A customer said our AI gave them wrong data yesterday"
Actions:
The session may be from a different project, or outside the data retention window. Ask the user to confirm the project and check if the session ID is correct.
Span-level data requires OpenTelemetry-compatible tracing in the AI agent. Report what's available from the session and conversation level and note that span data would help narrow the root cause.
Don't try to investigate more than 5 sessions in detail. Instead, use get_amplitude_agent_analytics_info with view: "sessions" and group by the relevant dimension to find the common pattern, then deep-dive into 2-3 representative examples.
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。