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エージェント(AI自動応答システム)セッションや障害パターンを調査して、根本原因を特定します。セッションおよびスパン(処理の実行単位)レベルで動作し、会話の内容を読み取り、実行経路を追跡し、障害の発生源を特定します。これは /monitor-ai-quality が提供する「何が起きたのか」に対する「なぜ起きたのか」を明らかにするスキルです。
ユーザーから以下のいずれかが提供されます:
/monitor-ai-quality にリダイレクトし、その結果を持ってから戻るAmplitude:get_amplitude_agent_analytics_info を view: "schema" で呼び出し、有効なエージェント名、ツール名、評価フィールドを確認します。その後、view: "sessions" で呼び出し、以下のフィルタを使用します:
agentNames: ["<agent>"], hasTaskFailure: truetoolNames: ["<tool>"], 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とともに呼び出します。全てのLLM呼び出し、ツール呼び出し、埋め込み処理(テキスト変換処理)を表示し、それぞれの応答時間、ステータス、コスト、順序を確認します。以下に注目します:
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ターンを引用します。簡潔に。
影響範囲評価: 単発か根深い問題か。どのくらいのセッションが影響を受けているか。悪化しているか。
推奨修正(2~4項目):具体的なアクション。例:
後続ステップの提案: 次のアクション — 「このツールのタイムアウトが他のエージェントに影響しているか確認、同様のユーザー苦情を検索、または今後数日間このパターンを監視しますか?」
ユーザーが言った場合:「セッション abc-123 では何が起きたのか?」
アクション:
ユーザーが言った場合:「なぜChart Agentのセッションが失敗しているのか?」
アクション:
ユーザーが言った場合:「顧客がAIから間違ったデータをもらったと言っています(昨日)」
アクション:
セッションが別のプロジェクトからのものか、データ保持期間外の可能性があります。ユーザーにプロジェクトを確認させ、セッションIDが正しいか確認させます。
スパンレベルのデータは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 による自動翻訳です。