Skip to main content

Basic Agent

The simplest possible agent — just a name, model, and instructions.

Agent with Tools

Use defineTool() with a Zod schema to give your agent capabilities beyond text generation.

Multi-tool Agent

Agents can use multiple tools. The LLM decides which tool(s) to call based on the user’s request.

Structured Output

Force the agent to return typed JSON matching a Zod schema. The structured field on the result is parsed and type-safe.

Multimodal Input

Send images alongside text. The agent can analyze, describe, or compare visual content.

Audio Input

Process audio files for transcription, analysis, or conversational responses.

Reasoning / Extended Thinking

Enable reasoning for complex tasks. The model “thinks” step by step before responding, and the thinking trace is available in the output.

Hooks and Guardrails

Use lifecycle hooks for observability and guardrails for safety. Guardrails run before/after the LLM call and can reject requests.

Tool Caching

Avoid redundant API calls by caching tool results with a TTL.

Agent with Approval

Require human approval before executing dangerous tools. The approval callback lets you integrate with Slack, email, or a custom UI.

Sandboxed Tool Execution

Run untrusted code in an isolated sandbox with configurable timeouts, memory limits, and filesystem restrictions.

Custom Logging

Control log verbosity and hook into the agent’s internal logging.

Per-Request API Keys

Pass API keys at runtime for multi-tenant apps where each customer has their own key.

Agent with Handoff

Two agents that can hand off to each other. When the sales agent detects a support question, it transfers the conversation to the support agent, and vice versa.