You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(offloader): update retrieval tool docs to reflect Python parity
The Python SDK now supports the same targeted retrieval parameters
(pattern, line_range, context_lines) as TypeScript. Remove the
SDK-specific tabs for the feature description and show unified
examples.
Copy file name to clipboardExpand all lines: site/src/content/docs/user-guide/concepts/plugins/context-offloader.mdx
+35-43Lines changed: 35 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -245,25 +245,33 @@ agent = Agent(plugins=[
245
245
246
246
The plugin includes a `retrieve_offloaded_content` tool that lets the agent fetch offloaded content by reference, returning it in its native format — text as a string, JSON as a JSON block, images as image blocks, and documents as document blocks. This tool is registered by default.
247
247
248
+
The retrieval tool supports targeted retrieval through optional parameters, so the agent can search and filter offloaded content without loading it entirely back into context.
249
+
250
+
**Parameters:**
251
+
248
252
<Tabs>
249
253
<Tablabel="Python">
250
254
251
-
The inline guidance in offloaded results tells the agent to use its available tools to selectively access the data it needs, and mentions `retrieve_offloaded_content` as a fallback.
255
+
| Parameter | Type | Description |
256
+
|-----------|------|-------------|
257
+
|`reference`|`str`|*(required)* Storage reference from the offloaded result |
258
+
|`pattern`|`str`| Regex or keyword to grep for |
259
+
|`line_range`|`dict` with `start` and `end` keys | 1-indexed inclusive line span to retrieve |
260
+
|`context_lines`|`int`| Lines of context around pattern matches (default: 5) |
252
261
253
262
</Tab>
254
263
<Tablabel="TypeScript">
255
264
256
-
In the TypeScript SDK, the retrieval tool supports targeted retrieval through optional parameters, so the agent can search and filter offloaded content without loading it entirely back into context.
257
-
258
-
**Parameters:**
259
-
260
265
| Parameter | Type | Description |
261
266
|-----------|------|-------------|
262
267
|`reference`|`string`|*(required)* Storage reference from the offloaded result |
263
268
|`pattern`|`string`| Regex or keyword to grep for |
264
269
|`line_range`|`{ start: number; end: number }`| 1-indexed inclusive line span to retrieve |
265
270
|`context_lines`|`number`| Lines of context around pattern matches (default: 5) |
266
271
272
+
</Tab>
273
+
</Tabs>
274
+
267
275
**Retrieval modes:**
268
276
269
277
-**Pattern search** — Provide `pattern` to grep for regex/keyword matches with configurable `context_lines`
@@ -274,51 +282,18 @@ In the TypeScript SDK, the retrieval tool supports targeted retrieval through op
274
282
275
283
Results include line numbers to enable follow-up queries. Large result sets are truncated with guidance to narrow the search. Binary content cannot be searched — pattern and line range parameters return an error for binary references.
276
284
277
-
</Tab>
278
-
</Tabs>
279
-
280
285
### Retrieval examples
281
286
282
-
<Tabs>
283
-
<Tablabel="Python">
284
-
285
-
**1. Tool result gets offloaded (replaces original result inline)**
286
-
287
-
```
288
-
[Offloaded: 1 blocks, ~10,000 tokens]
289
-
Tool result was offloaded to external storage due to size.
290
-
Use the preview below to answer if possible.
291
-
Use retrieve_offloaded_content to fetch the full content by reference.
0 commit comments