@octavus/docs 0.0.1
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/LICENSE +22 -0
- package/content/01-getting-started/01-introduction.md +93 -0
- package/content/01-getting-started/02-quickstart.md +268 -0
- package/content/01-getting-started/_meta.md +4 -0
- package/content/02-server-sdk/01-overview.md +133 -0
- package/content/02-server-sdk/02-sessions.md +164 -0
- package/content/02-server-sdk/03-tools.md +242 -0
- package/content/02-server-sdk/04-streaming.md +211 -0
- package/content/02-server-sdk/_meta.md +4 -0
- package/content/03-client-sdk/01-overview.md +148 -0
- package/content/03-client-sdk/02-messages.md +207 -0
- package/content/03-client-sdk/03-streaming.md +215 -0
- package/content/03-client-sdk/04-execution-blocks.md +231 -0
- package/content/03-client-sdk/_meta.md +4 -0
- package/content/04-protocol/01-overview.md +142 -0
- package/content/04-protocol/02-input-resources.md +200 -0
- package/content/04-protocol/03-triggers.md +209 -0
- package/content/04-protocol/04-tools.md +255 -0
- package/content/04-protocol/05-handlers.md +251 -0
- package/content/04-protocol/06-agent-config.md +215 -0
- package/content/04-protocol/_meta.md +4 -0
- package/content/05-api-reference/01-overview.md +129 -0
- package/content/05-api-reference/02-sessions.md +232 -0
- package/content/05-api-reference/03-agents.md +222 -0
- package/content/05-api-reference/_meta.md +4 -0
- package/dist/chunk-2YMRODFE.js +421 -0
- package/dist/chunk-2YMRODFE.js.map +1 -0
- package/dist/chunk-6JQ3OMGF.js +421 -0
- package/dist/chunk-6JQ3OMGF.js.map +1 -0
- package/dist/chunk-ESGSYVGK.js +421 -0
- package/dist/chunk-ESGSYVGK.js.map +1 -0
- package/dist/chunk-GDCTM2SV.js +421 -0
- package/dist/chunk-GDCTM2SV.js.map +1 -0
- package/dist/chunk-J26MLMLN.js +421 -0
- package/dist/chunk-J26MLMLN.js.map +1 -0
- package/dist/chunk-LWYMRXBF.js +421 -0
- package/dist/chunk-LWYMRXBF.js.map +1 -0
- package/dist/chunk-NFVJQNDP.js +421 -0
- package/dist/chunk-NFVJQNDP.js.map +1 -0
- package/dist/chunk-SCKIOGKI.js +421 -0
- package/dist/chunk-SCKIOGKI.js.map +1 -0
- package/dist/chunk-VWPQ6ORV.js +421 -0
- package/dist/chunk-VWPQ6ORV.js.map +1 -0
- package/dist/chunk-WUNFFJ32.js +421 -0
- package/dist/chunk-WUNFFJ32.js.map +1 -0
- package/dist/chunk-XVSMRXBJ.js +421 -0
- package/dist/chunk-XVSMRXBJ.js.map +1 -0
- package/dist/content.d.ts +37 -0
- package/dist/content.js +17 -0
- package/dist/content.js.map +1 -0
- package/dist/docs.json +173 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/search-index.json +1 -0
- package/dist/search.d.ts +19 -0
- package/dist/search.js +30 -0
- package/dist/search.js.map +1 -0
- package/dist/sections.json +213 -0
- package/dist/types-BNRNBPDE.d.ts +28 -0
- package/dist/types-BltYGlWI.d.ts +36 -0
- package/package.json +52 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Tools
|
|
3
|
+
description: Defining external tools agents can use.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Tools
|
|
7
|
+
|
|
8
|
+
Tools extend what agents can do. They're defined in the protocol and implemented in your backend.
|
|
9
|
+
|
|
10
|
+
## Tool Definition
|
|
11
|
+
|
|
12
|
+
```yaml
|
|
13
|
+
tools:
|
|
14
|
+
get-user-account:
|
|
15
|
+
description: Looking up your account information
|
|
16
|
+
display: description
|
|
17
|
+
parameters:
|
|
18
|
+
userId:
|
|
19
|
+
type: string
|
|
20
|
+
description: The user ID to look up
|
|
21
|
+
returns:
|
|
22
|
+
name: { type: string }
|
|
23
|
+
email: { type: string }
|
|
24
|
+
plan: { type: string }
|
|
25
|
+
createdAt: { type: string }
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Tool Fields
|
|
29
|
+
|
|
30
|
+
| Field | Required | Description |
|
|
31
|
+
|-------|----------|-------------|
|
|
32
|
+
| `description` | Yes | What the tool does (shown to LLM and optionally user) |
|
|
33
|
+
| `display` | No | How to show in UI: `hidden`, `name`, `description`, `stream` |
|
|
34
|
+
| `parameters` | No | Input parameters the tool accepts |
|
|
35
|
+
| `required` | No | List of required parameter names |
|
|
36
|
+
| `returns` | No | Schema of the return value (for documentation) |
|
|
37
|
+
|
|
38
|
+
### Display Modes
|
|
39
|
+
|
|
40
|
+
| Mode | Behavior |
|
|
41
|
+
|------|----------|
|
|
42
|
+
| `hidden` | Tool runs silently, user doesn't see it |
|
|
43
|
+
| `name` | Shows tool name while executing |
|
|
44
|
+
| `description` | Shows description while executing (default) |
|
|
45
|
+
| `stream` | Streams tool progress if available |
|
|
46
|
+
|
|
47
|
+
## Parameter Types
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
tools:
|
|
51
|
+
search-products:
|
|
52
|
+
description: Search the product catalog
|
|
53
|
+
parameters:
|
|
54
|
+
query:
|
|
55
|
+
type: string
|
|
56
|
+
description: Search query
|
|
57
|
+
|
|
58
|
+
category:
|
|
59
|
+
type: string
|
|
60
|
+
description: Filter by category
|
|
61
|
+
enum: [electronics, clothing, books, home]
|
|
62
|
+
|
|
63
|
+
maxPrice:
|
|
64
|
+
type: number
|
|
65
|
+
description: Maximum price filter
|
|
66
|
+
|
|
67
|
+
inStock:
|
|
68
|
+
type: boolean
|
|
69
|
+
description: Only show in-stock items
|
|
70
|
+
|
|
71
|
+
tags:
|
|
72
|
+
type: array
|
|
73
|
+
description: Filter by tags
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Making Tools Available
|
|
77
|
+
|
|
78
|
+
Tools defined in `tools:` are available. To make them usable by the LLM, add them to `agent.tools`:
|
|
79
|
+
|
|
80
|
+
```yaml
|
|
81
|
+
tools:
|
|
82
|
+
get-user-account:
|
|
83
|
+
description: Look up user account
|
|
84
|
+
parameters:
|
|
85
|
+
userId: { type: string }
|
|
86
|
+
|
|
87
|
+
create-support-ticket:
|
|
88
|
+
description: Create a support ticket
|
|
89
|
+
parameters:
|
|
90
|
+
summary: { type: string }
|
|
91
|
+
priority: { type: string, enum: [low, medium, high, urgent] }
|
|
92
|
+
|
|
93
|
+
agent:
|
|
94
|
+
model: anthropic/claude-sonnet-4-5
|
|
95
|
+
system: system
|
|
96
|
+
tools:
|
|
97
|
+
- get-user-account
|
|
98
|
+
- create-support-ticket # LLM can decide when to call these
|
|
99
|
+
agentic: true
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Tool Invocation Modes
|
|
103
|
+
|
|
104
|
+
### LLM-Decided (Agentic)
|
|
105
|
+
|
|
106
|
+
The LLM decides when to call tools based on the conversation:
|
|
107
|
+
|
|
108
|
+
```yaml
|
|
109
|
+
agent:
|
|
110
|
+
tools: [get-user-account, create-support-ticket]
|
|
111
|
+
agentic: true # Allow multiple tool calls
|
|
112
|
+
maxSteps: 10 # Max tool call cycles
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Deterministic (Block-Based)
|
|
116
|
+
|
|
117
|
+
Force tool calls at specific points in the handler:
|
|
118
|
+
|
|
119
|
+
```yaml
|
|
120
|
+
handlers:
|
|
121
|
+
request-human:
|
|
122
|
+
# Always create a ticket when escalating
|
|
123
|
+
Create support ticket:
|
|
124
|
+
type: tool-call
|
|
125
|
+
tool: create-support-ticket
|
|
126
|
+
input:
|
|
127
|
+
summary: SUMMARY # From variable
|
|
128
|
+
priority: medium # Literal value
|
|
129
|
+
output: TICKET # Store result
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Tool Results
|
|
133
|
+
|
|
134
|
+
### In Prompts
|
|
135
|
+
|
|
136
|
+
Reference tool results in prompts:
|
|
137
|
+
|
|
138
|
+
```markdown
|
|
139
|
+
<!-- prompts/ticket-directive.md -->
|
|
140
|
+
A support ticket has been created:
|
|
141
|
+
- Ticket ID: {{TICKET.ticketId}}
|
|
142
|
+
- Estimated Response: {{TICKET.estimatedResponse}}
|
|
143
|
+
|
|
144
|
+
Let the user know their ticket has been created.
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### In Variables
|
|
148
|
+
|
|
149
|
+
Store tool results for later use:
|
|
150
|
+
|
|
151
|
+
```yaml
|
|
152
|
+
handlers:
|
|
153
|
+
request-human:
|
|
154
|
+
Get account:
|
|
155
|
+
type: tool-call
|
|
156
|
+
tool: get-user-account
|
|
157
|
+
input:
|
|
158
|
+
userId: USER_ID
|
|
159
|
+
output: ACCOUNT # Result stored here
|
|
160
|
+
|
|
161
|
+
Create ticket:
|
|
162
|
+
type: tool-call
|
|
163
|
+
tool: create-support-ticket
|
|
164
|
+
input:
|
|
165
|
+
summary: SUMMARY
|
|
166
|
+
priority: medium
|
|
167
|
+
# Can reference ACCOUNT here
|
|
168
|
+
email: ACCOUNT.email
|
|
169
|
+
output: TICKET
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Implementing Tools
|
|
173
|
+
|
|
174
|
+
Tools are implemented in your backend:
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
const session = client.agentSessions.attach(sessionId, {
|
|
178
|
+
tools: {
|
|
179
|
+
'get-user-account': async (args) => {
|
|
180
|
+
const userId = args.userId as string;
|
|
181
|
+
const user = await db.users.findById(userId);
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
name: user.name,
|
|
185
|
+
email: user.email,
|
|
186
|
+
plan: user.subscription.plan,
|
|
187
|
+
createdAt: user.createdAt.toISOString(),
|
|
188
|
+
};
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
'create-support-ticket': async (args) => {
|
|
192
|
+
const ticket = await ticketService.create({
|
|
193
|
+
summary: args.summary as string,
|
|
194
|
+
priority: args.priority as string,
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
return {
|
|
198
|
+
ticketId: ticket.id,
|
|
199
|
+
estimatedResponse: getEstimatedTime(args.priority),
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Tool Best Practices
|
|
207
|
+
|
|
208
|
+
### 1. Clear Descriptions
|
|
209
|
+
|
|
210
|
+
```yaml
|
|
211
|
+
tools:
|
|
212
|
+
# Good - clear and specific
|
|
213
|
+
get-user-account:
|
|
214
|
+
description: >
|
|
215
|
+
Retrieves the user's account information including name, email,
|
|
216
|
+
subscription plan, and account creation date. Use this when the
|
|
217
|
+
user asks about their account or you need to verify their identity.
|
|
218
|
+
|
|
219
|
+
# Avoid - vague
|
|
220
|
+
get-data:
|
|
221
|
+
description: Gets some data
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### 2. Define Expected Returns
|
|
225
|
+
|
|
226
|
+
```yaml
|
|
227
|
+
tools:
|
|
228
|
+
search-products:
|
|
229
|
+
description: Search products
|
|
230
|
+
parameters:
|
|
231
|
+
query: { type: string }
|
|
232
|
+
returns:
|
|
233
|
+
products:
|
|
234
|
+
type: array
|
|
235
|
+
items:
|
|
236
|
+
type: object
|
|
237
|
+
properties:
|
|
238
|
+
id: { type: string }
|
|
239
|
+
name: { type: string }
|
|
240
|
+
price: { type: number }
|
|
241
|
+
totalCount: { type: number }
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### 3. Use Enums for Constrained Values
|
|
245
|
+
|
|
246
|
+
```yaml
|
|
247
|
+
tools:
|
|
248
|
+
create-support-ticket:
|
|
249
|
+
parameters:
|
|
250
|
+
priority:
|
|
251
|
+
type: string
|
|
252
|
+
description: Ticket priority level
|
|
253
|
+
enum: [low, medium, high, urgent]
|
|
254
|
+
```
|
|
255
|
+
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Handlers
|
|
3
|
+
description: Defining execution handlers with blocks.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Handlers
|
|
7
|
+
|
|
8
|
+
Handlers define what happens when a trigger fires. They contain execution blocks that run in sequence.
|
|
9
|
+
|
|
10
|
+
## Handler Structure
|
|
11
|
+
|
|
12
|
+
```yaml
|
|
13
|
+
handlers:
|
|
14
|
+
trigger-name:
|
|
15
|
+
Block Name:
|
|
16
|
+
type: block-type
|
|
17
|
+
# block-specific properties
|
|
18
|
+
|
|
19
|
+
Another Block:
|
|
20
|
+
type: another-type
|
|
21
|
+
# ...
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Each block has a human-readable name (shown in debug UI) and a type that determines its behavior.
|
|
25
|
+
|
|
26
|
+
## Block Types
|
|
27
|
+
|
|
28
|
+
### next-message
|
|
29
|
+
|
|
30
|
+
Generate a response from the LLM:
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
handlers:
|
|
34
|
+
user-message:
|
|
35
|
+
Respond to user:
|
|
36
|
+
type: next-message
|
|
37
|
+
# Uses main conversation thread by default
|
|
38
|
+
# Display defaults to 'stream'
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
With options:
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
Generate summary:
|
|
45
|
+
type: next-message
|
|
46
|
+
thread: summary # Use named thread
|
|
47
|
+
display: stream # Show streaming content
|
|
48
|
+
independent: true # Don't add to main chat
|
|
49
|
+
output: SUMMARY # Store output in variable
|
|
50
|
+
description: Generating summary # Shown in UI
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### add-message
|
|
54
|
+
|
|
55
|
+
Add a message to the conversation:
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
Add user message:
|
|
59
|
+
type: add-message
|
|
60
|
+
role: user # user | assistant | system
|
|
61
|
+
prompt: user-message # Reference to prompt file
|
|
62
|
+
input: [USER_MESSAGE] # Variables to interpolate
|
|
63
|
+
display: hidden # Don't show in UI
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
For internal directives (LLM sees it, user doesn't):
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
Add internal directive:
|
|
70
|
+
type: add-message
|
|
71
|
+
role: user
|
|
72
|
+
prompt: ticket-directive
|
|
73
|
+
input: [TICKET_DETAILS]
|
|
74
|
+
visible: false # LLM sees this, user doesn't
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### tool-call
|
|
78
|
+
|
|
79
|
+
Call a tool deterministically:
|
|
80
|
+
|
|
81
|
+
```yaml
|
|
82
|
+
Create ticket:
|
|
83
|
+
type: tool-call
|
|
84
|
+
tool: create-support-ticket
|
|
85
|
+
input:
|
|
86
|
+
summary: SUMMARY # Variable reference
|
|
87
|
+
priority: medium # Literal value
|
|
88
|
+
output: TICKET # Store result
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### set-resource
|
|
92
|
+
|
|
93
|
+
Update a persistent resource:
|
|
94
|
+
|
|
95
|
+
```yaml
|
|
96
|
+
Save summary:
|
|
97
|
+
type: set-resource
|
|
98
|
+
resource: CONVERSATION_SUMMARY
|
|
99
|
+
value: SUMMARY # Variable to save
|
|
100
|
+
display: name # Show block name
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### start-thread
|
|
104
|
+
|
|
105
|
+
Create a named conversation thread:
|
|
106
|
+
|
|
107
|
+
```yaml
|
|
108
|
+
Start summary thread:
|
|
109
|
+
type: start-thread
|
|
110
|
+
thread: summary # Thread name
|
|
111
|
+
model: anthropic/claude-sonnet-4-5 # Optional: different model
|
|
112
|
+
thinking: low # Extended reasoning level
|
|
113
|
+
maxSteps: 1 # Tool call limit
|
|
114
|
+
system: escalation-summary # System prompt
|
|
115
|
+
input: [COMPANY_NAME] # Variables for prompt
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### serialize-thread
|
|
119
|
+
|
|
120
|
+
Convert conversation to text:
|
|
121
|
+
|
|
122
|
+
```yaml
|
|
123
|
+
Serialize conversation:
|
|
124
|
+
type: serialize-thread
|
|
125
|
+
thread: main # Which thread (default: main)
|
|
126
|
+
format: markdown # markdown | json
|
|
127
|
+
output: CONVERSATION_TEXT # Variable to store result
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Display Modes
|
|
131
|
+
|
|
132
|
+
Every block has a `display` property:
|
|
133
|
+
|
|
134
|
+
| Mode | Default For | Behavior |
|
|
135
|
+
|------|-------------|----------|
|
|
136
|
+
| `hidden` | add-message | Not shown to user |
|
|
137
|
+
| `name` | set-resource | Shows block name |
|
|
138
|
+
| `description` | tool-call | Shows description |
|
|
139
|
+
| `stream` | next-message | Streams content |
|
|
140
|
+
|
|
141
|
+
## Complete Example
|
|
142
|
+
|
|
143
|
+
```yaml
|
|
144
|
+
handlers:
|
|
145
|
+
user-message:
|
|
146
|
+
# Add the user's message to conversation
|
|
147
|
+
Add user message:
|
|
148
|
+
type: add-message
|
|
149
|
+
role: user
|
|
150
|
+
prompt: user-message
|
|
151
|
+
input: [USER_MESSAGE]
|
|
152
|
+
display: hidden
|
|
153
|
+
|
|
154
|
+
# Generate response (LLM may call tools)
|
|
155
|
+
Respond to user:
|
|
156
|
+
type: next-message
|
|
157
|
+
# display: stream (default)
|
|
158
|
+
|
|
159
|
+
request-human:
|
|
160
|
+
# Step 1: Serialize conversation for summary
|
|
161
|
+
Serialize conversation:
|
|
162
|
+
type: serialize-thread
|
|
163
|
+
format: markdown
|
|
164
|
+
output: CONVERSATION_TEXT
|
|
165
|
+
|
|
166
|
+
# Step 2: Create separate thread for summarization
|
|
167
|
+
Start summary thread:
|
|
168
|
+
type: start-thread
|
|
169
|
+
thread: summary
|
|
170
|
+
model: anthropic/claude-sonnet-4-5
|
|
171
|
+
thinking: low
|
|
172
|
+
system: escalation-summary
|
|
173
|
+
input: [COMPANY_NAME]
|
|
174
|
+
|
|
175
|
+
# Step 3: Add request to summary thread
|
|
176
|
+
Add summarize request:
|
|
177
|
+
type: add-message
|
|
178
|
+
thread: summary
|
|
179
|
+
role: user
|
|
180
|
+
prompt: summarize-request
|
|
181
|
+
input:
|
|
182
|
+
- CONVERSATION: CONVERSATION_TEXT
|
|
183
|
+
|
|
184
|
+
# Step 4: Generate summary
|
|
185
|
+
Generate summary:
|
|
186
|
+
type: next-message
|
|
187
|
+
thread: summary
|
|
188
|
+
display: stream
|
|
189
|
+
description: Summarizing your conversation
|
|
190
|
+
independent: true
|
|
191
|
+
output: SUMMARY
|
|
192
|
+
|
|
193
|
+
# Step 5: Save to resource
|
|
194
|
+
Save summary:
|
|
195
|
+
type: set-resource
|
|
196
|
+
resource: CONVERSATION_SUMMARY
|
|
197
|
+
value: SUMMARY
|
|
198
|
+
|
|
199
|
+
# Step 6: Create support ticket
|
|
200
|
+
Create ticket:
|
|
201
|
+
type: tool-call
|
|
202
|
+
tool: create-support-ticket
|
|
203
|
+
input:
|
|
204
|
+
summary: SUMMARY
|
|
205
|
+
priority: medium
|
|
206
|
+
output: TICKET
|
|
207
|
+
|
|
208
|
+
# Step 7: Add directive for response
|
|
209
|
+
Add directive:
|
|
210
|
+
type: add-message
|
|
211
|
+
role: user
|
|
212
|
+
prompt: ticket-directive
|
|
213
|
+
input: [TICKET_DETAILS: TICKET]
|
|
214
|
+
visible: false
|
|
215
|
+
|
|
216
|
+
# Step 8: Respond to user
|
|
217
|
+
Respond:
|
|
218
|
+
type: next-message
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Block Input Mapping
|
|
222
|
+
|
|
223
|
+
Map variables to block inputs:
|
|
224
|
+
|
|
225
|
+
```yaml
|
|
226
|
+
# Simple list (variable name = prompt variable)
|
|
227
|
+
input: [USER_MESSAGE, COMPANY_NAME]
|
|
228
|
+
|
|
229
|
+
# Mapping (different names)
|
|
230
|
+
input:
|
|
231
|
+
- CONVERSATION: CONVERSATION_TEXT # CONVERSATION in prompt = CONVERSATION_TEXT
|
|
232
|
+
- TICKET_DETAILS: TICKET
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Independent Blocks
|
|
236
|
+
|
|
237
|
+
Use `independent: true` for content that shouldn't go to the main chat:
|
|
238
|
+
|
|
239
|
+
```yaml
|
|
240
|
+
Generate summary:
|
|
241
|
+
type: next-message
|
|
242
|
+
thread: summary
|
|
243
|
+
independent: true # Output stored in variable, not main chat
|
|
244
|
+
output: SUMMARY
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
This is useful for:
|
|
248
|
+
- Background processing
|
|
249
|
+
- Summarization in separate threads
|
|
250
|
+
- Generating content for tools
|
|
251
|
+
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Agent Config
|
|
3
|
+
description: Configuring the agent model and behavior.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent Config
|
|
7
|
+
|
|
8
|
+
The `agent` section configures the LLM model, system prompt, tools, and behavior.
|
|
9
|
+
|
|
10
|
+
## Basic Configuration
|
|
11
|
+
|
|
12
|
+
```yaml
|
|
13
|
+
agent:
|
|
14
|
+
model: anthropic/claude-sonnet-4-5
|
|
15
|
+
system: system # References prompts/system.md
|
|
16
|
+
tools: [get-user-account] # Available tools
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Configuration Options
|
|
20
|
+
|
|
21
|
+
| Field | Required | Description |
|
|
22
|
+
|-------|----------|-------------|
|
|
23
|
+
| `model` | Yes | Model identifier (provider/model-id) |
|
|
24
|
+
| `system` | Yes | System prompt filename (without .md) |
|
|
25
|
+
| `input` | No | Variables to interpolate in system prompt |
|
|
26
|
+
| `tools` | No | List of tools the LLM can call |
|
|
27
|
+
| `agentic` | No | Allow multiple tool call cycles |
|
|
28
|
+
| `maxSteps` | No | Maximum agentic steps (default: 10) |
|
|
29
|
+
| `temperature` | No | Model temperature (0-2) |
|
|
30
|
+
| `thinking` | No | Extended reasoning level |
|
|
31
|
+
|
|
32
|
+
## Models
|
|
33
|
+
|
|
34
|
+
Specify models in `provider/model-id` format:
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
# Anthropic
|
|
38
|
+
agent:
|
|
39
|
+
model: anthropic/claude-sonnet-4-5 # Claude 4.5 Sonnet
|
|
40
|
+
model: anthropic/claude-opus-4 # Claude 4 Opus
|
|
41
|
+
|
|
42
|
+
# OpenAI
|
|
43
|
+
agent:
|
|
44
|
+
model: openai/gpt-4o # GPT-4o
|
|
45
|
+
model: openai/gpt-4o-mini # GPT-4o Mini
|
|
46
|
+
model: openai/o1 # O1
|
|
47
|
+
model: openai/o3-mini # O3 Mini
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## System Prompt
|
|
51
|
+
|
|
52
|
+
The system prompt sets the agent's persona and instructions:
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
agent:
|
|
56
|
+
system: system # Uses prompts/system.md
|
|
57
|
+
input:
|
|
58
|
+
- COMPANY_NAME
|
|
59
|
+
- PRODUCT_NAME
|
|
60
|
+
- SUPPORT_POLICIES
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Example `prompts/system.md`:
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
You are a friendly support agent for {{COMPANY_NAME}}.
|
|
67
|
+
|
|
68
|
+
## Your Role
|
|
69
|
+
|
|
70
|
+
Help users with questions about {{PRODUCT_NAME}}.
|
|
71
|
+
|
|
72
|
+
## Guidelines
|
|
73
|
+
|
|
74
|
+
- Be helpful and professional
|
|
75
|
+
- If you can't help, offer to escalate
|
|
76
|
+
- Never share internal information
|
|
77
|
+
|
|
78
|
+
{{#if SUPPORT_POLICIES}}
|
|
79
|
+
## Support Policies
|
|
80
|
+
|
|
81
|
+
{{SUPPORT_POLICIES}}
|
|
82
|
+
{{/if}}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Agentic Mode
|
|
86
|
+
|
|
87
|
+
Enable multi-step tool calling:
|
|
88
|
+
|
|
89
|
+
```yaml
|
|
90
|
+
agent:
|
|
91
|
+
model: anthropic/claude-sonnet-4-5
|
|
92
|
+
system: system
|
|
93
|
+
tools: [get-user-account, search-docs, create-ticket]
|
|
94
|
+
agentic: true # LLM can call multiple tools
|
|
95
|
+
maxSteps: 10 # Limit cycles to prevent runaway
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**How it works:**
|
|
99
|
+
1. LLM receives user message
|
|
100
|
+
2. LLM decides to call a tool
|
|
101
|
+
3. Tool executes, result returned to LLM
|
|
102
|
+
4. LLM decides if more tools needed
|
|
103
|
+
5. Repeat until LLM responds or maxSteps reached
|
|
104
|
+
|
|
105
|
+
## Extended Thinking
|
|
106
|
+
|
|
107
|
+
Enable extended reasoning for complex tasks:
|
|
108
|
+
|
|
109
|
+
```yaml
|
|
110
|
+
agent:
|
|
111
|
+
model: anthropic/claude-sonnet-4-5
|
|
112
|
+
thinking: medium # low | medium | high
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
| Level | Token Budget | Use Case |
|
|
116
|
+
|-------|-------------|----------|
|
|
117
|
+
| `low` | ~5,000 | Simple reasoning |
|
|
118
|
+
| `medium` | ~10,000 | Moderate complexity |
|
|
119
|
+
| `high` | ~20,000 | Complex analysis |
|
|
120
|
+
|
|
121
|
+
Thinking content streams to the UI and can be displayed to users.
|
|
122
|
+
|
|
123
|
+
## Temperature
|
|
124
|
+
|
|
125
|
+
Control response randomness:
|
|
126
|
+
|
|
127
|
+
```yaml
|
|
128
|
+
agent:
|
|
129
|
+
model: openai/gpt-4o
|
|
130
|
+
temperature: 0.7 # 0 = deterministic, 2 = creative
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Guidelines:**
|
|
134
|
+
- `0 - 0.3`: Factual, consistent responses
|
|
135
|
+
- `0.4 - 0.7`: Balanced (good default)
|
|
136
|
+
- `0.8 - 1.2`: Creative, varied responses
|
|
137
|
+
- `> 1.2`: Very creative (may be inconsistent)
|
|
138
|
+
|
|
139
|
+
## Thread-Specific Config
|
|
140
|
+
|
|
141
|
+
Override config for named threads:
|
|
142
|
+
|
|
143
|
+
```yaml
|
|
144
|
+
handlers:
|
|
145
|
+
request-human:
|
|
146
|
+
Start summary thread:
|
|
147
|
+
type: start-thread
|
|
148
|
+
thread: summary
|
|
149
|
+
model: anthropic/claude-sonnet-4-5 # Different model
|
|
150
|
+
thinking: low # Different thinking
|
|
151
|
+
maxSteps: 1 # Limit tool calls
|
|
152
|
+
system: escalation-summary # Different prompt
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Full Example
|
|
156
|
+
|
|
157
|
+
```yaml
|
|
158
|
+
input:
|
|
159
|
+
COMPANY_NAME: { type: string }
|
|
160
|
+
PRODUCT_NAME: { type: string }
|
|
161
|
+
USER_ID: { type: string, optional: true }
|
|
162
|
+
|
|
163
|
+
resources:
|
|
164
|
+
CONVERSATION_SUMMARY:
|
|
165
|
+
default: ""
|
|
166
|
+
|
|
167
|
+
tools:
|
|
168
|
+
get-user-account:
|
|
169
|
+
description: Look up user account
|
|
170
|
+
parameters:
|
|
171
|
+
userId: { type: string }
|
|
172
|
+
|
|
173
|
+
search-docs:
|
|
174
|
+
description: Search help documentation
|
|
175
|
+
parameters:
|
|
176
|
+
query: { type: string }
|
|
177
|
+
|
|
178
|
+
create-support-ticket:
|
|
179
|
+
description: Create a support ticket
|
|
180
|
+
parameters:
|
|
181
|
+
summary: { type: string }
|
|
182
|
+
priority: { type: string, enum: [low, medium, high] }
|
|
183
|
+
|
|
184
|
+
agent:
|
|
185
|
+
model: anthropic/claude-sonnet-4-5
|
|
186
|
+
system: system
|
|
187
|
+
input:
|
|
188
|
+
- COMPANY_NAME
|
|
189
|
+
- PRODUCT_NAME
|
|
190
|
+
tools:
|
|
191
|
+
- get-user-account
|
|
192
|
+
- search-docs
|
|
193
|
+
- create-support-ticket
|
|
194
|
+
agentic: true
|
|
195
|
+
maxSteps: 10
|
|
196
|
+
thinking: medium
|
|
197
|
+
|
|
198
|
+
triggers:
|
|
199
|
+
user-message:
|
|
200
|
+
input:
|
|
201
|
+
USER_MESSAGE: { type: string }
|
|
202
|
+
|
|
203
|
+
handlers:
|
|
204
|
+
user-message:
|
|
205
|
+
Add message:
|
|
206
|
+
type: add-message
|
|
207
|
+
role: user
|
|
208
|
+
prompt: user-message
|
|
209
|
+
input: [USER_MESSAGE]
|
|
210
|
+
display: hidden
|
|
211
|
+
|
|
212
|
+
Respond:
|
|
213
|
+
type: next-message
|
|
214
|
+
```
|
|
215
|
+
|