Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

parlant

> AI 编程
Open source

Build reliable customer-facing AI agents with Parlant: an interaction control harness optimized for controlled, consistent, and predictable LLM interactions.

18.2K stars0 likes4 views
WebsiteGitHub

About

Build reliable customer-facing AI agents with Parlant: an interaction control harness optimized for controlled, consistent, and predictable LLM interactions.

 

Looking for an open-source alternative to Ada, Decagon, or Sierra?

Parlant is production-ready. It streamlines the development and maintenance of enterprise-grade B2C (business-to-consumer) and sensitive B2B interactions that need to be consistent, compliant, on-brand, and comprehensively traceable.

Why Parlant?

Conversational context engineering is hard because real-world interactions are diverse, nuanced, and non-linear.

❌ The Problem: What you've probably tried and couldn't get to work at scale

System prompts work until production complexity kicks in. The more instructions you add to a prompt, the faster your agent stops paying attention to any of them.

Routed graphs solve the prompt-overload problem, but the more routing you add, the more fragile it becomes when faced with the chaos of natural interactions.

🔑 The Solution: Context engineering, optimized for conversational control

Parlant is an agentic harness offering optimized context engineering for conversational use cases: getting the right context, no more and no less, into the prompt at the right time. You define rules, knowledge, and tools once, while the engine narrows the context down in real-time to what's immediately relevant to each turn of the conversation.

How is Parlant different from LangGraph or DSPy?

Parlant focuses on conversational governance and behavioral control and consistency, while LangGraph is ideal for workflow automation, and DSPy is ideal for low-level prompt optimization.

Design goals

Parlant is built around three goals that shape every decision in the framework:

1. Maximum control over the conversation experience

Parlant was designed around a simple idea: developers should be able to control the agent's behavior with precision. In customer-facing conversations, small details matter, like tone, timing, edge cases, policy constraints, and brand voice. So we chose a design that makes these aspects easily configurable and manageable. That approach adds complexity, but it gives teams tighter control over how the agent behaves in real conversations.

2. Maximum prevention of unwanted behaviors

Parlant treats misalignment as a core design problem. It builds on research into model accuracy and consistency so that it is structurally harder for the agent to behave outside its intended boundaries, and easier to detect and correct when it does. Rather than bolting guardrails onto the output, Parlant applies constraints and control points into how your LLMs are used in the first place to produce safe and correct output.

3. Fastest path from product feedback to implementation

Parlant seeks to allow those responsible for the agent's conversational experience to shape its behavior in an intuitive manner, enabling a rapid feedback cycle that engineers can accomodate. Parlant is designed to allow you to incorporate ongoing product feedback as quickly as possible, without manual rewiring of graphs or fine-tuning of models, ensuring that valuable engineering time is only needed for deeper changes, not minor adjustments.

Getting started

bash
pip install parlant
…

Follow the 5-minute quickstart for a full walkthrough.

Parlant at a glance

You define your agent's behavior in code (not prompts), and the engine dynamically narrows the context on each turn to only what's immediately relevant, so the LLM stays focused and your agent stays aligned.

mermaid
graph TD
    O[Observations] -->|Events| E[Contextual Matching Engine]
    G[Guidelines] -->|Instructions| E
    J["Journeys (SOPs)"] -->|Current Steps| E
    R[Retrievers] -->|Domain Knowledge| E
    GL[Glossary] -->|Domain Terms| E
    V[Variables] -->|Memories| E
    E -->|Tool Requests| T[Tool Caller]
    T -.->|Results + Optional Extra Matching Iterations| E
    T -->|**Key Result:**<br/>Focused Context Window| M[Message Generation]

Instead of sending a large system prompt followed by a raw conversation to the model, Parlant first assembles a focused context — matching only the instructions and tools relevant to each conversational turn — then generates a response from that narrowed context.

…

In this way, adding more rules makes the agent smarter, not more confused — because the engine filters context relevance, not the LLM.

Is Parlant for you?

Parlant is built for teams that need their AI agent to behave reliably in front of real customers. It's a good fit if:

  • You're building a customer-facing agent — support, sales, onboarding, advisory — where tone, accuracy, and compliance matter.
  • You have dozens or hundreds of behavioral rules and your system prompt is buckling under the weight.
  • You're in a regulated or high-stakes domain (finance, insurance, healthcare, telecom) where every response needs to be explainable and auditable.

Parlant is deployed in production at the most stringent organizations, including banks.

Parlant isn't just a framework. It's a high-level software that solves the conversational modeling problem head-on. — Sarthak Dalabehera, Principal Engineer, Slice Bank

By far the most elegant conversational AI framework that I've come across. — Vishal Ahuja, Senior Lead, Applied AI, JPMorgan Chase

Parlant dramatically reduces the need for prompt engineering and complex flow control. Building agents becomes closer to domain modeling. — Diogo Santiago, AI Engineer, Orcale

Features

  • Guidelines — Behavioral rules as condition-action pairs; the engine matches only what's relevant per turn.

  • Relationships — Dependencies and exclusions between guidelines to keep the context narrow and focused.

  • Journeys — Multi-turn SOPs that adapt to how the customer actually interacts.

  • Canned Responses — Pre-approved response templates that eliminate hallucination at critical moments.

  • Tools — External APIs and workflows, triggered only when their observation matches.

  • Glossary — Domain-specific vocabulary so the agent understands customer language.

  • Explainability — Full OpenTelemetry tracing — every guideline match and decision is logged.

