freshcrate
Home > Frameworks > parlant

parlant

The conversational control layer for customer-facing AI agents - Parlant is a context-engineering framework optimized for controlling customer interactions.

Description

The conversational control layer for customer-facing AI agents - Parlant is a context-engineering framework optimized for controlling customer interactions.

README

Parlant

The interaction control harness for customer-facing AI agents

PyPI Python 3.10+ License Discord GitHub Repo stars Website β€’ Quick Start β€’ Examples β€’ Discord

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:**<br/>Focused Context Window| M[Message Generation]
Loading

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
Loading

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.

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 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],
)

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.

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 interested",
)

# Branch B - interested in deals
t2 = await t0.target.transition_to(
    tool_state=load_latest_flight_deals,
    condition="They are",
)

t3 = await t1.target.transition_to(
    chat_state="List deals and see if they're interested",
)

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.

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 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.

@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.

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

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"],
)

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:

from my_workflows import refund_graph  # a compiled LangGraph StateGraph

@p.tool
async def run_refund_workflow(
  context: p.ToolContext,
  order_id: str
) -> p.ToolResult:
    result = await refund_graph.ainvoke({"order_id": order_id})

    # Graph result can inject both data and instructions into the agent.
    # Instructions are transformed to guidelines, and participate
    # in contextual guideline resolution (including prioritizations)

    return p.ToolResult(
        data=result["data"],
        # Inject dynamic guidelines from workflow result
        guidelines=[
            {"action": inst, "priority": 3} for inst in result["instructions"]
        ],
    )

await agent.create_observation(
    condition="customer wants to process a refund",
    tools=[run_refund_workflow],
)

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

LLM Agnostic

Parlant works with most LLM providers. The recommended ones are Emcie which delivers an ideal cost/quality value since it's built specifically for Parlant, but OpenAI and Anthropic deliver excellent quality outputs as well. You can also use any model and provider via LiteLLM, but they need to be good ones - off-the-shelf models which are too small tend to produce inconsistent results.

Generally, you can swap models without changing behavioral configuration.

Drop-in chat component to get a frontend running immediately.

Learn more

Community

  • Discord β€” ask questions, share what you're building
  • GitHub Issues β€” bug reports and feature requests
  • Contact β€” reach the engineering team directly

If Parlant helps you build better agents, give it a star β€” it helps others find the project.

License

Apache 2.0 β€” free for commercial use.


Try it now β€’ Join Discord β€’ Read the docs

Built by the team at Emcie

Release History

