Skip to main content
The minimal Vibes agent: import, create, run.

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

Complete example

import { Agent } from "npm:@vibesjs/sdk";
import { anthropic } from "npm:@ai-sdk/anthropic";

const agent = new Agent({
  model: anthropic("claude-haiku-4-5-20251001"),
  systemPrompt: "You are a helpful assistant.",
});

const result = await agent.run("What is the capital of France?");
console.log(result.output);
// "The capital of France is Paris."

Run it

deno run --allow-net --allow-env hello-world.ts

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