Quickstart

Go from zero to a working multi-agent system in under 5 minutes.

1. Create your first agent

An agent is the core unit. It has a name, a system prompt that defines its role, and a model.

basic_agent.py
from veska import Agent

agent = Agent(
    name="assistant",
    system_prompt="You are a helpful coding assistant.",
    model="claude-sonnet-4-6",
)

result = agent.run("Explain what a decorator is in Python")
print(result.output)

2. Add tools

Give your agent tools so it can take actions. Just write a function and add the @tool decorator.

agent_with_tools.py
from veska import Agent, tool

@tool
def get_weather(city: str):
    return f"Weather in {city}: 72°F, sunny"

agent = Agent(
    name="weather-bot",
    system_prompt="You help users check the weather. Use the 'get_weather' tool.",
    model="claude-sonnet-4-6",
    tools=[get_weather],
)

result = agent.run("What's the weather in Paris?")
print(result.output)

3. Stream responses

Stream tokens in real-time instead of waiting for the full response.

streaming.py
from veska import Agent

agent = Agent(
    name="writer",
    system_prompt="You are a creative writer.",
    model="claude-sonnet-4-6",
)

# Stream to console
result = agent.run("Write a haiku about coding", stream=True)

# Or stream to a custom function
def on_token(text):
    my_ui.append(text)

result = agent.run("Write a haiku about coding", stream=on_token)

4. Get structured output

Define the output format you want, and Veska forces the AI to return exactly that structure. If validation fails, Veska retries automatically.

structured.py
from veska import Agent

agent = Agent(
    name="reviewer",
    system_prompt="You review movies.",
    model="claude-sonnet-4-6",
    output_format={
        "title": str,
        "rating": float,
        "summary": str,
        "recommend": bool,
    }
)

result = agent.run("Review the movie Inception")

print(result.output["title"])        # "Inception"
print(result.output["rating"])       # 9.0
print(result.output["recommend"])    # True

5. Build a multi-agent system

Use the Orchestrator to coordinate multiple agents. It plans the work, delegates to specialists, and collects results.

multi_agent.py
from veska import Agent, Orchestrator

researcher = Agent(
    name="researcher",
    system_prompt="You research topics thoroughly and provide detailed findings.",
    model="claude-sonnet-4-6",
)

writer = Agent(
    name="writer",
    system_prompt="You write clear, engaging content based on research.",
    model="claude-sonnet-4-6",
)

orchestrator = Orchestrator(
    model="claude-sonnet-4-6",
    agents=[researcher, writer],
    tools=["file_manager"],
)

result = orchestrator.run("Write a blog post about AI agents")
print(result.results)

What's next?

You've built your first agent, added tools, streamed output, and created a multi-agent system. Dive deeper into each concept: