@octavus/docs 2.11.0 → 2.13.0
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/content/02-server-sdk/02-sessions.md +1 -0
- package/content/02-server-sdk/05-cli.md +9 -3
- package/content/03-client-sdk/01-overview.md +17 -0
- package/content/03-client-sdk/06-http-transport.md +1 -0
- package/content/03-client-sdk/08-file-uploads.md +57 -3
- package/content/03-client-sdk/09-error-handling.md +28 -4
- package/content/04-protocol/01-overview.md +12 -6
- package/content/04-protocol/04-tools.md +4 -3
- package/content/04-protocol/07-agent-config.md +46 -1
- package/content/04-protocol/08-provider-options.md +2 -7
- package/content/04-protocol/11-workers.md +4 -2
- package/content/04-protocol/12-references.md +189 -0
- package/content/05-api-reference/02-sessions.md +6 -5
- package/content/05-api-reference/03-agents.md +31 -9
- package/dist/{chunk-H6M6M3MY.js → chunk-PYLADDXH.js} +51 -31
- package/dist/chunk-PYLADDXH.js.map +1 -0
- package/dist/{chunk-NCTX3Y2J.js → chunk-SNBEHHFU.js} +43 -25
- package/dist/chunk-SNBEHHFU.js.map +1 -0
- package/dist/{chunk-EIUCL4CP.js → chunk-Z5E72EIS.js} +51 -31
- package/dist/chunk-Z5E72EIS.js.map +1 -0
- package/dist/content.js +1 -1
- package/dist/docs.json +25 -16
- package/dist/index.js +1 -1
- package/dist/search-index.json +1 -1
- package/dist/search.js +1 -1
- package/dist/search.js.map +1 -1
- package/dist/sections.json +25 -16
- package/package.json +1 -1
- package/dist/chunk-6TO62UOU.js +0 -1489
- package/dist/chunk-6TO62UOU.js.map +0 -1
- package/dist/chunk-EIUCL4CP.js.map +0 -1
- package/dist/chunk-H6M6M3MY.js.map +0 -1
- package/dist/chunk-NCTX3Y2J.js.map +0 -1
|
@@ -121,6 +121,7 @@ interface TriggerRequest {
|
|
|
121
121
|
type: 'trigger';
|
|
122
122
|
triggerName: string;
|
|
123
123
|
input?: Record<string, unknown>;
|
|
124
|
+
rollbackAfterMessageId?: string | null; // For retry: truncate messages after this ID
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
// Continue after client-side tool handling
|
|
@@ -169,11 +169,17 @@ The CLI expects agent definitions in a specific directory structure:
|
|
|
169
169
|
my-agent/
|
|
170
170
|
├── settings.json # Required: Agent metadata
|
|
171
171
|
├── protocol.yaml # Required: Agent protocol
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
├── prompts/ # Optional: Prompt templates
|
|
173
|
+
│ ├── system.md
|
|
174
|
+
│ └── user-message.md
|
|
175
|
+
└── references/ # Optional: Reference documents
|
|
176
|
+
└── api-guidelines.md
|
|
175
177
|
```
|
|
176
178
|
|
|
179
|
+
### references/
|
|
180
|
+
|
|
181
|
+
Reference files are markdown documents with YAML frontmatter containing a `description`. The agent can fetch these on demand during execution. See [References](/docs/protocol/references) for details.
|
|
182
|
+
|
|
177
183
|
### settings.json
|
|
178
184
|
|
|
179
185
|
```json
|
|
@@ -183,6 +183,21 @@ const { stop } = useOctavusChat({ transport });
|
|
|
183
183
|
stop();
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
+
### Retry Last Trigger
|
|
187
|
+
|
|
188
|
+
Re-execute the last trigger from the same starting point. Messages are rolled back to the state before the trigger, the user message is re-added (if any), and the agent re-executes. Already-uploaded files are reused without re-uploading.
|
|
189
|
+
|
|
190
|
+
```tsx
|
|
191
|
+
const { retry, canRetry } = useOctavusChat({ transport });
|
|
192
|
+
|
|
193
|
+
// Retry after an error, cancellation, or unsatisfactory result
|
|
194
|
+
if (canRetry) {
|
|
195
|
+
await retry();
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
`canRetry` is `true` when a trigger has been sent and the chat is not currently streaming or awaiting input.
|
|
200
|
+
|
|
186
201
|
## Hook Reference (React)
|
|
187
202
|
|
|
188
203
|
### useOctavusChat
|
|
@@ -234,6 +249,8 @@ interface UseOctavusChatReturn {
|
|
|
234
249
|
options?: { userMessage?: UserMessageInput },
|
|
235
250
|
) => Promise<void>;
|
|
236
251
|
stop: () => void;
|
|
252
|
+
retry: () => Promise<void>; // Retry last trigger from same starting point
|
|
253
|
+
canRetry: boolean; // Whether retry() can be called
|
|
237
254
|
|
|
238
255
|
// Connection management (socket transport only - undefined for HTTP)
|
|
239
256
|
connect: (() => Promise<void>) | undefined;
|
|
@@ -271,6 +271,7 @@ interface TriggerRequest {
|
|
|
271
271
|
type: 'trigger';
|
|
272
272
|
triggerName: string;
|
|
273
273
|
input?: Record<string, unknown>;
|
|
274
|
+
rollbackAfterMessageId?: string | null; // For retry: truncate messages after this ID
|
|
274
275
|
}
|
|
275
276
|
|
|
276
277
|
// Continue after client-side tool handling
|
|
@@ -77,6 +77,12 @@ function Chat({ sessionId }: { sessionId: string }) {
|
|
|
77
77
|
const { messages, status, send, uploadFiles } = useOctavusChat({
|
|
78
78
|
transport,
|
|
79
79
|
requestUploadUrls,
|
|
80
|
+
// Optional: configure upload timeout and retry behavior
|
|
81
|
+
uploadOptions: {
|
|
82
|
+
timeoutMs: 60_000, // Per-file timeout (default: 60s, set to 0 to disable)
|
|
83
|
+
maxRetries: 2, // Retry attempts on transient failures (default: 2)
|
|
84
|
+
retryDelayMs: 1_000, // Delay between retries (default: 1s)
|
|
85
|
+
},
|
|
80
86
|
});
|
|
81
87
|
|
|
82
88
|
// ...
|
|
@@ -176,6 +182,54 @@ async function handleSend(message: string, files?: File[]) {
|
|
|
176
182
|
|
|
177
183
|
The SDK automatically uploads the files before sending. Note: This doesn't provide upload progress.
|
|
178
184
|
|
|
185
|
+
## Upload Reliability
|
|
186
|
+
|
|
187
|
+
Uploads include built-in timeout and retry logic for handling transient failures (network errors, server issues, mobile network switches).
|
|
188
|
+
|
|
189
|
+
**Default behavior:**
|
|
190
|
+
|
|
191
|
+
- **Timeout**: 60 seconds per file — prevents uploads from hanging on stalled connections
|
|
192
|
+
- **Retries**: 2 automatic retries on transient failures (network errors, 5xx, 429)
|
|
193
|
+
- **Retry delay**: 1 second between retries
|
|
194
|
+
- **Non-retryable errors** (4xx like 403, 404) fail immediately without retrying
|
|
195
|
+
|
|
196
|
+
Only the S3 upload is retried — the presigned URL stays valid for 15 minutes. On retry, the progress callback resets to 0%.
|
|
197
|
+
|
|
198
|
+
Configure via `uploadOptions`:
|
|
199
|
+
|
|
200
|
+
```typescript
|
|
201
|
+
const { send, uploadFiles } = useOctavusChat({
|
|
202
|
+
transport,
|
|
203
|
+
requestUploadUrls,
|
|
204
|
+
uploadOptions: {
|
|
205
|
+
timeoutMs: 120_000, // 2 minutes for large files
|
|
206
|
+
maxRetries: 3,
|
|
207
|
+
retryDelayMs: 2_000,
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
To disable timeout or retries:
|
|
213
|
+
|
|
214
|
+
```typescript
|
|
215
|
+
uploadOptions: {
|
|
216
|
+
timeoutMs: 0, // No timeout
|
|
217
|
+
maxRetries: 0, // No retries
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Using `OctavusChat` Directly
|
|
222
|
+
|
|
223
|
+
When using the `OctavusChat` class directly (without the React hook), pass `uploadOptions` in the constructor:
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
const chat = new OctavusChat({
|
|
227
|
+
transport,
|
|
228
|
+
requestUploadUrls,
|
|
229
|
+
uploadOptions: { timeoutMs: 120_000, maxRetries: 3 },
|
|
230
|
+
});
|
|
231
|
+
```
|
|
232
|
+
|
|
179
233
|
## FileReference Type
|
|
180
234
|
|
|
181
235
|
File references contain metadata and URLs:
|
|
@@ -234,15 +288,15 @@ The `file` type is a built-in type representing uploaded files. Use `file[]` for
|
|
|
234
288
|
| Type | Media Types |
|
|
235
289
|
| --------- | -------------------------------------------------------------------- |
|
|
236
290
|
| Images | `image/jpeg`, `image/png`, `image/gif`, `image/webp` |
|
|
291
|
+
| Video | `video/mp4`, `video/webm`, `video/quicktime`, `video/mpeg` |
|
|
237
292
|
| Documents | `application/pdf`, `text/plain`, `text/markdown`, `application/json` |
|
|
238
293
|
|
|
239
294
|
## File Limits
|
|
240
295
|
|
|
241
296
|
| Limit | Value |
|
|
242
297
|
| --------------------- | ---------- |
|
|
243
|
-
| Max file size |
|
|
244
|
-
| Max total per request |
|
|
245
|
-
| Max files per request | 20 |
|
|
298
|
+
| Max file size | 100 MB |
|
|
299
|
+
| Max total per request | 200 MB |
|
|
246
300
|
| Upload URL expiry | 15 minutes |
|
|
247
301
|
| Download URL expiry | 24 hours |
|
|
248
302
|
|
|
@@ -124,6 +124,21 @@ if (isProviderError(error) && error.provider) {
|
|
|
124
124
|
}
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
+
## Retrying After Errors
|
|
128
|
+
|
|
129
|
+
Use `retry()` to re-execute the last trigger from the same starting point. Messages are rolled back, the user message is re-added (if any), and the agent re-executes. Files are reused without re-uploading.
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
const { error, canRetry, retry } = useOctavusChat({ transport });
|
|
133
|
+
|
|
134
|
+
// Retry after any error
|
|
135
|
+
if (canRetry) {
|
|
136
|
+
await retry();
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
`retry()` also works after stopping (cancellation) or when the result is unsatisfactory — not just errors.
|
|
141
|
+
|
|
127
142
|
## Building Error UI
|
|
128
143
|
|
|
129
144
|
```tsx
|
|
@@ -135,7 +150,7 @@ import {
|
|
|
135
150
|
} from '@octavus/react';
|
|
136
151
|
|
|
137
152
|
function Chat() {
|
|
138
|
-
const { error, status } = useOctavusChat({ transport });
|
|
153
|
+
const { error, status, retry, canRetry } = useOctavusChat({ transport });
|
|
139
154
|
|
|
140
155
|
return (
|
|
141
156
|
<div>
|
|
@@ -149,7 +164,11 @@ function Chat() {
|
|
|
149
164
|
Please try again in {error.retryAfter} seconds
|
|
150
165
|
</p>
|
|
151
166
|
)}
|
|
152
|
-
{
|
|
167
|
+
{canRetry && (
|
|
168
|
+
<button className="mt-3 text-red-700 underline" onClick={() => void retry()}>
|
|
169
|
+
Retry
|
|
170
|
+
</button>
|
|
171
|
+
)}
|
|
153
172
|
</div>
|
|
154
173
|
)}
|
|
155
174
|
</div>
|
|
@@ -197,12 +216,17 @@ useOctavusChat({
|
|
|
197
216
|
The hook exposes error state directly:
|
|
198
217
|
|
|
199
218
|
```typescript
|
|
200
|
-
const { error, status } = useOctavusChat({ transport });
|
|
219
|
+
const { error, status, retry, canRetry } = useOctavusChat({ transport });
|
|
201
220
|
|
|
202
221
|
// status is 'error' when an error occurred
|
|
203
222
|
// error contains the OctavusError object
|
|
204
223
|
|
|
205
|
-
//
|
|
224
|
+
// Option 1: Retry the same trigger (rolls back messages, re-executes)
|
|
225
|
+
if (canRetry) {
|
|
226
|
+
await retry();
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Option 2: Send a new message (clears the error)
|
|
206
230
|
await send('user-message', { USER_MESSAGE: 'Try again' });
|
|
207
231
|
```
|
|
208
232
|
|
|
@@ -81,6 +81,7 @@ agent:
|
|
|
81
81
|
tools: [get-user-account]
|
|
82
82
|
skills: [qr-code] # Enable skills
|
|
83
83
|
imageModel: google/gemini-2.5-flash-image # Enable image generation
|
|
84
|
+
webSearch: true # Enable web search
|
|
84
85
|
agentic: true # Allow multiple tool calls
|
|
85
86
|
thinking: medium # Extended reasoning
|
|
86
87
|
|
|
@@ -105,16 +106,20 @@ Each agent is a folder with:
|
|
|
105
106
|
my-agent/
|
|
106
107
|
├── protocol.yaml # Main logic (required)
|
|
107
108
|
├── settings.json # Agent metadata (required)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
├── prompts/ # Prompt templates (supports subdirectories)
|
|
110
|
+
│ ├── system.md
|
|
111
|
+
│ ├── user-message.md
|
|
112
|
+
│ └── shared/
|
|
113
|
+
│ ├── company-info.md
|
|
114
|
+
│ └── formatting-rules.md
|
|
115
|
+
└── references/ # On-demand context documents (optional)
|
|
116
|
+
└── api-guidelines.md
|
|
114
117
|
```
|
|
115
118
|
|
|
116
119
|
Prompts can be organized in subdirectories. In the protocol, reference nested prompts by their path relative to `prompts/` (without `.md`): `shared/company-info`.
|
|
117
120
|
|
|
121
|
+
References are markdown files with YAML frontmatter that the agent can fetch on demand during execution. See [References](/docs/protocol/references).
|
|
122
|
+
|
|
118
123
|
### settings.json
|
|
119
124
|
|
|
120
125
|
```json
|
|
@@ -183,6 +188,7 @@ The referenced prompt content is inserted before variable interpolation, so vari
|
|
|
183
188
|
- [Triggers](/docs/protocol/triggers) — How agents are invoked
|
|
184
189
|
- [Tools](/docs/protocol/tools) — External capabilities
|
|
185
190
|
- [Skills](/docs/protocol/skills) — Code execution and knowledge packages
|
|
191
|
+
- [References](/docs/protocol/references) — On-demand context documents
|
|
186
192
|
- [Handlers](/docs/protocol/handlers) — Execution blocks
|
|
187
193
|
- [Agent Config](/docs/protocol/agent-config) — Model and settings
|
|
188
194
|
- [Workers](/docs/protocol/workers) — Worker agent format
|
|
@@ -8,10 +8,11 @@ description: Defining external tools implemented in your backend.
|
|
|
8
8
|
Tools extend what agents can do. Octavus supports multiple types:
|
|
9
9
|
|
|
10
10
|
1. **External Tools** — Defined in the protocol, implemented in your backend (this page)
|
|
11
|
-
2. **
|
|
12
|
-
3. **
|
|
11
|
+
2. **Built-in Tools** — Provider-agnostic tools managed by Octavus (web search, image generation)
|
|
12
|
+
3. **Provider Tools** — Provider-specific tools executed by the provider (e.g., Anthropic's code execution)
|
|
13
|
+
4. **Skills** — Code execution and knowledge packages (see [Skills](/docs/protocol/skills))
|
|
13
14
|
|
|
14
|
-
This page covers external tools. For provider tools, see [Provider Options](/docs/protocol/provider-options). For code execution
|
|
15
|
+
This page covers external tools. Built-in tools are enabled via agent config — see [Web Search](/docs/protocol/agent-config#web-search) and [Image Generation](/docs/protocol/agent-config#image-generation). For provider-specific tools, see [Provider Options](/docs/protocol/provider-options). For code execution, see [Skills](/docs/protocol/skills).
|
|
15
16
|
|
|
16
17
|
## External Tools
|
|
17
18
|
|
|
@@ -15,6 +15,7 @@ agent:
|
|
|
15
15
|
system: system # References prompts/system.md
|
|
16
16
|
tools: [get-user-account] # Available tools
|
|
17
17
|
skills: [qr-code] # Available skills
|
|
18
|
+
references: [api-guidelines] # On-demand context documents
|
|
18
19
|
```
|
|
19
20
|
|
|
20
21
|
## Configuration Options
|
|
@@ -26,8 +27,10 @@ agent:
|
|
|
26
27
|
| `input` | No | Variables to pass to the system prompt |
|
|
27
28
|
| `tools` | No | List of tools the LLM can call |
|
|
28
29
|
| `skills` | No | List of Octavus skills the LLM can use |
|
|
30
|
+
| `references` | No | List of references the LLM can fetch on demand |
|
|
29
31
|
| `sandboxTimeout` | No | Skill sandbox timeout in ms (default: 5 min, max: 1 hour) |
|
|
30
32
|
| `imageModel` | No | Image generation model (enables agentic image generation) |
|
|
33
|
+
| `webSearch` | No | Enable built-in web search tool (provider-agnostic) |
|
|
31
34
|
| `agentic` | No | Allow multiple tool call cycles |
|
|
32
35
|
| `maxSteps` | No | Maximum agentic steps (default: 10) |
|
|
33
36
|
| `temperature` | No | Model temperature (0-2) |
|
|
@@ -212,6 +215,22 @@ Skills provide provider-agnostic code execution in isolated sandboxes. When enab
|
|
|
212
215
|
|
|
213
216
|
See [Skills](/docs/protocol/skills) for full documentation.
|
|
214
217
|
|
|
218
|
+
## References
|
|
219
|
+
|
|
220
|
+
Enable on-demand context loading via reference documents:
|
|
221
|
+
|
|
222
|
+
```yaml
|
|
223
|
+
agent:
|
|
224
|
+
model: anthropic/claude-sonnet-4-5
|
|
225
|
+
system: system
|
|
226
|
+
references: [api-guidelines, error-codes]
|
|
227
|
+
agentic: true
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
References are markdown files stored in the agent's `references/` directory. When enabled, the LLM can list available references and read their content using `octavus_reference_list` and `octavus_reference_read` tools.
|
|
231
|
+
|
|
232
|
+
See [References](/docs/protocol/references) for full documentation.
|
|
233
|
+
|
|
215
234
|
## Image Generation
|
|
216
235
|
|
|
217
236
|
Enable the LLM to generate images autonomously:
|
|
@@ -267,6 +286,28 @@ Use `generate-image` block (see [Handlers](/docs/protocol/handlers#generate-imag
|
|
|
267
286
|
- Building prompt engineering pipelines
|
|
268
287
|
- Images are generated at specific handler steps
|
|
269
288
|
|
|
289
|
+
## Web Search
|
|
290
|
+
|
|
291
|
+
Enable the LLM to search the web for current information:
|
|
292
|
+
|
|
293
|
+
```yaml
|
|
294
|
+
agent:
|
|
295
|
+
model: anthropic/claude-sonnet-4-5
|
|
296
|
+
system: system
|
|
297
|
+
webSearch: true
|
|
298
|
+
agentic: true
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
When `webSearch` is enabled, the `octavus_web_search` tool becomes available. The LLM can decide when to search the web based on the conversation. Search results include source URLs that are emitted as citations in the UI.
|
|
302
|
+
|
|
303
|
+
This is a **provider-agnostic** built-in tool — it works with any LLM provider (Anthropic, Google, OpenAI, etc.). For Anthropic's own web search implementation, see [Provider Options](/docs/protocol/provider-options).
|
|
304
|
+
|
|
305
|
+
Use cases:
|
|
306
|
+
|
|
307
|
+
- Current events and real-time data
|
|
308
|
+
- Fact verification and documentation lookups
|
|
309
|
+
- Any information that may have changed since the model's training
|
|
310
|
+
|
|
270
311
|
## Temperature
|
|
271
312
|
|
|
272
313
|
Control response randomness:
|
|
@@ -321,10 +362,12 @@ handlers:
|
|
|
321
362
|
maxSteps: 1 # Limit tool calls
|
|
322
363
|
system: escalation-summary # Different prompt
|
|
323
364
|
skills: [data-analysis] # Thread-specific skills
|
|
365
|
+
references: [escalation-policy] # Thread-specific references
|
|
324
366
|
imageModel: google/gemini-2.5-flash-image # Thread-specific image model
|
|
367
|
+
webSearch: true # Thread-specific web search
|
|
325
368
|
```
|
|
326
369
|
|
|
327
|
-
Each thread can have its own skills
|
|
370
|
+
Each thread can have its own skills, references, image model, and web search setting. Skills must be defined in the protocol's `skills:` section. References must exist in the agent's `references/` directory. Workers use this same pattern since they don't have a global `agent:` section.
|
|
328
371
|
|
|
329
372
|
## Full Example
|
|
330
373
|
|
|
@@ -372,6 +415,8 @@ agent:
|
|
|
372
415
|
- search-docs
|
|
373
416
|
- create-support-ticket
|
|
374
417
|
skills: [qr-code] # Octavus skills
|
|
418
|
+
references: [support-policies] # On-demand context
|
|
419
|
+
webSearch: true # Built-in web search
|
|
375
420
|
agentic: true
|
|
376
421
|
maxSteps: 10
|
|
377
422
|
thinking: medium
|
|
@@ -65,7 +65,7 @@ anthropic:
|
|
|
65
65
|
|
|
66
66
|
### Web Search
|
|
67
67
|
|
|
68
|
-
Allows the agent to search the web
|
|
68
|
+
Allows the agent to search the web using Anthropic's built-in web search:
|
|
69
69
|
|
|
70
70
|
```yaml
|
|
71
71
|
agent:
|
|
@@ -77,12 +77,7 @@ agent:
|
|
|
77
77
|
description: Looking up current information
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- Current events and news
|
|
83
|
-
- Real-time data (prices, weather)
|
|
84
|
-
- Fact verification
|
|
85
|
-
- Documentation lookups
|
|
80
|
+
> **Tip**: Octavus also provides a **provider-agnostic** web search via `webSearch: true` in the agent config. This works with any LLM provider and is the recommended approach for multi-provider agents. See [Web Search](/docs/protocol/agent-config#web-search) for details.
|
|
86
81
|
|
|
87
82
|
### Code Execution
|
|
88
83
|
|
|
@@ -228,6 +228,7 @@ All LLM configuration goes here:
|
|
|
228
228
|
| `tools` | Tools available in this thread |
|
|
229
229
|
| `skills` | Octavus skills available in this thread |
|
|
230
230
|
| `imageModel` | Image generation model |
|
|
231
|
+
| `webSearch` | Enable built-in web search tool |
|
|
231
232
|
| `thinking` | Extended reasoning level |
|
|
232
233
|
| `temperature` | Model temperature |
|
|
233
234
|
| `maxSteps` | Maximum tool call cycles (enables agentic if > 1) |
|
|
@@ -362,9 +363,9 @@ steps:
|
|
|
362
363
|
output: CONVERSATION_SUMMARY
|
|
363
364
|
```
|
|
364
365
|
|
|
365
|
-
## Skills and
|
|
366
|
+
## Skills, Image Generation, and Web Search
|
|
366
367
|
|
|
367
|
-
Workers can use Octavus skills
|
|
368
|
+
Workers can use Octavus skills, image generation, and web search, configured per-thread via `start-thread`:
|
|
368
369
|
|
|
369
370
|
```yaml
|
|
370
371
|
skills:
|
|
@@ -380,6 +381,7 @@ steps:
|
|
|
380
381
|
system: system
|
|
381
382
|
skills: [qr-code]
|
|
382
383
|
imageModel: google/gemini-2.5-flash-image
|
|
384
|
+
webSearch: true
|
|
383
385
|
maxSteps: 10
|
|
384
386
|
```
|
|
385
387
|
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: References
|
|
3
|
+
description: Using references for on-demand context loading in agents.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# References
|
|
7
|
+
|
|
8
|
+
References are markdown documents that agents can fetch on demand. Instead of loading everything into the system prompt upfront, references let the agent decide what context it needs and load it when relevant.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
References are useful for:
|
|
13
|
+
|
|
14
|
+
- **Large context** — Documents too long to include in every system prompt
|
|
15
|
+
- **Selective loading** — Let the agent decide which context is relevant
|
|
16
|
+
- **Shared knowledge** — Reusable documents across threads
|
|
17
|
+
|
|
18
|
+
### How References Work
|
|
19
|
+
|
|
20
|
+
1. **Definition**: Reference files live in the `references/` directory alongside your agent
|
|
21
|
+
2. **Configuration**: List available references in `agent.references` or `start-thread.references`
|
|
22
|
+
3. **Discovery**: The agent sees reference names and descriptions in its system prompt
|
|
23
|
+
4. **Fetching**: The agent calls reference tools to read the full content when needed
|
|
24
|
+
|
|
25
|
+
## Creating References
|
|
26
|
+
|
|
27
|
+
Each reference is a markdown file with YAML frontmatter in the `references/` directory:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
my-agent/
|
|
31
|
+
├── settings.json
|
|
32
|
+
├── protocol.yaml
|
|
33
|
+
├── prompts/
|
|
34
|
+
│ └── system.md
|
|
35
|
+
└── references/
|
|
36
|
+
├── api-guidelines.md
|
|
37
|
+
└── error-codes.md
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Reference Format
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
---
|
|
44
|
+
description: >
|
|
45
|
+
API design guidelines including naming conventions,
|
|
46
|
+
error handling patterns, and pagination standards.
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
# API Guidelines
|
|
50
|
+
|
|
51
|
+
## Naming Conventions
|
|
52
|
+
|
|
53
|
+
Use lowercase with dashes for URL paths...
|
|
54
|
+
|
|
55
|
+
## Error Handling
|
|
56
|
+
|
|
57
|
+
All errors return a standard error envelope...
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The `description` field is required. It tells the agent what the reference contains so it can decide when to fetch it.
|
|
61
|
+
|
|
62
|
+
### Naming Convention
|
|
63
|
+
|
|
64
|
+
Reference filenames use `lowercase-with-dashes`:
|
|
65
|
+
|
|
66
|
+
- `api-guidelines.md`
|
|
67
|
+
- `error-codes.md`
|
|
68
|
+
- `coding-standards.md`
|
|
69
|
+
|
|
70
|
+
The filename (without `.md`) becomes the reference name used in the protocol.
|
|
71
|
+
|
|
72
|
+
## Enabling References
|
|
73
|
+
|
|
74
|
+
After creating reference files, specify which references are available in the protocol.
|
|
75
|
+
|
|
76
|
+
### Interactive Agents
|
|
77
|
+
|
|
78
|
+
List references in `agent.references`:
|
|
79
|
+
|
|
80
|
+
```yaml
|
|
81
|
+
agent:
|
|
82
|
+
model: anthropic/claude-sonnet-4-5
|
|
83
|
+
system: system
|
|
84
|
+
references: [api-guidelines, error-codes]
|
|
85
|
+
agentic: true
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Workers and Named Threads
|
|
89
|
+
|
|
90
|
+
List references per-thread in `start-thread.references`:
|
|
91
|
+
|
|
92
|
+
```yaml
|
|
93
|
+
steps:
|
|
94
|
+
Start thread:
|
|
95
|
+
block: start-thread
|
|
96
|
+
thread: worker
|
|
97
|
+
model: anthropic/claude-sonnet-4-5
|
|
98
|
+
system: system
|
|
99
|
+
references: [api-guidelines]
|
|
100
|
+
maxSteps: 10
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Different threads can have different references.
|
|
104
|
+
|
|
105
|
+
## Reference Tools
|
|
106
|
+
|
|
107
|
+
When references are enabled, the agent has access to two tools:
|
|
108
|
+
|
|
109
|
+
| Tool | Purpose |
|
|
110
|
+
| ------------------------ | ----------------------------------------------- |
|
|
111
|
+
| `octavus_reference_list` | List all available references with descriptions |
|
|
112
|
+
| `octavus_reference_read` | Read the full content of a specific reference |
|
|
113
|
+
|
|
114
|
+
The agent also sees reference names and descriptions in its system prompt, so it knows what's available without calling `octavus_reference_list`.
|
|
115
|
+
|
|
116
|
+
## Example
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
agent:
|
|
120
|
+
model: anthropic/claude-sonnet-4-5
|
|
121
|
+
system: system
|
|
122
|
+
tools: [review-pull-request]
|
|
123
|
+
references: [coding-standards, api-guidelines]
|
|
124
|
+
agentic: true
|
|
125
|
+
|
|
126
|
+
handlers:
|
|
127
|
+
user-message:
|
|
128
|
+
Add message:
|
|
129
|
+
block: add-message
|
|
130
|
+
role: user
|
|
131
|
+
prompt: user-message
|
|
132
|
+
input: [USER_MESSAGE]
|
|
133
|
+
|
|
134
|
+
Respond:
|
|
135
|
+
block: next-message
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
With `references/coding-standards.md`:
|
|
139
|
+
|
|
140
|
+
```markdown
|
|
141
|
+
---
|
|
142
|
+
description: >
|
|
143
|
+
Team coding standards including naming conventions,
|
|
144
|
+
code organization, and review checklist.
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
# Coding Standards
|
|
148
|
+
|
|
149
|
+
## Naming Conventions
|
|
150
|
+
|
|
151
|
+
- Files: kebab-case
|
|
152
|
+
- Variables: camelCase
|
|
153
|
+
- Constants: UPPER_SNAKE_CASE
|
|
154
|
+
...
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
When a user asks the agent to review code, the agent will:
|
|
158
|
+
|
|
159
|
+
1. See "coding-standards" and "api-guidelines" in its system prompt
|
|
160
|
+
2. Decide which references are relevant to the review
|
|
161
|
+
3. Call `octavus_reference_read` to load the relevant reference
|
|
162
|
+
4. Use the loaded context to provide an informed review
|
|
163
|
+
|
|
164
|
+
## Validation
|
|
165
|
+
|
|
166
|
+
The CLI and platform validate references during sync and deployment:
|
|
167
|
+
|
|
168
|
+
- **Undefined references** — Referencing a name that doesn't have a matching file in `references/`
|
|
169
|
+
- **Unused references** — A reference file exists but isn't listed in any `agent.references` or `start-thread.references`
|
|
170
|
+
- **Invalid names** — Names that don't follow the `lowercase-with-dashes` convention
|
|
171
|
+
- **Missing description** — Reference files without the required `description` in frontmatter
|
|
172
|
+
|
|
173
|
+
## References vs Skills
|
|
174
|
+
|
|
175
|
+
| Aspect | References | Skills |
|
|
176
|
+
| ------------- | ----------------------------- | ------------------------------- |
|
|
177
|
+
| **Purpose** | On-demand context documents | Code execution and file output |
|
|
178
|
+
| **Content** | Markdown text | Documentation + scripts |
|
|
179
|
+
| **Execution** | Synchronous text retrieval | Sandboxed code execution (E2B) |
|
|
180
|
+
| **Scope** | Per-agent (stored with agent) | Per-organization (shared) |
|
|
181
|
+
| **Tools** | List and read (2 tools) | Read, list, run, code (6 tools) |
|
|
182
|
+
|
|
183
|
+
Use **references** when the agent needs access to text-based knowledge. Use **skills** when the agent needs to execute code or generate files.
|
|
184
|
+
|
|
185
|
+
## Next Steps
|
|
186
|
+
|
|
187
|
+
- [Agent Config](/docs/protocol/agent-config) — Configuring references in agent settings
|
|
188
|
+
- [Skills](/docs/protocol/skills) — Code execution and knowledge packages
|
|
189
|
+
- [Workers](/docs/protocol/workers) — Using references in worker agents
|
|
@@ -258,11 +258,12 @@ POST /api/agent-sessions/:sessionId/trigger
|
|
|
258
258
|
}
|
|
259
259
|
```
|
|
260
260
|
|
|
261
|
-
| Field
|
|
262
|
-
|
|
|
263
|
-
| `triggerName`
|
|
264
|
-
| `input`
|
|
265
|
-
| `toolResults`
|
|
261
|
+
| Field | Type | Required | Description |
|
|
262
|
+
| ------------------------ | -------------- | -------- | -------------------------------------------------------------------------------------------------- |
|
|
263
|
+
| `triggerName` | string | Yes | Name of the trigger to execute |
|
|
264
|
+
| `input` | object | No | Input variables for the trigger |
|
|
265
|
+
| `toolResults` | array | No | Tool results for continuation (handled by SDK) |
|
|
266
|
+
| `rollbackAfterMessageId` | string \| null | No | For retry: ID of the last message to keep. Messages after this are removed. `null` = truncate all. |
|
|
266
267
|
|
|
267
268
|
### Response
|
|
268
269
|
|