Agents
An Agent is a named server-side program. Its definition records how it runs, which files and tools it can use, and how callers reach it.
Start with an offline Agent if you have not built one yet. The tutorial creates the definition, calls it from an H3 route, and shows the response without a model key or hosted service.
How an Agent fits together
| Part | What you choose |
|---|---|
| Agent Definition | One Agent's Driver, Capabilities, Workspace, Channels, and hooks. |
| Agent Driver | A model, a coding provider, or your own run function. |
| Agent Invocation | The input for one run and whether the result returns or streams. |
| Capabilities | The tools and behavior available during an invocation. |
| Workspace context | The files, Sources, and bindings available to the Agent. |
| Instructions | Durable guidance for a model or coding provider. |
Capabilities grant access deliberately. Adding KV, Blob, a Workspace, or another server feature to the application does not give a model access to it. Attach the matching Capability only when the Agent needs that action.
Connect an Agent
Call an Agent directly from trusted server code, or connect it to a product entry point:
- Channels connect web chat, Discord, Telegram, GitHub, and other message transports.
- Triggers turn application events into Agent input.
- Agent Actors carry trusted caller identity.
- Chat History and sessions select the earlier messages supplied to a chat invocation.
Verify behavior
Use the CLI development loop to inspect and run the Agent locally. Add an Eval for behavior that must keep working. Deployment-specific behavior still needs a build and runtime check on the selected host.
Advanced execution
- Controlled child invocations start, inspect, cancel, or respond to child work from trusted code.
- Boxes prepare a process environment when application code owns that lifecycle.