VersionChangesUrgencyDate
v3.3.1## [3.3.1] - 2025-04-14 ### Added - Allow passing ToolId when attaching tools throughout the SDK - Add `AnyOf(tag)` and `AllOf(tag)` modifiers for explicit control over tag dependency semantics in `depend_on()` β€” `AnyOf` requires at least one tagged member to be active, `AllOf` requires all of them (bare `Tag` defaults to `AllOf`) - Add `depend_on_any()` to `Guideline`, `Tag`, and `Journey` for OR dependency relationships β€” at least one target must be active. Multiple `depend_on_any()` cHigh4/14/2026
v3.3.0## [3.3.0] - 2025-03-15 ### Added - Add per-agent planners via `Server.create_agent(planner=...)`, allowing each agent to use a custom `Planner` implementation - Accept `Tag` as a target in `depend_on()`, `exclude()`, and `prioritize_over()` on both `Guideline` and `Tag`, enabling relationships that target all guidelines sharing a custom tag - Add `Tag.depend_on()`, `Tag.exclude()`, and `Tag.prioritize_over()` methods to the SDK, enabling tag-based dependency and priority relationships wMedium3/15/2026
v3.2.1## [3.2.1] - 2026-02-17 ### Added - Add optional `dependencies` parameter to guideline, observation, and journey creation methods - Add `exclude()` as an alias for `prioritize_over()` on guidelines and journeys - Add `tools` parameter to `create_observation` methods ### Changed - Deprecate `attach_tool()` in favor of `create_guideline()`/`create_observation()` with `tools` parameter ### Fixed - Preserve draft message language during canned response recomposition - Fix serverLow2/17/2026
v3.2.0## [3.2.0] - 2026-02-09 ### Added - Add labels to Guidelines, Journeys, JourneyNodes, and Sessions for categorization and filtering - Add automatic session label propagation from matched entities (guidelines, observations, journeys) - Add `track` parameter to guidelines to control "previously applied" tracking - Support multiple targets in `prioritize_over()` and `depend_on()` methods - Add `field_dependencies` to canned responses for explicit field availability requirements - Add `atLow2/9/2026
v3.1.0## [3.1.0] - 2026-01-05 ### Added - Add .current property for Server, Agent, and Customer in SDK - Add /healthz endpoint - Add API for CRUD operations on session metadata - Add EmcieService - Add GLM service - Add Mistral service - Add OpenRouter service - Add OpenTelemetry integration for Meter, Logger and Tracer - Add Qdrant VectorDatabase adapter - Add Snowflake Cortex service - Add ability to configure and extend the FastAPI app object - Add deferred retrievers - Add dynamiLow1/5/2026
v3.0.4## [3.0.4] - 2025-11-18 ### Fixed - Fix bug where NanoDB query failed when no filters matched - Extend tool insights across iterations - Fix deprecated status.HTTP_422_UNPROCESSABLE_ENTITY to status.HTTP_422_UNPROCESSABLE_CONTENT - Fix broken CLI by adding missing websocket-client dependency - Added specific classes for embedder initialisation - Make base url once in OllamaEmbedder - Update dependencies for security, upgrade FastAPI, fix mypy in hugging_face.py - Bump torch for fixiLow11/18/2025
v3.0.3### Fixed - Fix installation issue in some environments, failing due to an older FastMCP version - Bump versions of OpenTelemetry and Uvicorn - Made ChromaDB an extra package parlant[chroma] - Update NPM dependencies for integrated UI - Fix defaults of API types to avoid triggering Pydantic warningsLow10/24/2025
v3.0.2### Added - Added docs/\* and llms.txt - Added Vertex NLP service - Added Ollama NLP service - Added LiteLLM support to the SDK - Added Gemini support to the SDK - Added Journey.create_observation() helper - Added auth permission READ_AGENT_DESCRIPTION - Added optional AWS_SESSION_TOKEN to BedrockService - Support creating status events via the API ### Changed - Moved tool call success log to DEBUG level - Optimized canrep to not generate a draft in strict mode if no canrep canLow8/27/2025
v3.0.1Today we're thrilled to announce **Parlant 3.0**, our most significant release yet. This version transforms Parlant into a truly production-ready conversational AI framework for customer-facing applications. With dramatic performance improvements, enhanced developer experience, and enterprise-grade security features, Parlant 3.0 is ready to fix your hardest AI consistency issues and power your most critical customer-facing applications. ## What's New in Parlant 3.0 This release focuses oLow8/16/2025
v2.2.0## [2.2.0] - 2025-05-20 ### Added - Add journeys - Add of guideline properties evaluation - Add automatic guideline action deduction when adding direct tool guidelines - Added choices of invalid and missing tool parameters to tool insights ### Changed - Make guideline action optionalLow5/20/2025
v2.1.2## [2.1.2] - 2025-05-07 ### Changed - Remove interaction history from utterance recomposition prompt - Use tool calls from the entire interaction for utterance field substitution - Improve error handling and reporting with utterance rendering failures ### Fixed - Always reason about utterance selection to improve performanceLow5/7/2025
v2.1.1## [2.1.1] - 2025-04-30 ### Fixed - Fixed rendering relationships in CLI - Fixed parlant client using old imports from python client SDKLow4/30/2025
v2.1.0## [2.1.0] - 2025-04-29 ### Added - ToolParameterOptions.choice_provider can now access ToolContext - Added utterance/draft toggle in the integrated UI - Added new guideline relationship: Dependency - Added tool relationships and the OVERLAP relationship - Added the 'overlap' property to tools. By default, tools will be assumed not to overlap with each other, simplifying their evaluation at runtime. ### Changed - Improved tool calling efficiency by adjusting the prompt to the tool atLow4/29/2025
v2.0.0# [2.0.0] - 2025-04-09 ### Added - Improved tool parameter flexibility: custom types, Pydantic models, and annotated ToolParameterOptions - Allow returning a new (modified) container in modules using configure_module() - Added Tool Insights with tool parameter options - Added support for default values for tool parameters in tool calling - Added WebSocket logger feature for streaming logs in real time - Added a log viewer to the sandbox UI - Added API and CLI for Utterances - Added suLow4/9/2025
v1.6.7## [1.6.7] - 2025-02-23 ### Fixed - Fix major issue with tool-call inference of non-string parameters on OpenAILow2/23/2025
v1.6.6## [1.6.6] - 2025-02-23 ### Fixed - Fix unicode generation issues in gemini - Adapt tool calling with optional parametersLow2/23/2025
v1.6.5## [1.6.5] - 2025-02-20 ### Fixed - Improve guideline proposer generation consistencyLow2/20/2025
v1.6.4## [1.6.4] - 2025-02-20 ### Fixed - Upgrade to Gemini 2.0 FlashLow2/20/2025
v1.6.3## [1.6.3] - 2025-02-18 ### Fixed - Fix Cerebras generation (as well as other Llama 3 generations)Low2/18/2025
v1.6.2## [1.6.2] - 2025-01-29 ### Fixed - Fix loading DeepSeek service during server bootLow1/29/2025
v1.6.1## [1.6.1] - 2025-01-20 ### Fixed - Fix ToolCaller not getting clear information on a parameter being optional - Ensure ToolCaller only calls a tool if all required args were given - Improve valid JSON generation likelihood in MessageEventGenerator - Improve ToolCaller's ability to correctly run multiple tools at once Low1/20/2025
v1.6.0## [1.6.0] - 2025-01-19 ### Added - Add shot creation helper functions under Shot - Add ContextEvaluation in MessageEventGenerator - Add a log command under client CLI for streaming logs - Add engine lifecycle hooks ### Changed - Split vendor dependencies to extra packages to avoid reduce installation time - Modified ToolCaller shot schema - Disable coherence and connection checking by default in the CLI for now ### Fixed - Improved GuidelineProposer's ability to handle compoundLow1/19/2025
v1.5.1## [1.5.1] - 2025-01-05 ### Fixed - Fix server CLI bootLow1/5/2025
v1.5.0## [1.5.0] - 2025-01-04 ### Added - Add DeepSeek provider support (via DeepSeekService) ### Changed - Change default home dir from runtime-data to parlant-data ### Fixed - Fix tool-calling test - Fix HuggingFace model loading issuesLow1/4/2025
v1.4.3## [1.4.3] - 2025-01-02 ### Fixed - Upgraded dependency "tiktoken" to 0.8.0 to fix installation errors on some environmentsLow1/2/2025
v1.4.2## [1.4.2] - 2024-12-31 ### Fixed - Fix race condition in JSONFileDocumentDatabase when deleting or updating documentsLow1/1/2025
v1.4.1## [1.4.1] - 2024-12-31 ### Changed - Remove tool metadata from prompts - agents are now only aware of the data itself ### Fixed - Fix tool calling in scenarios where a guideline has multiple tools where more than one should run Low12/31/2024
v1.4.0## [1.4.0] - 2024-12-31 ### Added - Support custom plugin data for PluginServer - Allow specifying custom logger ID when creating loggers - Add 'hosted' parameter to PluginServer, for running inside modules ### Fixed - Fix the tool caller's few shots to include better rationales and arguments.Low12/31/2024
v1.3.1## [1.3.1] - 2024-12-27 ### Changed - Return event ID instead of correlation ID from utterance API - Improve and normalize entity update messages in client CLILow12/27/2024
v1.3.0## [1.3.0] - 2024-12-26 ### Added - Add manual utterance requests - Refactor few-shot examples and allow adding more examples from a module - Allow tapping into the PluginServer FastAPI app to provide additional custom endpoints - Support for union parameters ("T | None") in tool functions ### Changed - Fix 404 not being returned if a tool service isn't found - Made all stores thread-safe with reader/writer locks - Fixed having direct calls to asyncio.gather() instead of safe_gatherLow12/27/2024
v1.2.0## [1.2.0] - 2024-12-19 ### Added - Expose deletion flag for events in Session API ### Changed - Print traceback when reporting server boot errors - Make cancelled operations issue a warning rather than an error ### Fixed - Fixed tool calling with optional parameters - Fixed sandbox UI issues with message regeneration and status icon - Fixed case where guideline is applied due to condition being partially applied ### Removed None Low12/19/2024
v1.1.0## [1.1.0] - 2024-12-18 ### Added - Customer selection in sandbox Chat UI - Support tool calls with freshness rules for context variables - Add support for loading external modules for changing engine behavior programmatically - CachedSchematicGenerator to run the test suite more quickly - TransientVectorDatabase to run the test suite more quickly ### Changed - Changed model path for Chroma documents. You may need to delete your `runtime-data` dir. ### Fixed - Improve handling ofLow12/18/2024

Dependencies & License Audit

Loading dependencies...

Similar Packages

langgraphBuild resilient language agents as graphs.1.1.9
agents-commanderTerminal UI for managing multiple AI agent CLIs0.1.3
langchainThe agent engineering platformlangchain-openai==1.1.16
crewAIFramework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.1.14.3a2
MeowKitProduction ready. AI Agent Workflow System for Claude Codev2.6.0