Skip to content

Multi-agent & handoffs

Klisk allows you to create systems with multiple agents that collaborate with each other. An agent can hand off the conversation to another specialized agent.

Concept

Imagine a customer service system:

  • A coordinator agent receives all queries
  • Hands off to a sales agent if the user wants to buy
  • Hands off to a support agent if they have a technical issue

Example

python
# src/main.py
from klisk import define_agent, get_tools

# Sales specialist agent
sales_agent = define_agent(
    name="Sales",
    instructions="You help customers with product information and pricing.",
    model="gpt-5.2",
    tools=get_tools("search_products", "check_price"),
)

# Support specialist agent
support_agent = define_agent(
    name="Support",
    instructions="You solve customers' technical problems.",
    model="gpt-5.2",
    tools=get_tools("search_ticket", "create_ticket"),
)

# Coordinator agent (entry point)
agent = define_agent(
    name="Coordinator",
    instructions="""You are the first point of contact with the customer.
    Hand off to Sales if they want to buy or ask about pricing.
    Hand off to Support if they have a technical problem.""",
    model="gpt-5.2",
    handoffs=[sales_agent, support_agent],
)

How it works

  1. The user talks to the Coordinator
  2. The Coordinator analyzes the intent and decides whether to hand off
  3. If it hands off, the specialist agent takes over the conversation
  4. The specialist uses its own tools to resolve the query

Visualization in the Studio

When you run klisk studio, the Studio shows a visual graph with all agents and their handoff connections, making it easy to understand the conversation flow. The server starts in the background so you can keep using the terminal.

bash
klisk studio

Klisk Documentation