What you’ll learn
- Creating an Agent with a model and system prompt
- Running the agent with
agent.run() - Reading the output with
result.output
Prerequisites
- Vibes installed (Installation guide)
ANTHROPIC_API_KEYset in environment
Complete example
Run it
How it works
Model:anthropic("claude-haiku-4-5-20251001") creates a model instance using the Vercel AI SDK Anthropic provider. Any Vercel AI SDK-compatible model works here.
System Prompt: Sets the agent’s persona. Vibes supports both static strings and dynamic functions - see the Agents concept page.
result.output: For agents without outputSchema, output is a string. Add outputSchema with a Zod schema to get structured output - see the Weather Agent example.
Next steps
- Weather Agent - add tools and structured output
- Bank Support - dependency injection and complex output