MCPcopy
hub / github.com/emcie-co/parlant

github.com/emcie-co/parlant @v3.3.2 sqlite

repository ↗ · DeepWiki ↗ · release v3.3.2 ↗
7,166 symbols 31,229 edges 360 files 971 documented · 14%
README

Parlant

The conversational control layer for customer-facing AI agents

PyPI Python 3.10+ License Discord GitHub Repo stars

WebsiteQuick StartExamplesDiscord

Deutsch | Español | français | 日本語 | 한국어 | Português | Русский | 中文

Trending

 

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

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

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.

Parlant Demo

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

pip install parlant
import parlant.sdk as p

async with p.Server():
    agent = await server.create_agent(
        name="Customer Support",
        description="Handles customer inquiries for an airline",
    )

    # Evaluate and call tools only under the right conditions
    expert_customer = await agent.create_observation(
        condition="customer uses financial terminology like DTI or amortization",
        tools=[research_deep_answer],
    )

    # When the expert observation holds, always respond
    # with depth. Set the guideline to automatically match
    # whenever the observation it depends on holds...
    expert_answers = await agent.create_guideline(
        matcher=p.MATCH_ALWAYS,
        action="respond with technical depth",
        dependencies=[expert_customer],
    )

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

    # When both match, beginners wins. Neither expert-level
    # tool-data nor instructions can enter the agent's context.
    await beginner_answers.exclude(expert_customer)

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.

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:**

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.

%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#e8f5e9', 'primaryTextColor': '#1b5e20', 'primaryBorderColor': '#81c784', 'lineColor': '#66bb6a', 'secondaryColor': '#fff9e1', 'tertiaryColor': 'transparent'}}}%%
flowchart LR
    A(User):::outputNode

    subgraph Engine["Parlant Engine"]
        direction LR
        B["Match Guidelines and Resolve Journey States"]:::matchNode
        C["Call Contextually-Associated Tools and Workflows"]:::toolNode
        D["Generated Message"]:::composeNode
        E["Canned Message"]:::cannedNode
    end

    A a@-->|💬 User Input| B
    B b@--> C
    C c@-->|Fluid Output Mode?| D
    C d@-->|Strict Output Mode?| E
    D e@-->|💬 Fluid Output| A
    E f@-->|💬 Canned Output| A

    a@{animate: true}
    b@{animate: true}
    c@{animate: true}
    d@{animate: true}
    e@{animate: true}
    f@{animate: true}

    linkStyle 2 stroke-width:2px
    linkStyle 4 stroke-width:2px
    linkStyle 3 stroke-width:2px,stroke:#3949AB
    linkStyle 5 stroke-width:2px,stroke:#3949AB

    classDef composeNode fill:#F9E9CB,stroke:#AB8139,stroke-width:2px,color:#7E5E1A,stroke-width:0
    classDef cannedNode fill:#DFE3F9,stroke:#3949AB,stroke-width:2px,color:#1a237e,stroke-width:0

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.

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.

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.

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.

```python journey = await agent.create_journey( title="Book Flight", description="Guide the customer through flight booking", conditions=["customer wants to book a flight"], )

t0 = await journey.initial_state.transition_to( # Instruction to follow while in this state (could be multiple turns) chat_state="See if they're interested in last-minute deals", )

Branch A - not interested in deals

t1 = await t0.target.transition_to( chat_state="Determine where they want to go and when", condition="They aren't inter

Extension points exported contracts — how you extend this code

FlagMessageProps (Interface)
(no doc)
src/parlant/api/chat/src/components/message-details/flag-message.tsx
DefInterface (Interface)
(no doc)
src/parlant/api/chat/src/components/message-details/filter-tabs.tsx
Filter (Interface)
(no doc)
src/parlant/api/chat/src/components/message-details/filter-tabs.tsx
FilterTabsFilterProps (Interface)
(no doc)
src/parlant/api/chat/src/components/message-details/filter-tabs.tsx
Props (Interface)
(no doc)
src/parlant/api/chat/src/components/message-details/empty-state.tsx

Core symbols most depended-on inside this repo

get
called by 457
src/parlant/core/nlp/embedding.py
append
called by 380
src/parlant/core/shots.py
get
called by 329
src/parlant/sdk.py
create_relationship
called by 261
src/parlant/bin/client.py
create_journey
called by 188
src/parlant/sdk.py
get
called by 171
src/parlant/core/engines/alpha/entity_context.py
transition_to
called by 167
src/parlant/sdk.py
add_section
called by 167
src/parlant/core/engines/alpha/prompt_builder.py

Shape

Method 3,533
Function 2,149
Class 1,298
Route 150
Interface 36

Languages

Python97%
TypeScript3%

Modules by API surface

src/parlant/bin/client.py313 symbols
src/parlant/sdk.py259 symbols
tests/sdk/test_journeys.py181 symbols
tests/sdk/test_guidelines.py147 symbols
tests/core/stable/engines/alpha/test_guideline_matcher.py126 symbols
tests/core/stable/engines/alpha/test_relational_resolver.py109 symbols
src/parlant/core/sessions.py107 symbols
src/parlant/core/journeys.py100 symbols
tests/api/test_sessions.py78 symbols
src/parlant/core/evaluations.py75 symbols
src/parlant/api/sessions.py75 symbols
src/parlant/core/engines/alpha/canned_response_generator.py74 symbols

Dependencies from manifests, versioned

@codemirror/basic-setup0.20.0 · 1×
@codemirror/lang-javascript6.2.3 · 1×
@codemirror/search6.5.10 · 1×
@codemirror/state6.5.2 · 1×
@codemirror/view6.36.4 · 1×
@eslint/js9.11.1 · 1×
@radix-ui/react-checkbox1.1.3 · 1×
@radix-ui/react-dialog1.1.6 · 1×
@radix-ui/react-dropdown-menu2.1.4 · 1×
@radix-ui/react-radio-group1.2.2 · 1×

Datastores touched

(mongodb)Database · 1 repos

For agents

$ claude mcp add parlant \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact