Agents
Give an agent a task:
await assistant.run("List the tasks.");Set up this offline assistant. It returns two example tasks without calling a live model.
Agents 0.4.3 is an experimental package built on Core. It runs tools, coordinates specialists and records execution so your host can save and resume work. Its API may change before 1.0.
Build the execution you need
Section titled “Build the execution you need”Use an agent when a model should choose the next tool. Use a workflow when your code chooses the steps. Both share child execution, request handling and tree-wide limits.
- Start with conversation input and media and tools and guards.
- Ask the person a question or approval, then continue from an authorized answer.
- Add specialists or model-created helpers, with capabilities your host grants.
- Keep memory in a store your app controls.
- Let a model combine tools in bounded code mode, or connect MCP tools.
- Call or serve remote agents through A2A.
- Check behavior with evals and observe execution with tracing.
What stays in your app
Section titled “What stays in your app”You decide who may run a tool, approve it or resume saved work. Snapshots contain private input and execution data. Keep them out of browser responses and use React’s server projector for the fields a viewer may see.
The main entry has no database, queue or vendor SDK dependency. Background runs use your existing run service, not an SDK scheduler. A checkpoint or idempotency key alone does not prove that an interrupted external action did not happen.
Core owns provider routing and stream retries. Agents adds explicit policies for execution recovery and tool retries, without silently replaying unknown work.
Upgrade from 0.1
Section titled “Upgrade from 0.1”Use Core ^0.35.1 or ^0.36.0. Finish old runs before upgrading: format-2 snapshots are not accepted by the
format-3 runtime. Replace the old single approval decision with the request-keyed host contract.
Execution trees can contain agent, workflow and remote nodes; check kind before reading
model journals or workflow steps.