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
## Preview
https://deploy-preview-4491--electric-next.netlify.app/docs/agents/
## Summary
- Refresh agents docs against the current runtime, server, CLI, client,
and built-in agent APIs.
- Add dedicated usage pages for permissions, sandboxing, attachments,
signals, and event sources.
- Update sidebar/navigation plus stale references for Horton, Worker,
collections, pull-wake built-ins, MCP, runtime clients, and model
examples.
## Test plan
- `nvm use 22 && pnpm --dir website exec vitepress build .`
- Stale-term grep for removed agents docs patterns: old Coder
references, old model IDs, `brave_search`, `removeTag`, stale
`send()`/status snippets, and old attachment subject shape.
- Cursor lints for edited agents docs and VitePress config.
## Notes
- `pnpm --dir website run typecheck` was attempted earlier and still
fails on pre-existing site-wide Vue type resolution issues unrelated to
these docs changes.
- VitePress build exits successfully, while printing existing site
warnings from PGlite bundling and an SSR `requestAnimationFrame` warning
in a blog component.
Made with [Cursor](https://cursor.com)
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
| `bash` | Run shell commands in the working directory. |
32
+
| `read` | Read a file. Tracked in a per-wake `readSet`. |
33
+
| `write` | Create or overwrite a file. |
34
+
| `edit` | Targeted string replacement (file must be `read` first). |
35
+
| `web_search` | Web search via the configured search provider. |
36
+
| `fetch_url` | Fetch a URL and return it as markdown. |
37
+
| `spawn_worker` | Dispatch a subagent for an isolated subtask. |
38
+
| `fork` | Branch a session at its latest completed response. |
39
+
| `observe_pg_sync` | Observe an Electric Postgres shape and wake on changes. |
40
+
| `unobserve_pg_sync` | Remove an existing pg-sync observation. |
41
+
| `send` | Send a message to another entity. |
42
+
| `set_title` | Rename the current chat session title. |
43
+
44
+
`web_search` uses the search provider configured by the built-in runtime; Brave search requires `BRAVE_SEARCH_API_KEY`.
45
+
46
+
When docs support or skills are available, Horton also adds the docs search tool and skill tools during bootstrap. Built-in runtimes also provide `ctx.electricTools`, including schedule tools and webhook-source tools when configured.
42
47
43
48
## Title generation
44
49
45
-
After the first agent run completes, Horton calls `generateTitle()` (Haiku) to summarise the user's first message into a 3-5 word session title and stores it via `ctx.setTag('title', title)`. Failures are logged and ignored — the entity continues without a title.
50
+
After the first agent run completes, Horton calls `generateTitle()` using the configured low-cost model to summarise the user's first message into a 3-5 word session title and stores it via `ctx.setTag('title', title)`. Failures are logged and ignored — the entity continues without a title.
|`tools`| No | Subset of valid tool names (see below). Unknown names throw at parse time. |
30
33
|`sharedDb`| No | Shared state stream id and schema to connect to. |
31
34
|`sharedDbToolMode`| No | Shared state tool mode: `"full"` (default) or `"write-only"`. |
35
+
|`model`| No | Model id override. Usually inherited from `spawn_worker` / Horton model config. |
36
+
|`provider`| No | Model provider override paired with `model`. |
37
+
|`reasoningEffort`| No | Reasoning effort override for compatible reasoning models. |
32
38
33
-
`registerWorker(registry, { workingDirectory, streamFn? })` is called by the dev server during bootstrap; you don't usually call it yourself.
39
+
`registerWorker(registry, { workingDirectory, modelCatalog, streamFn? })` is called by the dev server during bootstrap; you don't usually call it yourself. The bootstrap path supplies the required `modelCatalog`.
34
40
35
41
## Valid tool names
36
42
@@ -40,9 +46,10 @@ type WorkerToolName =
40
46
|"read"
41
47
|"write"
42
48
|"edit"
43
-
|"brave_search"
49
+
|"web_search"
44
50
|"fetch_url"
45
51
|"spawn_worker"
52
+
|"send"
46
53
```
47
54
48
55
These are the same primitives Horton uses. Pick the smallest subset the worker needs — tools are the worker's permission set.
@@ -57,7 +64,7 @@ The canonical way to spawn a worker is the `spawn_worker` tool, which Horton cal
57
64
spawn_worker({
58
65
systemPrompt:
59
66
"You are a focused researcher. Find the three most-cited papers on X and return their titles, authors, and DOIs as a markdown table.",
60
-
tools: ["brave_search", "fetch_url"],
67
+
tools: ["web_search", "fetch_url"],
61
68
initialMessage:"Begin research now.",
62
69
})
63
70
```
@@ -75,7 +82,7 @@ The spawn uses `wake: { on: 'runFinished', includeResponse: true }`, so the spaw
75
82
1. Parses `ctx.args` into `WorkerArgs`. Throws if `systemPrompt` is empty, if `tools` contains an unknown name, or if neither `tools` nor `sharedDb` is provided.
76
83
2. Builds the requested tool instances against the worker's `workingDirectory` (and a fresh per-wake `readSet` for the read-first-then-edit guard).
77
84
3. If `sharedDb` is present, connects with `ctx.observe(db(id, schema))` and exposes generated `read_*`, `write_*`, `update_*`, and `delete_*` tools (`write_*` only in `"write-only"` mode).
78
-
4. Configures the agent with `HORTON_MODEL` (`claude-sonnet-4-5-20250929`), the provided system prompt (with a brief reporting-back footer appended), and the assembled tool list.
85
+
4. Configures the agent with `HORTON_MODEL` (`claude-sonnet-4-6` by default), the provided system prompt (with a brief reporting-back footer appended), and the assembled tool list.
79
86
5. Runs the agent until the LLM stops.
80
87
81
88
::: warning Least-privilege sandbox
@@ -96,7 +103,7 @@ When you finish, respond with a concise report covering what was done and any ke
Copy file name to clipboardExpand all lines: website/docs/agents/index.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ The runtime SDK is a layer over three foundations:
44
44
-**[TanStack DB](https://tanstack.com/db)** — typed local reads and writes via collections.
45
45
-**Mario Zechner's [pi](https://github.com/badlogic/pi-mono) toolkit** — `pi-ai` (unified multi-provider LLM API) and `pi-agent-core` (agent runtime) for the LLM agent loop.
46
46
47
-
**One stream per entity.** The runtime projects that stream into a typed local DB of collections — an `EntityStreamDB`. Inside a handler, that DB is `ctx.db`: writes go through `ctx.db.actions` (which append events to the stream), reads come from `ctx.db.collections`. The runtime ships [built-in collections](#built-in-collections) for runs, tool calls, text deltas, errors, inbox, and more, and you add your own typed [state](#state) collections per entity type.
47
+
**One stream per entity.** The runtime projects that stream into a typed local DB of collections — an `EntityStreamDB`. Inside a handler, that DB is `ctx.db`: writes go through `ctx.db.actions` (which append events to the stream), reads come from `ctx.db.collections`. The runtime ships [built-in collections](#built-in-collections) for runs, tool calls, text deltas, errors, inbox, and more, and you add your own typed [state](/docs/agents/usage/managing-state) collections per entity type.
48
48
49
49
**Inside a handler.** When a handler calls `ctx.useAgent()`, the runtime configures the agent on its behalf and routes every step — model call, text delta, tool invocation, error — through the same projection, so the agent loop becomes durable events on the entity's stream.
50
50
@@ -75,7 +75,7 @@ registry.define("support", {
75
75
if (wake.type==="inbox") {
76
76
ctx.useAgent({
77
77
systemPrompt: "You are a support agent.",
78
-
model: "claude-sonnet-4-5-20250929",
78
+
model: "claude-sonnet-4-6",
79
79
tools: [...ctx.electricTools, searchKbTool],
80
80
})
81
81
awaitctx.agent.run()
@@ -110,7 +110,7 @@ The core pattern is [`ctx.useAgent()`](/docs/agents/reference/agent-config) foll
110
110
```ts
111
111
ctx.useAgent({
112
112
systemPrompt: "You are a helpful assistant.",
113
-
model: "claude-sonnet-4-5-20250929",
113
+
model: "claude-sonnet-4-6",
114
114
tools: [...ctx.electricTools, myCustomTool],
115
115
})
116
116
@@ -228,5 +228,7 @@ See [Managing state](/docs/agents/usage/managing-state) for more information.
228
228
-[Writing handlers](/docs/agents/usage/writing-handlers) — handler lifecycle and the `ctx` API.
229
229
-[Configuring the agent](/docs/agents/usage/configuring-the-agent) — `useAgent`, models, tools, and streaming.
230
230
-[Spawning & coordinating](/docs/agents/usage/spawning-and-coordinating) — multi-entity topologies and shared state.
231
-
-[Built-in agents](/docs/agents/entities/agents/horton) — Horton, Worker, and Coder, the agents that ship with the runtime.
231
+
-[Permissions & principals](/docs/agents/usage/permissions-and-principals) — entity access control and principal-scoped clients.
232
+
-[Sandboxing](/docs/agents/usage/sandboxing), [Attachments](/docs/agents/usage/attachments), [Signals](/docs/agents/usage/signals), and [Webhook sources](/docs/agents/usage/webhook-sources) — newer runtime capabilities for hosted agents.
233
+
-[Built-in agents](/docs/agents/entities/agents/horton) — Horton and Worker, the agents that ship with the runtime.
232
234
-[Examples](/docs/agents/examples/playground) — pattern walkthroughs and demo apps.
0 commit comments