Guidelines

Behavioral rules as condition-action pairs: when the condition applies, the action kicks into context.

Instead of cramming all guidelines in a single prompt, the engine evaluates which ones apply on each conversational turn and only includes the relevant ones in the LLM's context.

This lets you define hundreds of guidelines without degrading adherence.

python
await agent.create_guideline(
    condition="customer uses financial terminology like DTI or amortization",
    action="respond with technical depth — skip basic explanations",
)

Relationships

Relationships between elements help you keep the final context just right: narrow and focused.

Exclusion relationships keep certain guidelines out of the model's attention when conflicting ones are matched.

python
for_experts = await agent.create_guideline(
    condition="customer uses financial terminology",
    action="respond with technical depth",
)

for_beginners = await agent.create_guideline(
    condition="customer seems new to the topic",
    action="simplify and use concrete examples",
)

# In conflicting reads of the customer, set which takes priority
await for_beginners.exclude(for_experts)

Dependency relationships ensure a guideline only activates when another one has set the stage, helping you create topic-based guideline hierarchies.

python
suspects_fraud = await agent.create_observation(
    condition="customer suspects unauthorized transactions on their card",
)

await agent.create_guideline(
    condition="customer wants to take action regarding the transaction",
    action="ask whether they want to dispute the transaction or lock the card",
    # Only activates when fraud suspicion has been established
    dependencies=[suspects_fraud],
)

Journeys

Multi-turn SOPs (Standard Operating Procedures). Define a flow for processes like booking, troubleshooting, or onboarding. The agent follows the flow but adapts — it can fast-forward states, revisit earlier ones, or adjust pace based on how the customer interacts.

…

Canned Responses

At critical moments or conversational events, limit the agent to using only pre-approved response templates.

After running the matching sequence and drafting a message to the customer, the agent selects the template that best matches its generated draft instead of sending it directly, eliminating hallucination risk entirely and keeping wording exact to the letter.

python
await agent.create_guideline(
    condition="The customer discusses things unrelated to our business"
    action="Tell them you can't help with that",
    # Strict composition mode triggers when this guideline
    # matches - the rest of the agent stays fluid
    composition_mode=p.CompositionMode.STRICT,
    canned_responses=[
        await agent.create_canned_response(
            "Sorry, but I can't help you with that."
        )
    ],
    priority=100,  # Top priority, focuses the agent on this alone
)

Tools

Tools activate only when their observation matches; they don't sit in the context permanently. This prevents the false-positive invocations that plague traditional LLM tool setups.

python
@p.tool
async def query_docs(context: p.ToolContext, user_query: str) -> p.ToolResult:
    results = search_knowledge_base(user_query)
    return p.ToolResult(results)

await agent.create_observation(
    condition="customer asks about service features",
    tools=[query_docs],
)

Tools can also feed custom values into canned response templates.

Glossary

Domain-specific vocabulary for your agent. Map colloquial terms and synonyms to precise business definitions so the agent understands customer language.

python
await agent.create_term(
    name="Ocean View",
    description="Room category with direct view of the Atlantic",
    synonyms=["sea view", "rooms with a view to the Atlantic"],
)

Explainability

Every decision is traced with OpenTelemetry. Parlant ships out of the box with elaborate logs, metrics, and traces.

Framework Integration

Parlant handles conversational governance; it doesn't replace your existing stack.

Use it alongside frameworks like LangGraph, Agno, LlamaIndex, or others for workflow automation and knowledge retrieval. Parlant takes over the behavioral control layer while your framework of choice handles the rest of your agent's processing logic.

Any external workflow or agent becomes a Parlant tool, triggered only when relevant:

…

The same pattern works with LlamaIndex query engines, Agno agents, or any async Python function.

LLM Agnostic

Parlant works with

Issues· 40 open

View all issuesOpen on GitHub
  • #829

    fix: embedding cache migration preserves the legacy document version

    Updated Jul 26, 2026
  • #818

    [Enhancement] Add Valkey as a VectorDatabase backend

    Updated Jun 30, 2026
  • #821

    [Enhancement] MongoDB runtime store startup is slow due to full collection scan

    enhancementUpdated Jun 30, 2026
  • #819

    [Bug] <SDK accepts cross-journey transitions and later crashes journey projection with `KeyError`>

    bugUpdated Jun 30, 2026
  • #813

    [Enhancement] Better templating

    enhancementUpdated Jun 18, 2026
  • #782

    [Enhancement] Extend the DI container

    enhancementUpdated May 13, 2026
  • #532

    [Enhancement] More complex example

    enhancementUpdated May 7, 2026
  • #759

    Security: Prompt injection via fake system context in user messages

    Updated Apr 8, 2026
  • #678

    [Enhancement] xllamacpp NLP adapter

    enhancementUpdated Jan 26, 2026
  • #690

    [Enhancement] Local Content Moderation

    enhancementUpdated Dec 29, 2025

> Tags

Pythonai-agentsai-alignmentcustomer-servicecustomer-success

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.