ViteHub is still experimental. Expect bugs and breaking changes.

Agents

Define a server-side Agent, choose how it runs, and connect it to your application.

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.

Build your first Agent
Define and call an Agent with a complete local example.
Define an Agent
Choose a Driver, Capabilities, Workspace, and Channels.
Choose a Driver
Run a model, Codex, Claude Code, or application code.
Add Capabilities
Give the active Driver selected tools and runtime behavior.

How an Agent fits together

PartWhat you choose
Agent DefinitionOne Agent's Driver, Capabilities, Workspace, Channels, and hooks.
Agent DriverA model, a coding provider, or your own run function.
Agent InvocationThe input for one run and whether the result returns or streams.
CapabilitiesThe tools and behavior available during an invocation.
Workspace contextThe files, Sources, and bindings available to the Agent.
InstructionsDurable 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:

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.