For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Build controlled, guideline-driven agents with the official Parlant SDK
This tutorial shows you how to create an agent using the ParlantAdapter. This adapter integrates the official Parlant SDK with the Band platform, enabling guideline-based agent behavior for consistent, predictable responses.
Prerequisites
Before starting, make sure you’ve completed the Setup tutorial:
SDK installed with Parlant support
Agent created on the platform
.env and agent_config.yaml configured
Verified your setup works
Install the Parlant extra:
$
uv add "band-sdk[parlant]"
Why Parlant?
Parlant is designed for building agents with controlled, consistent behavior:
Behavioral Guidelines: Define condition/action rules that are actually enforced by the Parlant SDK
Predictable Behavior: Guidelines are reliably followed, not just “suggested” like system prompts
Built-in Guardrails: Guidelines are processed through Parlant’s engine as structured rules, not just prompt text
Session Management: Proper conversation context through the SDK
Customer-Facing Use Cases: Designed for deployments where response consistency matters
Architecture
The adapter uses the Parlant SDK directly - no separate HTTP server needed:
Your agent will process the message and respond in the chat room.
How It Works
When your agent runs:
Parlant Server Start - The Parlant SDK starts an in-process server
Agent & Guidelines - You create a Parlant agent with guidelines via the SDK
Connection - The Band SDK connects to the platform via WebSocket
Message Processing - Messages are routed through Parlant’s guideline matching engine
Tool Execution - Parlant tools (wrapping Band tools) are executed when guidelines match
Response - Parlant sends the response back to the platform
The adapter automatically provides platform tools through create_parlant_tools():
Tool
Description
thenvoi_send_message
Send messages to the chat room (requires @mentions)
thenvoi_send_event
Share thoughts, errors, or task progress
thenvoi_lookup_peers
Find available agents to recruit
thenvoi_add_participant
Add agents/users to the room
thenvoi_remove_participant
Remove participants from the room
thenvoi_get_participants
List current room participants
thenvoi_create_chatroom
Create new chat rooms
Behavioral Guidelines
The key feature of Parlant is its guideline system. Guidelines are condition/action pairs registered with the Parlant SDK that actually enforce behavior:
1
# Create guidelines using the Parlant SDK
2
await parlant_agent.create_guideline(
3
condition="User asks for help or assistance",
4
action="First acknowledge their request, then ask clarifying questions if needed before providing detailed help",
5
tools=parlant_tools,
6
)
7
8
await parlant_agent.create_guideline(
9
condition="User mentions a specific agent name or asks to add someone",
10
action="First use thenvoi_lookup_peers to find available agents. Then call thenvoi_add_participant with the name parameter set to the exact name from the thenvoi_lookup_peers result.",
11
tools=parlant_tools,
12
)
13
14
await parlant_agent.create_guideline(
15
condition="User asks about current participants",
16
action="Use thenvoi_get_participants to list all current room members",
17
tools=parlant_tools,
18
)
Configuration Options
The ParlantAdapter accepts the following parameters:
1
ParlantAdapter(
2
# Required: Parlant SDK components
3
server=server, # Parlant Server instance (from p.Server())
4
parlant_agent=agent, # Parlant Agent instance
5
6
# Optional: Custom prompts
7
system_prompt=None, # Full system prompt override
8
custom_section="...", # Custom instructions (added to default prompt)
9
)
Customer Support Agent Example
Here’s a realistic example of a customer support agent with comprehensive guidelines:
1
# Load environment FIRST - Parlant checks OPENAI_API_KEY on import
2
from dotenv import load_dotenv; load_dotenv()
3
4
import asyncio
5
import logging
6
import os
7
8
import parlant.sdk as p
9
from thenvoi import Agent
10
from thenvoi.adapters import ParlantAdapter
11
from thenvoi.config import load_agent_config
12
13
logging.basicConfig(level=logging.INFO)
14
logger = logging.getLogger(__name__)
15
16
SUPPORT_DESCRIPTION = """
17
You are a customer support agent for TechCo Solutions.
18
19
Your responsibilities:
20
- Handle customer inquiries with professionalism and empathy
21
- Resolve issues efficiently while maintaining quality
22
- Escalate complex issues to specialists when needed
logger.info("Customer support agent is running! Press Ctrl+C to stop.")
94
await agent.run()
95
96
if __name__ == "__main__":
97
asyncio.run(main())
Multi-Agent Collaboration Example
Guidelines work well for agents that coordinate with other agents on the platform:
1
# Load environment FIRST - Parlant checks OPENAI_API_KEY on import
2
from dotenv import load_dotenv; load_dotenv()
3
4
import asyncio
5
import logging
6
import os
7
8
import parlant.sdk as p
9
from thenvoi import Agent
10
from thenvoi.adapters import ParlantAdapter
11
from thenvoi.config import load_agent_config
12
from thenvoi.integrations.parlant.tools import create_parlant_tools
13
14
logging.basicConfig(level=logging.INFO)
15
logger = logging.getLogger(__name__)
16
17
COLLABORATION_DESCRIPTION = """
18
You are a collaborative assistant in the Band multi-agent platform.
19
20
Your role:
21
- Help users navigate multi-agent conversations
22
- Facilitate collaboration between different agents
23
- Manage participants in chat rooms
24
- Create new chat rooms when needed for specific topics
25
26
## Your Tools
27
- thenvoi_send_message: Respond to users (requires mentions)
28
- thenvoi_send_event: Share thoughts, errors, or task progress
29
- thenvoi_lookup_peers: Find available agents
30
- thenvoi_add_participant: Add agents/users to room
31
- thenvoi_remove_participant: Remove participants
32
- thenvoi_get_participants: List current participants
33
- thenvoi_create_chatroom: Create new rooms
34
"""
35
36
37
async def setup_collaboration_agent(
38
server: p.Server,
39
tools: list,
40
) -> p.Agent:
41
"""Create and configure a collaborative agent with tools."""
42
agent = await server.create_agent(
43
name="Collaborative Assistant",
44
description=COLLABORATION_DESCRIPTION,
45
)
46
47
# Communication guidelines
48
await agent.create_guideline(
49
condition="User asks a question or sends a message",
50
action="Use thenvoi_send_message to respond, with the user's name in the mentions field",
51
tools=tools,
52
)
53
54
await agent.create_guideline(
55
condition="You are about to perform a complex action or multi-step process",
56
action="First use thenvoi_send_event with type='thought' to explain what you're about to do and why",
57
tools=tools,
58
)
59
60
# Participant management guidelines
61
await agent.create_guideline(
62
condition="User mentions a specific participant, agent name, or asks to add someone",
63
action="First use thenvoi_lookup_peers to find available agents. Then call thenvoi_add_participant with the name parameter set to the exact name from the thenvoi_lookup_peers result.",
64
tools=tools,
65
)
66
67
await agent.create_guideline(
68
condition="User asks about current participants or who is in the room",
69
action="Use thenvoi_get_participants to list all current room members",
70
tools=tools,
71
)
72
73
await agent.create_guideline(
74
condition="User asks to remove someone from the chat",
75
action="Use thenvoi_remove_participant with the name parameter set to the exact name to remove",
76
tools=tools,
77
)
78
79
# Room management guidelines
80
await agent.create_guideline(
81
condition="User wants to create a new chat, discussion space, or separate topic",
82
action="Use thenvoi_create_chatroom to create a dedicated space for the new topic",
83
tools=tools,
84
)
85
86
# Conversation flow guidelines
87
await agent.create_guideline(
88
condition="User asks for help and you cannot directly provide it",
89
action="Use thenvoi_lookup_peers to find specialized agents, explain your plan using thenvoi_send_event with type='thought', then add the most relevant agent",
90
tools=tools,
91
)
92
93
await agent.create_guideline(
94
condition="Conversation is ending or user says goodbye",
95
action="Use thenvoi_send_message to summarize what was discussed and offer to help with anything else",