Parlant is an open-source behavior modeling engine designed for LLM agents. It enables developers to deploy conversational agents that interact with customers exactly as intended. The framework provides the structural discipline required for production-grade chatbots.
An agent may pass every internal test suite, yet falter the moment it encounters real users. In production, performance often degrades quickly:
This unpredictability is the primary gap between a successful demo and a reliable, deployed AI agent. Parlant is built to close that gap.
Parlant shifts the development paradigm. Instead of merely asking an LLM to follow instructions, it makes compliance the default state.
The traditional approach: Probability 🤞
system_prompt = "You are a helpful assistant. Follow these 47 rules..."
The Parlant approach: Enforcement ✅
await agent.create_guideline(
condition="customer asks about a refund",
action="first check order status to see if they qualify",
tools=[check_order_status],
)
Conversation Journeys
Map out specific customer flows and define exactly how the agent should respond at each milestone.
Behavioral Guidelines
Define rules in plain language. Parlant dynamically matches the most relevant guidelines to the current conversation context.
Tool Binding
Link external APIs, data fetchers, or backend services to specific interaction events with precision.
Domain Adaptation
Equip the agent with industry-specific terminology and shape replies to match a personalized brand voice.
Hard-Coded Responses
Utilize response templates to eliminate hallucinations and maintain a consistent communication style.
Explainability
Trace which guideline was triggered and why. Every agent decision is transparent and auditable.
pip install parlant
import parlant.sdk as p
@p.tool
async def get_weather(context: p.ToolContext, city: str) -> p.ToolResult:
# Your weather API logic goes here
return p.ToolResult(f"{city}: sunny, 72°F")
async def main():
async with p.Server() as server:
agent = await server.create_agent(
name="WeatherBot",
description="A helpful weather assistant"
)
# Define behavior in plain English
await agent.create_guideline(
condition="user asks about the weather",
action="fetch the current weather and reply with a friendly suggestion",
tools=[get_weather]
)
# Test UI is ready at http://localhost:8800
# Embed the official React components or build your own frontend
if __name__ == "__main__":
import asyncio
asyncio.run(main())
Your agent is now operational and, more importantly, strictly follows your defined rules.
| Traditional AI Framework | Parlant |
|---|---|
| Relies on complex system prompts | Uses plain-English rules |
| Hopes for LLM compliance | Guarantees compliance |
| Debugs unpredictable outputs | Ensures consistent behavior |
| Scales via prompt engineering | Scales by adding specific guidelines |
| High risk in production | Production-ready from day one |
| Financial Services | Healthcare | E-commerce | Legal Tech |
|---|---|---|---|
| Compliance-first design | HIPAA-aligned interactions | High-volume support | Precise legal guidance |
| Built-in risk controls | Patient data protection | Automated order processing | Document review support |
Once installed, start with a basic agent configuration and layer in behaviors as needed.
# main.py
import asyncio
import parlant.sdk as p
async def main():
async with p.Server() as server:
agent = await server.create_agent(
name="Otto Carmen",
description="You work at a car dealership",
)
asyncio.run(main())
Parlant utilizes async/await patterns, allowing your application to handle multiple tasks concurrently—essential for high-traffic production environments.
By default, Parlant uses OpenAI for natural language processing. Ensure your API key is set before running.
export OPENAI_API_KEY="<your-api-key>"
python main.py
Parlant supports several providers out of the box. These can be accessed via p.NLPServices, or you can implement the p.NLPService interface to use a custom backend.
To specify a provider, pass it during server initialization:
async with p.Server(nlp_service=p.NLPServices.cerebras) as server:
...
Note that some providers may require additional packages:
pip install parlant[cerebras]
Current testing indicates that OpenAI and Anthropic models offer the most reliable performance for completions and JSON schema adherence. It is recommended to start with one of these.
Navigate to http://localhost:8800 to access the built-in UI. Start a new session to begin interacting with your agent.
Guidelines are the foundation of Parlant’s behavior model. They instruct the agent on how to react to specific inputs or environmental conditions. Parlant manages the context of these guidelines internally, meaning you can add a high volume of rules without encountering context window issues or scaling bottlenecks.
# main.py
import asyncio
import parlant.sdk as p
async def main():
async with p.Server() as server:
agent = await server.create_agent(
name="Otto Carmen",
description="You work at a car dealership",
)
##############################
## Add this part: ##
##############################
await agent.create_guideline(
condition="customer greets you",
action="offer them a cold drink",
)
asyncio.run(main())
Rerun your script:
python main.py
Refresh the UI at http://localhost:8800, start a new session, and test the new greeting logic.
For teams building a React-based frontend, the official Parlant component provides the fastest integration path.
import React from 'react';
import ParlantChatbox from 'parlant-chat-react';
function App() {
return (
<div>
<h1>My Application</h1>
<ParlantChatbox
server="PARLANT_SERVER_URL"
agentId="AGENT_ID"
/>
</div>
);
}
export default App;
Parlant provides the necessary scaffolding to move AI agents from experimental demos to reliable production tools. By replacing fragile prompts with enforceable guidelines, your agents become predictable, traceable, and ready for the real world.
Tencent HunyuanVideo-1.5: 8.3B Video Model Runs on 14GB GPUs
PocketBase Review: The All-in-One Go Backend for Solo Developers
AhaSpeed VPN Review: High-Speed Performance, No Ads, and Unlimited Bandwidth
LetsMarkdown: Lightweight Collaborative Markdown Editor Powered by Rust
Claude Code for Windows: Run Natively Without WSL or Docker
Helicone AI Gateway: A High-Performance Rust-Powered LLM Proxy
Paperless GPT: Smarter OCR and Auto-Tagging for Paperless-NGX
Dots.LLM1: 142B MoE Model Trained on 11.2T Real-World Tokens
NPS Proxy: A Powerful Self-Hosted Tunnel to Expose Local Servers
BiliNote: Convert YouTube and Bilibili Videos Into Markdown Notes
Magentic-UI: Multi-Agent Web Automation You Can Watch and Control
How to Add Missing Games to Shendeng VPN’s Library