@botpress/adk 1.19.0-beta.2 → 1.19.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-init/agent-project-generator.d.ts +1 -1
- package/dist/agent-init/agent-project-generator.d.ts.map +1 -1
- package/dist/agent0/capabilities/commands/adk-build.md +39 -0
- package/dist/agent0/capabilities/commands/adk-debug.md +23 -0
- package/dist/agent0/capabilities/commands/adk-dev-console.md +17 -0
- package/dist/agent0/capabilities/commands/adk-document.md +68 -0
- package/dist/agent0/capabilities/commands/adk-eval.md +17 -0
- package/dist/agent0/capabilities/commands/adk-explain.md +22 -0
- package/dist/agent0/capabilities/commands/adk-init.md +30 -0
- package/dist/agent0/capabilities/commands/adk-ship.md +29 -0
- package/dist/agent0/capabilities/commands/adk-test.md +27 -0
- package/dist/agent0/capabilities/commands/adk-validate.md +31 -0
- package/dist/agent0/capabilities/skills/adk/SKILL.md +548 -0
- package/dist/agent0/capabilities/skills/adk/references/actions.md +823 -0
- package/dist/agent0/capabilities/skills/adk/references/advanced-patterns.md +669 -0
- package/dist/agent0/capabilities/skills/adk/references/agent-config.md +450 -0
- package/dist/agent0/capabilities/skills/adk/references/assets.md +237 -0
- package/dist/agent0/capabilities/skills/adk/references/autonomous-execution.md +747 -0
- package/dist/agent0/capabilities/skills/adk/references/cli.md +1334 -0
- package/dist/agent0/capabilities/skills/adk/references/context-api.md +461 -0
- package/dist/agent0/capabilities/skills/adk/references/conversation-lifecycle.md +311 -0
- package/dist/agent0/capabilities/skills/adk/references/conversations.md +1111 -0
- package/dist/agent0/capabilities/skills/adk/references/custom-components.md +167 -0
- package/dist/agent0/capabilities/skills/adk/references/desk.md +852 -0
- package/dist/agent0/capabilities/skills/adk/references/evals.md +11 -0
- package/dist/agent0/capabilities/skills/adk/references/explain-config.md +424 -0
- package/dist/agent0/capabilities/skills/adk/references/files.md +918 -0
- package/dist/agent0/capabilities/skills/adk/references/integration-actions.md +659 -0
- package/dist/agent0/capabilities/skills/adk/references/integrations.md +266 -0
- package/dist/agent0/capabilities/skills/adk/references/interfaces.md +97 -0
- package/dist/agent0/capabilities/skills/adk/references/knowledge-bases.md +456 -0
- package/dist/agent0/capabilities/skills/adk/references/mcp-server.md +112 -0
- package/dist/agent0/capabilities/skills/adk/references/messages.md +769 -0
- package/dist/agent0/capabilities/skills/adk/references/model-configuration.md +201 -0
- package/dist/agent0/capabilities/skills/adk/references/patterns-mistakes.md +469 -0
- package/dist/agent0/capabilities/skills/adk/references/plugins.md +280 -0
- package/dist/agent0/capabilities/skills/adk/references/tables.md +1136 -0
- package/dist/agent0/capabilities/skills/adk/references/tags.md +516 -0
- package/dist/agent0/capabilities/skills/adk/references/tools.md +581 -0
- package/dist/agent0/capabilities/skills/adk/references/triggers.md +719 -0
- package/dist/agent0/capabilities/skills/adk/references/workflow-steps.md +851 -0
- package/dist/agent0/capabilities/skills/adk/references/workflows.md +1408 -0
- package/dist/agent0/capabilities/skills/adk/references/zai-agent-reference.md +454 -0
- package/dist/agent0/capabilities/skills/adk/references/zai-complete-guide.md +1408 -0
- package/dist/agent0/capabilities/skills/adk-debugger/SKILL.md +257 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/common-failures.md +231 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/conversation-analysis.md +420 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/debug-workflow.md +239 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/llm-debugging.md +209 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/trace-summarization.md +313 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/traces-and-logs.md +203 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/SKILL.md +111 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/agent-steps.md +115 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/component-registry.md +43 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/multi-agent-dashboard.md +70 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/pages.md +273 -0
- package/dist/agent0/capabilities/skills/adk-docs/SKILL.md +114 -0
- package/dist/agent0/capabilities/skills/adk-docs/references/doc-standards.md +124 -0
- package/dist/agent0/capabilities/skills/adk-evals/SKILL.md +244 -0
- package/dist/agent0/capabilities/skills/adk-evals/references/eval-format.md +354 -0
- package/dist/agent0/capabilities/skills/adk-evals/references/test-patterns.md +355 -0
- package/dist/agent0/capabilities/skills/adk-evals/references/testing-workflow.md +225 -0
- package/dist/agent0/config/index.d.ts +5 -0
- package/dist/agent0/config/index.d.ts.map +1 -0
- package/dist/agent0/config/paths.d.ts +12 -0
- package/dist/agent0/config/paths.d.ts.map +1 -0
- package/dist/agent0/config/schema.d.ts +171 -0
- package/dist/agent0/config/schema.d.ts.map +1 -0
- package/dist/agent0/config/secrets.d.ts +4 -0
- package/dist/agent0/config/secrets.d.ts.map +1 -0
- package/dist/agent0/config/store.d.ts +21 -0
- package/dist/agent0/config/store.d.ts.map +1 -0
- package/dist/agent0/index.d.ts +6 -0
- package/dist/agent0/index.d.ts.map +1 -0
- package/dist/agent0/index.js +3226 -0
- package/dist/agent0/index.js.map +27 -0
- package/dist/agent0/providers/catalog.d.ts +189 -0
- package/dist/agent0/providers/catalog.d.ts.map +1 -0
- package/dist/agent0/providers/index.d.ts +4 -0
- package/dist/agent0/providers/index.d.ts.map +1 -0
- package/dist/agent0/providers/registry.d.ts +32 -0
- package/dist/agent0/providers/registry.d.ts.map +1 -0
- package/dist/agent0/providers/source.d.ts +100 -0
- package/dist/agent0/providers/source.d.ts.map +1 -0
- package/dist/agent0/runtime/client.d.ts +50 -0
- package/dist/agent0/runtime/client.d.ts.map +1 -0
- package/dist/agent0/runtime/engine.d.ts +74 -0
- package/dist/agent0/runtime/engine.d.ts.map +1 -0
- package/dist/agent0/runtime/index.d.ts +7 -0
- package/dist/agent0/runtime/index.d.ts.map +1 -0
- package/dist/agent0/runtime/manager.d.ts +82 -0
- package/dist/agent0/runtime/manager.d.ts.map +1 -0
- package/dist/agent0/runtime/permissions.d.ts +9 -0
- package/dist/agent0/runtime/permissions.d.ts.map +1 -0
- package/dist/agent0/runtime/process.d.ts +43 -0
- package/dist/agent0/runtime/process.d.ts.map +1 -0
- package/dist/agent0/runtime/project-discovery.d.ts +5 -0
- package/dist/agent0/runtime/project-discovery.d.ts.map +1 -0
- package/dist/agent0/types.d.ts +447 -0
- package/dist/agent0/types.d.ts.map +1 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/cognitive/models.d.ts +32 -0
- package/dist/cognitive/models.d.ts.map +1 -0
- package/dist/commands/bp-dev-command.d.ts.map +1 -1
- package/dist/commands/bp-dev-stderr.d.ts +21 -0
- package/dist/commands/bp-dev-stderr.d.ts.map +1 -0
- package/dist/commands/index.d.ts +0 -5
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/dependencies/dependency-manager.d.ts +0 -1
- package/dist/dependencies/dependency-manager.d.ts.map +1 -1
- package/dist/dependencies/errors.d.ts +1 -1
- package/dist/dependencies/errors.d.ts.map +1 -1
- package/dist/dependencies/index.d.ts +0 -2
- package/dist/dependencies/index.d.ts.map +1 -1
- package/dist/dependencies/index.js +125 -149
- package/dist/dependencies/index.js.map +11 -13
- package/dist/dependencies/migration.d.ts +0 -2
- package/dist/dependencies/migration.d.ts.map +1 -1
- package/dist/dependencies/resolvers/integration-resolver.d.ts +0 -1
- package/dist/dependencies/resolvers/integration-resolver.d.ts.map +1 -1
- package/dist/dependencies/resolvers/plugin-resolver.d.ts +0 -1
- package/dist/dependencies/resolvers/plugin-resolver.d.ts.map +1 -1
- package/dist/dependencies/types.d.ts +1 -2
- package/dist/dependencies/types.d.ts.map +1 -1
- package/dist/generators/tests.d.ts.map +1 -1
- package/dist/index.js +501 -998
- package/dist/index.js.map +16 -20
- package/dist/runner/script-runner.d.ts.map +1 -1
- package/dist/runner/supervise-child.d.ts +24 -0
- package/dist/runner/supervise-child.d.ts.map +1 -0
- package/dist/templates/blank/package.json +0 -1
- package/dist/templates/template.config.json +10 -9
- package/package.json +12 -8
- package/dist/commands/copilot-config-reader.d.ts +0 -3
- package/dist/commands/copilot-config-reader.d.ts.map +0 -1
- package/dist/commands/copilot-config.d.ts +0 -42
- package/dist/commands/copilot-config.d.ts.map +0 -1
- package/dist/commands/copilot-server.d.ts +0 -29
- package/dist/commands/copilot-server.d.ts.map +0 -1
- package/dist/commands/opencode-config.d.ts +0 -30
- package/dist/commands/opencode-config.d.ts.map +0 -1
- package/dist/dependencies/env-substitution.d.ts +0 -3
- package/dist/dependencies/env-substitution.d.ts.map +0 -1
- package/dist/dependencies/secrets-rewriter.d.ts +0 -25
- package/dist/dependencies/secrets-rewriter.d.ts.map +0 -1
- package/dist/templates/blank/dependencies.dev.lock.json +0 -6
- package/dist/templates/botpress-desk/dependencies.dev.lock.json +0 -6
- package/dist/templates/crm-enrichment/dependencies.dev.lock.json +0 -6
- package/dist/templates/hello-world/dependencies.dev.lock.json +0 -6
- package/dist/templates/knowledge-assistant/dependencies.dev.lock.json +0 -6
- package/dist/templates/slack-triage/dependencies.dev.lock.json +0 -6
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
# Conversation Analysis
|
|
2
|
+
|
|
3
|
+
How to summarize and explain full conversations using the `adk conversations` command. A conversation spans multiple turns (traces), so this is a higher-level view than single-trace analysis.
|
|
4
|
+
|
|
5
|
+
For single-trace summaries, see `trace-summarization.md`. This document covers multi-turn conversation-level analysis.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## CLI Commands
|
|
10
|
+
|
|
11
|
+
### List recent conversations
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
adk conversations --format json
|
|
15
|
+
adk conversations list limit=5 --format json
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Output** (JSON): Array of objects, each with:
|
|
19
|
+
|
|
20
|
+
| Field | Type | Description |
|
|
21
|
+
|-------|------|-------------|
|
|
22
|
+
| `conversationId` | string | Unique conversation identifier |
|
|
23
|
+
| `firstSeen` | string | ISO timestamp of the first recorded turn |
|
|
24
|
+
| `lastSeen` | string | ISO timestamp of the most recent turn |
|
|
25
|
+
| `traceCount` | number | Total number of turns in the conversation |
|
|
26
|
+
| `integration` | string | Which integration the conversation came from (e.g., `slack`, `webchat`) |
|
|
27
|
+
| `channel` | string | Which channel within the integration (e.g., `dm`, `thread`) |
|
|
28
|
+
| `hasErrors` | boolean | Whether any turn in the conversation had errors |
|
|
29
|
+
|
|
30
|
+
### Show a conversation's timeline
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Standard view
|
|
34
|
+
adk conversations show <conversation-id> --format json
|
|
35
|
+
|
|
36
|
+
# With LLM reasoning included
|
|
37
|
+
adk conversations show <conversation-id> --include-llm --format json
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Output** (JSON): Object with:
|
|
41
|
+
|
|
42
|
+
| Field | Type | Description |
|
|
43
|
+
|-------|------|-------------|
|
|
44
|
+
| `conversationId` | string | The conversation ID |
|
|
45
|
+
| `turnCount` | number | Total number of turns |
|
|
46
|
+
| `turns` | array | Ordered list of turn objects |
|
|
47
|
+
|
|
48
|
+
Each turn object contains:
|
|
49
|
+
|
|
50
|
+
| Field | Type | Description |
|
|
51
|
+
|-------|------|-------------|
|
|
52
|
+
| `traceId` | string | Trace ID for this turn (use for drill-down) |
|
|
53
|
+
| `startedAt` | string | ISO timestamp when the turn started |
|
|
54
|
+
| `duration` | string | How long the turn took (e.g., `"2.3s"`) |
|
|
55
|
+
| `status` | string | `"ok"` or `"error"` |
|
|
56
|
+
| `trigger` | string | What started this turn (e.g., user message, event, workflow) |
|
|
57
|
+
| `toolCalls` | array | Tools invoked during this turn |
|
|
58
|
+
| `errors` | array | Error strings, if any |
|
|
59
|
+
| `llmContent` | array | LLM reasoning data (only with `--include-llm`) |
|
|
60
|
+
|
|
61
|
+
Each `toolCalls` entry has: `name`, `status`, `duration`, `error?`
|
|
62
|
+
|
|
63
|
+
Each `llmContent` entry has: `name`, `data`
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Two Modes of Analysis
|
|
68
|
+
|
|
69
|
+
### 1. Summarize a Conversation
|
|
70
|
+
|
|
71
|
+
**Purpose:** Give a concise overview of what happened -- a paragraph or two covering the full conversation arc.
|
|
72
|
+
|
|
73
|
+
**When to use:** The developer asks "What happened in this conversation?", "Summarize conversation X", or wants a quick picture before diving deeper.
|
|
74
|
+
|
|
75
|
+
**Data source:**
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
adk conversations show <conversation-id> --format json
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
No need for `--include-llm` -- the standard view has enough for a summary.
|
|
82
|
+
|
|
83
|
+
**What to cover:**
|
|
84
|
+
|
|
85
|
+
1. **Who and where** -- integration, channel, how many turns, time span
|
|
86
|
+
2. **The flow** -- what the user asked for, what the agent did, how the conversation progressed
|
|
87
|
+
3. **Tools used** -- which tools were called and how often
|
|
88
|
+
4. **Outcome** -- did the conversation succeed? Were there errors? How did it end?
|
|
89
|
+
5. **Red flags** -- only if present: errors, long durations, many turns for a simple task
|
|
90
|
+
|
|
91
|
+
**How to write it:**
|
|
92
|
+
|
|
93
|
+
Write a natural-language paragraph, not a list or template. Synthesize the turn data into a narrative.
|
|
94
|
+
|
|
95
|
+
#### Example
|
|
96
|
+
|
|
97
|
+
Given this conversation data:
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"conversationId": "conv_abc123",
|
|
102
|
+
"turnCount": 4,
|
|
103
|
+
"turns": [
|
|
104
|
+
{
|
|
105
|
+
"traceId": "tr_001",
|
|
106
|
+
"startedAt": "2026-04-21T14:00:00.000Z",
|
|
107
|
+
"duration": "1.8s",
|
|
108
|
+
"status": "ok",
|
|
109
|
+
"trigger": "User message via slack/dm",
|
|
110
|
+
"toolCalls": [],
|
|
111
|
+
"errors": []
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"traceId": "tr_002",
|
|
115
|
+
"startedAt": "2026-04-21T14:00:05.000Z",
|
|
116
|
+
"duration": "3.2s",
|
|
117
|
+
"status": "ok",
|
|
118
|
+
"trigger": "User message via slack/dm",
|
|
119
|
+
"toolCalls": [
|
|
120
|
+
{ "name": "lookupOrder", "status": "ok", "duration": "0.9s" }
|
|
121
|
+
],
|
|
122
|
+
"errors": []
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"traceId": "tr_003",
|
|
126
|
+
"startedAt": "2026-04-21T14:00:15.000Z",
|
|
127
|
+
"duration": "4.1s",
|
|
128
|
+
"status": "error",
|
|
129
|
+
"trigger": "User message via slack/dm",
|
|
130
|
+
"toolCalls": [
|
|
131
|
+
{ "name": "cancelOrder", "status": "error", "duration": "1.2s", "error": "Cannot cancel shipped order" }
|
|
132
|
+
],
|
|
133
|
+
"errors": ["Cannot cancel shipped order"]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"traceId": "tr_004",
|
|
137
|
+
"startedAt": "2026-04-21T14:00:25.000Z",
|
|
138
|
+
"duration": "2.0s",
|
|
139
|
+
"status": "ok",
|
|
140
|
+
"trigger": "User message via slack/dm",
|
|
141
|
+
"toolCalls": [],
|
|
142
|
+
"errors": []
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Good summary:**
|
|
149
|
+
|
|
150
|
+
> A 4-turn Slack DM conversation over about 30 seconds. The user started with a greeting, then asked about an order -- the agent looked it up with `lookupOrder`. The user then asked to cancel the order, but `cancelOrder` failed because the order was already shipped. The agent recovered in the final turn without needing more tools, likely explaining the situation to the user. One error occurred (`cancelOrder` failure) but it was handled gracefully.
|
|
151
|
+
|
|
152
|
+
**Bad summary:**
|
|
153
|
+
|
|
154
|
+
> Turn 1: traceId tr_001, status ok, no tools. Turn 2: traceId tr_002, called lookupOrder, status ok. Turn 3: traceId tr_003, called cancelOrder, status error, error "Cannot cancel shipped order". Turn 4: traceId tr_004, status ok, no tools.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
### 2. Explain a Conversation
|
|
159
|
+
|
|
160
|
+
**Purpose:** Provide a detailed, step-by-step breakdown where the developer understands every decision the agent made.
|
|
161
|
+
|
|
162
|
+
**When to use:** The developer asks "Walk me through this conversation", "Explain what happened", "Why did the bot respond that way?", or is investigating a specific behavior.
|
|
163
|
+
|
|
164
|
+
**Data source:**
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
adk conversations show <conversation-id> --include-llm --format json
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Always use `--include-llm`** for explanations. Without it, you lose the LLM's reasoning, which is essential for explaining *why* the agent did what it did.
|
|
171
|
+
|
|
172
|
+
**What to cover for each turn:**
|
|
173
|
+
|
|
174
|
+
1. **The trigger** -- what started this turn (user message, event, workflow continuation)
|
|
175
|
+
2. **LLM reasoning** -- what the agent decided to do and why (from `llmContent`)
|
|
176
|
+
3. **Tool calls** -- what was called, with what inputs, what happened
|
|
177
|
+
4. **Errors** -- what went wrong and how the agent responded
|
|
178
|
+
5. **The response** -- what the agent said back (infer from context if not explicit)
|
|
179
|
+
6. **Transitions** -- how one turn's outcome led to the next
|
|
180
|
+
|
|
181
|
+
**How to write it:**
|
|
182
|
+
|
|
183
|
+
Walk through turns chronologically. For each turn, narrate what happened as a coherent paragraph. Use tool names in backticks, quote key values, and explain the agent's reasoning when `llmContent` provides it.
|
|
184
|
+
|
|
185
|
+
#### Example
|
|
186
|
+
|
|
187
|
+
Given the same conversation with `--include-llm`:
|
|
188
|
+
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"conversationId": "conv_abc123",
|
|
192
|
+
"turnCount": 4,
|
|
193
|
+
"turns": [
|
|
194
|
+
{
|
|
195
|
+
"traceId": "tr_001",
|
|
196
|
+
"startedAt": "2026-04-21T14:00:00.000Z",
|
|
197
|
+
"duration": "1.8s",
|
|
198
|
+
"status": "ok",
|
|
199
|
+
"trigger": "User message via slack/dm",
|
|
200
|
+
"toolCalls": [],
|
|
201
|
+
"errors": [],
|
|
202
|
+
"llmContent": [
|
|
203
|
+
{ "name": "cognitive.iteration", "data": "The user said 'Hi, I need help with an order'. This is a greeting with intent to discuss an order. I'll respond and ask for the order number." }
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"traceId": "tr_002",
|
|
208
|
+
"startedAt": "2026-04-21T14:00:05.000Z",
|
|
209
|
+
"duration": "3.2s",
|
|
210
|
+
"status": "ok",
|
|
211
|
+
"trigger": "User message via slack/dm",
|
|
212
|
+
"toolCalls": [
|
|
213
|
+
{ "name": "lookupOrder", "status": "ok", "duration": "0.9s" }
|
|
214
|
+
],
|
|
215
|
+
"errors": [],
|
|
216
|
+
"llmContent": [
|
|
217
|
+
{ "name": "cognitive.iteration", "data": "The user provided order number #4521. I should look this up to get the details before responding." }
|
|
218
|
+
]
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"traceId": "tr_003",
|
|
222
|
+
"startedAt": "2026-04-21T14:00:15.000Z",
|
|
223
|
+
"duration": "4.1s",
|
|
224
|
+
"status": "error",
|
|
225
|
+
"trigger": "User message via slack/dm",
|
|
226
|
+
"toolCalls": [
|
|
227
|
+
{ "name": "cancelOrder", "status": "error", "duration": "1.2s", "error": "Cannot cancel shipped order" }
|
|
228
|
+
],
|
|
229
|
+
"errors": ["Cannot cancel shipped order"],
|
|
230
|
+
"llmContent": [
|
|
231
|
+
{ "name": "cognitive.iteration", "data": "The user wants to cancel order #4521. I'll use cancelOrder." },
|
|
232
|
+
{ "name": "cognitive.iteration", "data": "cancelOrder failed -- the order is already shipped. I need to tell the user and suggest a return instead." }
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"traceId": "tr_004",
|
|
237
|
+
"startedAt": "2026-04-21T14:00:25.000Z",
|
|
238
|
+
"duration": "2.0s",
|
|
239
|
+
"status": "ok",
|
|
240
|
+
"trigger": "User message via slack/dm",
|
|
241
|
+
"toolCalls": [],
|
|
242
|
+
"errors": [],
|
|
243
|
+
"llmContent": [
|
|
244
|
+
{ "name": "cognitive.iteration", "data": "The user asked how to start a return. I know the process from the instructions -- they need to go to the returns portal. No tool call needed." }
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Good explanation:**
|
|
252
|
+
|
|
253
|
+
> **Turn 1** (tr_001, 1.8s): The user opened the conversation in Slack DM with "Hi, I need help with an order." The agent recognized this as a greeting with order-related intent and responded by asking for the order number. No tools were needed.
|
|
254
|
+
>
|
|
255
|
+
> **Turn 2** (tr_002, 3.2s): The user provided order #4521. The agent called `lookupOrder` to retrieve the order details (completed in 0.9s). The lookup succeeded and the agent relayed the order information to the user.
|
|
256
|
+
>
|
|
257
|
+
> **Turn 3** (tr_003, 4.1s): The user asked to cancel the order. The agent called `cancelOrder`, which failed with "Cannot cancel shipped order" -- the order had already shipped. The agent's reasoning shows it recognized the failure and decided to suggest a return as an alternative. The turn is marked as `error` because of the tool failure, but the agent handled it gracefully.
|
|
258
|
+
>
|
|
259
|
+
> **Turn 4** (tr_004, 2.0s): The user asked how to start a return. The agent answered from its instructions without needing any tool calls, directing the user to the returns portal. The conversation ended successfully.
|
|
260
|
+
>
|
|
261
|
+
> **Overall:** The conversation followed a natural support flow -- greeting, order lookup, failed cancellation handled with a fallback suggestion, and resolution. The `cancelOrder` error is expected behavior for a shipped order, not a bug.
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Picking Which Conversation to Analyze
|
|
266
|
+
|
|
267
|
+
When the developer doesn't specify a conversation ID, help them find the right one.
|
|
268
|
+
|
|
269
|
+
### Step 1: List conversations
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
adk conversations --format json
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Step 2: Narrow down
|
|
276
|
+
|
|
277
|
+
Use the list output to identify the conversation. Key signals:
|
|
278
|
+
|
|
279
|
+
| Signal | How to Use |
|
|
280
|
+
|--------|-----------|
|
|
281
|
+
| `lastSeen` | Most recent conversation is usually the one they're asking about |
|
|
282
|
+
| `hasErrors` | If they're debugging a failure, look for `hasErrors: true` |
|
|
283
|
+
| `integration` / `channel` | If they mention "the Slack conversation" or "the webchat issue", match on these |
|
|
284
|
+
| `traceCount` | High turn counts may indicate stuck loops or long interactions |
|
|
285
|
+
|
|
286
|
+
### Step 3: Show the conversation
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
adk conversations show <conversation-id> --format json
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
If the developer needs more detail, add `--include-llm`.
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Correlating with Trace Data
|
|
297
|
+
|
|
298
|
+
Each turn in the conversation has a `traceId`. This is the bridge between conversation-level and trace-level analysis.
|
|
299
|
+
|
|
300
|
+
**When to drill into a trace:**
|
|
301
|
+
|
|
302
|
+
- A turn has `status: "error"` and you need the full span tree to understand why
|
|
303
|
+
- A tool call failed and you need the stack trace or detailed error
|
|
304
|
+
- The LLM reasoning (from `llmContent`) is surprising and you want to see the full `think` spans
|
|
305
|
+
- You need to see the exact inputs/outputs of a tool call
|
|
306
|
+
|
|
307
|
+
**How to drill down:**
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
# Get the full trace for a specific turn
|
|
311
|
+
adk traces trace=<trace-id> --include-llm --format json
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Then use the trace-reading techniques from `trace-summarization.md` to analyze the individual trace.
|
|
315
|
+
|
|
316
|
+
**Flow:**
|
|
317
|
+
|
|
318
|
+
```
|
|
319
|
+
adk conversations list → find the conversation
|
|
320
|
+
adk conversations show <id> → see the timeline
|
|
321
|
+
adk traces trace=<trace-id> → drill into a specific turn
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## Common Patterns to Highlight
|
|
327
|
+
|
|
328
|
+
When analyzing conversations, watch for these patterns and call them out.
|
|
329
|
+
|
|
330
|
+
### Long conversations
|
|
331
|
+
|
|
332
|
+
A conversation with many turns (10+) for what should be a simple task.
|
|
333
|
+
|
|
334
|
+
**What to say:** Flag the turn count, identify where the conversation got stuck or went off track, and suggest whether the issue is in the agent's instructions, tool design, or workflow logic.
|
|
335
|
+
|
|
336
|
+
### Error recovery
|
|
337
|
+
|
|
338
|
+
The agent encounters an error but recovers in a subsequent turn.
|
|
339
|
+
|
|
340
|
+
**What to say:** Note that the agent handled the error gracefully, explain the recovery path, and confirm whether the behavior is correct or accidental.
|
|
341
|
+
|
|
342
|
+
### Tool call chains
|
|
343
|
+
|
|
344
|
+
Multiple tools called in sequence within a single turn, or across turns, to accomplish a multi-step task.
|
|
345
|
+
|
|
346
|
+
**What to say:** Describe the chain, note whether each step depended on the previous one's output, and flag any unnecessary calls.
|
|
347
|
+
|
|
348
|
+
### Stuck loops
|
|
349
|
+
|
|
350
|
+
The agent calls the same tool repeatedly across multiple turns or within a single turn.
|
|
351
|
+
|
|
352
|
+
**What to say:** Identify the repeating pattern, explain why the agent is stuck (from `llmContent` if available), and suggest fixes (improve tool output, add `onBeforeTool` guard, set `maxIterations`). See `llm-debugging.md` for more on looping.
|
|
353
|
+
|
|
354
|
+
### Silent failures
|
|
355
|
+
|
|
356
|
+
A turn completes with `status: "ok"` but the agent didn't actually accomplish the task (e.g., returned a generic response without calling a tool).
|
|
357
|
+
|
|
358
|
+
**What to say:** Flag the gap between expected and actual behavior, and suggest investigating the LLM reasoning with `--include-llm`.
|
|
359
|
+
|
|
360
|
+
### Integration-specific patterns
|
|
361
|
+
|
|
362
|
+
Different integrations have different conversation patterns -- Slack threads vs webchat sessions vs API calls.
|
|
363
|
+
|
|
364
|
+
**What to say:** Note the integration and channel, and flag anything unusual for that context (e.g., a webchat conversation with 50 turns might indicate the user is stuck in a loop, while a Slack thread with 50 turns might be a busy channel).
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## Patterns
|
|
369
|
+
|
|
370
|
+
✅ **Summarize first, explain on request**
|
|
371
|
+
|
|
372
|
+
```
|
|
373
|
+
Developer: "What happened in conv_abc123?"
|
|
374
|
+
→ Start with a summary (no --include-llm needed)
|
|
375
|
+
→ Only drill into explanation if they ask for more detail
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
✅ **Use the conversation timeline as a map**
|
|
379
|
+
|
|
380
|
+
```
|
|
381
|
+
Good: "The conversation had 4 turns. Turn 3 is where the error occurred. Let me drill into that trace."
|
|
382
|
+
Bad: Immediately fetching all traces for all turns and dumping everything.
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
✅ **Name the integration and channel**
|
|
386
|
+
|
|
387
|
+
```
|
|
388
|
+
Good: "A 4-turn Slack DM conversation..."
|
|
389
|
+
Bad: "A conversation with 4 turns..."
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
✅ **Connect turns to each other**
|
|
393
|
+
|
|
394
|
+
```
|
|
395
|
+
Good: "The user asked about the order in turn 2, then tried to cancel it in turn 3 -- the cancellation failed because the lookup in turn 2 showed the order was already shipped."
|
|
396
|
+
Bad: "Turn 2: lookupOrder called. Turn 3: cancelOrder failed."
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
✅ **Suggest drill-down when appropriate**
|
|
400
|
+
|
|
401
|
+
```
|
|
402
|
+
Good: "Turn 3 failed with a cancelOrder error. To see the full stack trace, run: adk traces trace=tr_003 --include-llm --format json"
|
|
403
|
+
Bad: Automatically fetching and dumping the full trace without being asked.
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
❌ **Don't dump raw JSON in the analysis**
|
|
407
|
+
|
|
408
|
+
The developer already has the JSON. Your job is to synthesize it into understanding.
|
|
409
|
+
|
|
410
|
+
❌ **Don't speculate about what the user said**
|
|
411
|
+
|
|
412
|
+
The conversation timeline shows what the agent did, not the exact user messages. Use `trigger` and `llmContent` to infer context, but be clear when you're inferring vs. when you have direct evidence.
|
|
413
|
+
|
|
414
|
+
❌ **Don't re-explain tool behavior the developer already knows**
|
|
415
|
+
|
|
416
|
+
If the developer built the tools, they know what `lookupOrder` does. Focus on *what happened* and *why*, not what the tool is for.
|
|
417
|
+
|
|
418
|
+
❌ **Don't ignore the overall arc**
|
|
419
|
+
|
|
420
|
+
Even in a detailed explanation, start and end with the big picture. A list of turns without a conclusion is incomplete.
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# Systematic Debug Workflow
|
|
2
|
+
|
|
3
|
+
A step-by-step process for diagnosing and fixing issues in ADK agents. Follow these steps in order — each step narrows the problem space.
|
|
4
|
+
|
|
5
|
+
Most diagnostic CLI commands use `--format json` for structured, parseable output. Make sure `adk dev` is running in the background, once the project is validated.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## The Debug Loop
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
1. VALIDATE → adk check --format json
|
|
13
|
+
2. REPRODUCE → adk chat --single "msg" --format json
|
|
14
|
+
3. LOGS → adk logs error --format json
|
|
15
|
+
4. TRACES → adk traces --format json
|
|
16
|
+
5. CLASSIFY → Runtime error? LLM behavior? Config issue?
|
|
17
|
+
6. FIX → Apply targeted fix
|
|
18
|
+
7. VERIFY → Re-test with adk chat, confirm clean output
|
|
19
|
+
8. PREVENT → Write a regression eval
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Step 1: Validate
|
|
25
|
+
|
|
26
|
+
Before debugging runtime behavior, rule out project-level issues.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
adk check --format json
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This catches:
|
|
33
|
+
- Invalid `agent.config.ts`
|
|
34
|
+
- Schema mismatches in actions, tools, workflows
|
|
35
|
+
- Invalid entity names
|
|
36
|
+
- Missing dependencies
|
|
37
|
+
- Import errors
|
|
38
|
+
|
|
39
|
+
If `adk check` reports errors, fix them first. Many "runtime" issues are actually build/config problems.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Step 2: Reproduce
|
|
44
|
+
|
|
45
|
+
Create a minimal reproduction with a single message.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
adk chat --single "the message that triggers the bug" --format json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Why minimal?** A single message isolates the problem. Most often, multi-turn conversations add noise — the issue might be in turn 3 but caused by context from turn 1. That being said, some bugs are only reproducible by going through many turns.
|
|
52
|
+
|
|
53
|
+
**Save the conversation ID** from the JSON output — you'll need it for trace queries and follow up conversations.
|
|
54
|
+
|
|
55
|
+
If the issue requires multi-turn context:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# First message
|
|
59
|
+
adk chat --single "Setup message" --format json
|
|
60
|
+
# Note the conversation_id from output
|
|
61
|
+
|
|
62
|
+
# Trigger the bug
|
|
63
|
+
adk chat --single "Bug-triggering message" --conversation-id <id> --format json
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Step 3: Check Logs
|
|
69
|
+
|
|
70
|
+
Quick scan for errors and warnings.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Errors only
|
|
74
|
+
adk logs error --format json
|
|
75
|
+
|
|
76
|
+
# Errors and warnings from the last hour
|
|
77
|
+
adk logs warning since=1h --format json
|
|
78
|
+
|
|
79
|
+
# Stream live while reproducing
|
|
80
|
+
adk logs --follow --format json
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Logs give you a high-level view. If the error is obvious here (startup failure, integration auth error, missing config), fix it directly.
|
|
84
|
+
|
|
85
|
+
If logs don't explain the issue, move to traces.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Step 4: Inspect Traces
|
|
90
|
+
|
|
91
|
+
Traces show everything the agent did during a conversation turn.
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# All recent traces
|
|
95
|
+
adk traces --format json
|
|
96
|
+
|
|
97
|
+
# For a specific conversation
|
|
98
|
+
adk traces conversation=<id> --format json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Read spans in order.** Look for:
|
|
102
|
+
|
|
103
|
+
1. **`think` spans** — Does the model's reasoning make sense? Does it understand the user's intent?
|
|
104
|
+
2. **`tool_call` spans** — Was the right tool called? Did it succeed? Are the parameters correct?
|
|
105
|
+
3. **`code_execution_exception` spans** — Any runtime errors? Read the stack trace.
|
|
106
|
+
4. **`end` span** — Did the turn complete normally?
|
|
107
|
+
|
|
108
|
+
**Find the divergence point:** Compare what happened vs what should have happened. The first span that doesn't match expectations is usually where the bug is.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Step 5: Classify the Failure
|
|
113
|
+
|
|
114
|
+
Based on what you found in logs and traces, classify the issue:
|
|
115
|
+
|
|
116
|
+
### Runtime Error
|
|
117
|
+
The code threw an exception or returned an error.
|
|
118
|
+
- **Traces show:** `code_execution_exception` or `tool_call` with `success: false`
|
|
119
|
+
- **Next:** See `common-failures.md` for specific patterns and fixes
|
|
120
|
+
|
|
121
|
+
### LLM Behavior
|
|
122
|
+
The model made a bad decision — wrong tool, hallucinated values, refusal, or looping.
|
|
123
|
+
- **Traces show:** `think` span with incorrect reasoning, or `tool_call` with wrong tool/params
|
|
124
|
+
- **Next:** See `llm-debugging.md` for diagnosis and fixes
|
|
125
|
+
|
|
126
|
+
### Config Issue
|
|
127
|
+
Missing or incorrect configuration — integration auth, agent.json, environment.
|
|
128
|
+
- **Traces show:** May not have traces at all, or errors mentioning config/auth
|
|
129
|
+
- **Logs show:** Startup errors, auth failures, missing config warnings
|
|
130
|
+
- **Next:** See `common-failures.md` sections on config, integration failures, and agent.json vs agent.local.json
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Step 6: Fix
|
|
135
|
+
|
|
136
|
+
Apply a targeted fix based on the classification:
|
|
137
|
+
|
|
138
|
+
| Classification | Where to Fix | Reference |
|
|
139
|
+
|---------------|-------------|-----------|
|
|
140
|
+
| Runtime error in handler | Action/tool/workflow handler code | `common-failures.md` |
|
|
141
|
+
| Schema mismatch | Input/output schema definitions | `common-failures.md` § Build Errors |
|
|
142
|
+
| Wrong tool selected | Tool descriptions, instructions | `llm-debugging.md` § Wrong Tool |
|
|
143
|
+
| Hallucinated params | Input schemas, validation | `llm-debugging.md` § Hallucinated Parameters |
|
|
144
|
+
| Model refusal | Instructions, tool descriptions | `llm-debugging.md` § Refusal |
|
|
145
|
+
| Model looping | `onBeforeTool` guard, output clarity | `llm-debugging.md` § Looping |
|
|
146
|
+
| Integration failure | Dev Console config, `adk add` | `common-failures.md` § Integration Failures |
|
|
147
|
+
| Config issue | `agent.json`, `agent.local.json` | `common-failures.md` § Config Confusion |
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Step 7: Verify
|
|
152
|
+
|
|
153
|
+
Re-run the exact reproduction from Step 2:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
adk chat --single "the message that triggered the bug" --format json
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Then confirm:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# No errors in logs
|
|
163
|
+
adk logs error --format json
|
|
164
|
+
|
|
165
|
+
# Traces show correct behavior
|
|
166
|
+
adk traces --format json
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Check that:
|
|
170
|
+
- The bot responds correctly
|
|
171
|
+
- The right tools are called with the right parameters
|
|
172
|
+
- No error spans in the traces
|
|
173
|
+
- No new warnings in logs
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Step 8: Prevent with Evals
|
|
178
|
+
|
|
179
|
+
After fixing, write a regression eval so the bug can't come back. Use the **adk-evals** skill for full guidance.
|
|
180
|
+
|
|
181
|
+
Quick template:
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
import { Eval } from '@botpress/adk'
|
|
185
|
+
|
|
186
|
+
export default new Eval({
|
|
187
|
+
name: 'fix-description-here',
|
|
188
|
+
type: 'regression',
|
|
189
|
+
tags: ['bugfix'],
|
|
190
|
+
|
|
191
|
+
conversation: [
|
|
192
|
+
{
|
|
193
|
+
user: 'the message that triggered the bug',
|
|
194
|
+
assert: {
|
|
195
|
+
response: [
|
|
196
|
+
{ not_contains: 'error' },
|
|
197
|
+
{ llm_judge: 'Response correctly handles the scenario' },
|
|
198
|
+
],
|
|
199
|
+
tools: [{ called: 'expectedTool' }],
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
})
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Run it:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
adk evals fix-description-here --format json
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Tag regression evals as `type: 'regression'` so they run in CI and catch future regressions.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## When to Escalate
|
|
217
|
+
|
|
218
|
+
If you've gone through the loop and still can't resolve the issue, gather this information for a bug report:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# Project validation
|
|
222
|
+
adk check --format json > check-output.json
|
|
223
|
+
|
|
224
|
+
# Recent errors
|
|
225
|
+
adk logs error --format json > error-logs.json
|
|
226
|
+
|
|
227
|
+
# Traces from the failing conversation
|
|
228
|
+
adk traces conversation=<id> --format json > traces.json
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Include:
|
|
232
|
+
1. **Reproduction steps** — exact messages/events that trigger the issue
|
|
233
|
+
2. **`adk check` output** — project state
|
|
234
|
+
3. **Error logs** — relevant error entries
|
|
235
|
+
4. **Trace output** — full trace with spans for the failing conversation
|
|
236
|
+
5. **Expected vs actual behavior** — what should happen vs what does happen
|
|
237
|
+
6. **ADK version** — `adk --version`
|
|
238
|
+
|
|
239
|
+
Let the human know and suggest reaching out to support with the above information.
|