An open API service indexing awesome lists of open source software.

https://github.com/emcie-co/parlant

Control GenAI interactions with power, precision, and consistency using LLM-native Conversation Design paradigms
https://github.com/emcie-co/parlant

ai-agents ai-alignment customer-service customer-success gemini genai llama3 llm openai python

Last synced: about 22 hours ago
JSON representation

Control GenAI interactions with power, precision, and consistency using LLM-native Conversation Design paradigms

Awesome Lists containing this project

README

        


Parlant Banner

Parlant: The Conversation Modeling Engine πŸ’¬ βœ…



Website β€”
Introduction β€”
Tutorial β€”
About



PyPI - Version
PyPI - Python Version
Apache 2 License
GitHub commit activity
PyPI - Downloads
Discord


[![Parlant Introduction](https://github.com/emcie-co/parlant/blob/develop/yt-preview.png?raw=true)](https://www.youtube.com/watch?v=_39ERIb0100)

## What is Conversation Modeling?
You've built an AI agentβ€”that's great! However, when you actually test it, you see it's not handling many customer interactions properly, and your business experts are displeased with it. What do you do?

Enter Conversation Modeling (CM): a new powerful and reliable approach to controlling how your agents interact with your users.

A conversation model is a structured, domain-specific set of principles, actions, objectives, and terms that an agent applies to a given conversation.

### Why Conversation Modeling?

The problem of getting your AI agent to say what _you_ want it to say is a hard one, experienced by virtually anyone building customer-facing agents. Here's how Conversation Modeling compares to other approaches to solving this problem.

- **Flow engines** (such as [Rasa](https://github.com/RasaHQ/rasa), [Botpress](https://github.com/botpress/botpress) or [LangFlow](https://github.com/langflow-ai/langflow)) _force_ the user to interact according to predefined flows. In contrast, a **CM engine** dynamically _adapts_ to a user's natural interaction patterns while conforming to your rules.

- **Free-form prompt engineering** (such as with [LangGraph](https://www.langchain.com/langgraph) or [LlamaIndex](https://docs.llamaindex.ai/)) leads to _inconsistency_, frequently failing to uphold requirements. Conversely, a **CM engine** leverages structure to _enforce_ conformance to a Conversation Model.

## Who uses Parlant?
Parlant is used to deliver complex conversational agents that reliably follow your business protocols in use cases such as:
- 🏦 Regulated financial services
- πŸ₯ Healthcare communications
- πŸ“œ Legal assistance
- πŸ›‘οΈ Compliance-focused use cases
- 🎯 Brand-sensitive customer service
- 🀝 Personal advocacy and representation

## How is Parlant used?
Developers and data-scientists are using Parlant to:

- πŸ€– Create custom-tailored conversational agents quickly and easily
- πŸ‘£ Define behavioral guidelines for agents to follow (Parlant ensures they are followed reliably)
- πŸ› οΈ Attach tools with specific guidance on how to properly use them in different contexts
- πŸ“– Manage their agents’ glossary to ensure strict interpretation of terms in a conversational context
- πŸ‘€ Add customer-specific information to deliver personalized interactions

#### How does Parlant work?
```mermaid
graph TD
API(Parlant REST API) -->|React to Session Trigger| Engine[AI Response Engine]
Engine -->|Load Domain Terminology| GlossaryStore
Engine -->|Match Guidelines| GuidelineMatcher
Engine -->|Infer & Call Tools| ToolCaller
Engine -->|Tailor Guided Message| MessageComposer
```

When an agent needs to respond to a customer, Parlant's engine evaluates the situation, checks relevant guidelines, gathers necessary information through your tools, and continuously re-evaluates its approach based on your guidelines as new information emerges. When it's time to generate a message, Parlant implements self-critique mechanisms to ensure that the agent's responses precisely align with your intended behavior as given by the contextually-matched guidelines.

***πŸ“š More technical docs on the architecture and API are available under [docs/](./docs)***.

## πŸ“¦ Quickstart
Parlant comes pre-built with responsive session (conversation) management, a detection mechanism for incoherence and contradictions in guidelines, content-filtering, jailbreak protection, an integrated sandbox UI for behavioral testing, native API clients in Python and TypeScript, and other goodies.

```bash
$ pip install parlant
$ parlant-server run
$ # Open the sandbox UI at http://localhost:8800 and play
```

## πŸ™‹β€β™‚οΈπŸ™‹β€β™€οΈ Who Is Parlant For?
Parlant is the right tool for the job if you're building an LLM-based chat agent, and:

1. 🎯 Your use case places a **high importance on behavioral precision and consistency**, particularly in customer-facing scenarios
1. πŸ”„ Your agent is expected to undergo **continuous behavioral refinements and changes**, and you need a way to implement those changes efficiently and confidently
1. πŸ“ˆ You're expected to maintain a **growing set of behavioral guidelines**, and you need to maintain them coherently and with version-tracking
1. πŸ’¬ Conversational UX and user-engagmeent is an important concern for your use case, and you want to easily **control the flow and tone of conversations**

## ⭐ Star Us: Your Support Goes a Long Way!
[![Star History Chart](https://api.star-history.com/svg?repos=emcie-co/parlant&type=Date)](https://star-history.com/#emcie-co/parlant&Date)

## πŸ€” What Makes Parlant Different?

In a word: **_Guidance._** 🧭🚦🀝

Parlant's engine revolves around solving one key problem: How can we _reliably guide_ customer-facing agents to behave in alignment with our needs and intentions.

Hence Parlant's fundamentally different approach to agent building: [Managed Guidelines](https://www.parlant.io/docs/concepts/customization/guidelines):

```bash
$ parlant guideline create \
--agent-id MY_AGENT_ID \
--condition "the customer wants to return an item" \
--action "get the order number and item name and then help them return it"
```

By giving structure to behavioral guidelines, and _granularizing_ guidelines (i.e. making each behavioral guideline a first-class entity in the engine), Parlant's engine is able to offer unprecedented control, quality, and efficiency in building LLM-based agents:

1. πŸ›‘οΈ **Reliability:** Running focused self-critique in real-time, per guideline, to ensure it is actually followed
1. πŸ’‘ **Explainability:** Providing feedback around its interpretation of guidelines in each real-life context, which helps in troubleshooting and improvement
1. πŸ”§ **Maintainability:** Helping you maintain a coherent set of guidelines by detecting and alerting you to possible contradictions (gross or subtle) in your instructions

## πŸ€– Works with all major LLM providers
- [OpenAI](https://platform.openai.com/docs/overview) (also via [Azure](https://learn.microsoft.com/en-us/azure/ai-services/openai/))
- [Gemini](https://ai.google.dev/)
- [Meta Llama 3](https://www.llama.com/) (via [Together AI](https://www.together.ai/) or [Cerebras](https://cerebras.ai/))
- [Anthropic](https://www.anthropic.com/api) (also via [AWS Bedrock](https://aws.amazon.com/bedrock/))
- And more are added regularly

## πŸ“š Learning Parlant

To start learning and building with Parlant, visit our [documentation portal](https://parlant.io/docs/quickstart/introduction).

Need help? Ask us anything on [Discord](https://discord.gg/duxWqxKk6J). We're happy to answer questions and help you get up and running!

## πŸ’» Usage Example
Adding a guideline for an agentβ€”for example, to ask a counter-question to get more info when a customer asks a question:
```bash
parlant guideline create \
--condition "a free-tier customer is asking how to use our product" \
--action "first seek to understand what they're trying to achieve"
```

## πŸ‘‹ Contributing
We use the Linux-standard Developer Certificate of Origin ([DCO.md](DCO.md)), so that, by contributing, you confirm that you have the rights to submit your contribution under the Apache 2.0 license (i.e., that the code you're contributing is truly yours to share with the project).

Please consult [CONTRIBUTING.md](CONTRIBUTING.md) for more details.

Can't wait to get involved? Join us on [Discord](https://discord.gg/duxWqxKk6J) and let's discuss how you can help shape Parlant. We're excited to work with contributors directly while we set up our formal processes!

Otherwise, feel free to start a discussion or open an issue here on GitHubβ€”freestyle 😎.