Skip to main content

No project description provided

Project description

Parlant Logo

A Client/Server Framework for Building Guided LLM Agents

Website | Introduction | Installation | Tutorial | About

PyPI - Version PyPI - Python Version Apache 2 License GitHub last commit Discord

✨ What is Parlant?

Parlant is a fully open-source (Apache 2.0) client/server framework for building and serving guided customer-facing agents based on LLMs (Large Language Models).

It comes pre-built with responsive session (conversation) management, content-filtering, jailbreak protection, an integrated sandbox UI for behavioral testing, and other goodies.

📦 Quickstart

$ pip install parlant
$ parlant-server
$ # Open the sandbox UI at http://localhost:8000 and play
Parlant Preview

🙋‍♂️🙋‍♀️ Who Is Parlant For?

Parlant is the right tool for the job if you're building an LLM-based chat agent, and:

  1. You require a high degree of behavioral precision and consistency
  2. Your agent is expected to undergo many behavioral refinements and changes, and you need a way to implement those changes efficiently and confidently
  3. You would benefit from assistance in maintaining coherence and disentangling subtleties in numerous agent instructions
  4. Conversational UX and user-engagmeent is an important concern for your use case

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

$ 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
  2. Explainability: Providing feedback around its interpretation of guidelines in each real-life context, which helps in troubleshooting and improvement
  3. Maintainability: Helping you maintain a coherent set of guidelines by detecting and alerting you to possible contradictions (gross or subtle) in your instructions

🚀 Real-world impact

Revenued, a business capital provider, uses Parlant for their Sales Copilot. They leverage Parlant's structured CLI to modify the agent's behavior quickly and easily based on feedback from company stakeholders.

💪 Key benefits

Control that actually works

  • Guidelines: Control responses by writing contextual rules - like "offer limited time coupons if it's a holiday" or "make it very clear we don't offer loans if a customer asks about it". By using condition/action definitions, you define exactly when and how your agent should respond
  • Glossary: Teach your agent your business-specific terminology so that both you and your customers can speak to it naturally in your language
  • Coherence checks: Catch conflicts by having Parlant evaluate new guidelines against existing ones before they're applied
  • Dynamic context: Make your agent context-aware by setting user-specific variables like customer account or subscription tier. These shape how your agent responds to each user
  • Guided tool use: Control API access by linking tools to specific guidelines. This way, your agent only calls APIs when appropriate and with clear intent

Developer friendly

  • See changes instantly: Modify behavior on the fly by updating guidelines directly, no retraining or redeployment needed
  • Track changes in Git: Manage agent behavior like code by storing configuration as JSON in your repo. Review, rollback, branch, and merge just like any other code
  • Clean architecture: Separate concerns by keeping business logic in tools and conversation patterns in guidelines. Each piece does what it does best
  • Type safety: Build rapidly using native TypeScript/JavaScript SDKs with proper type definitions

Deploy with confidence

  • Reliable at scale: Parlant filters and selects guidelines per context, allowing you to scale your agent's complexity and use-cases while maintaining consistent, focused behavior
  • Debug with ease: Troubleshoot effectively by tracing which guidelines were applied and why for any given response
  • Test before deploy: Validate changes using the built-in chat UI to test new behaviors before they reach customers

🤖 Works with all major LLM providers

📚 Learning Parlant

To start learning and building with Parlant, visit our documentation portal.

Need help? Send us a message on Discord. 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:

parlant guideline create \
    --agent-id CUSTOMER_SUCCESS_AGENT_ID \
    --condition "a free-tier customer is asking how to use our product" \
    --action "first seek to understsand what they're trying to achieve"

In Parlant, Customer-Agent interaction happens asynchronously, to enable more natural customer interactions, rather than forcing a strict and unnatural request-reply mode.

Here's a basic example of a simple client (using the TypeScript client SDK):

import { ParlantClient } from 'parlant-client';

const client = ParlantClient({ environment: SERVER_ADDRESS });

session_id = "...";

// Post customer message
const customerEvent = await client.sessions.createEvent(session_id, {
   kind: "message",
   source: "customer",
   message: "Hey, I'd like to book a room please",
});

// Wait for and get the agent's reply
const [agentEvent] = (await client.sessions.listEvents(session_id, {
   kinds: "message",
   source: "ai_agent",
   minOffset: customerEvent.offset,
   waitForData: 60 // Wait up to 60 seconds for an answer
}));

// Print the agent's reply
const { agentMessage } = agentEvent.data as { message: string };
console.log(agentMessage);

// Inspect the details of the message generation process
const { trace } = await client.sessions.inspectEvent(
   session_id,
   agentEvent.id
);

👋 Contributing

We're currently finalizing our contribution guidelines. Check back soon!

Can't wait to get involved? Join us on Discord 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!

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parlant-1.3.0.tar.gz (486.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parlant-1.3.0-py3-none-any.whl (581.2 kB view details)

Uploaded Python 3

File details

Details for the file parlant-1.3.0.tar.gz.

File metadata

  • Download URL: parlant-1.3.0.tar.gz
  • Upload date:
  • Size: 486.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.5 Darwin/23.5.0

File hashes

Hashes for parlant-1.3.0.tar.gz
Algorithm Hash digest
SHA256 0c9423ca6b6a38febf951d74aef7e4e9bc5fdcab70d188cfb391502e760367e9
MD5 90d20f96e5faa7471b0a43407c37cdbf
BLAKE2b-256 fe6f906f5b1e9355dbb544d0833b4aafcda2aec73d573ed0aeac10d00490ac18

See more details on using hashes here.

File details

Details for the file parlant-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: parlant-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 581.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.5 Darwin/23.5.0

File hashes

Hashes for parlant-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1fccb02aa7d61394fb2449cd95a54b69847c90d0287dec43dd519749ddf65f8d
MD5 d644b7ccf6711b1847b5b976e3511ebf
BLAKE2b-256 064395b9388a8ff4955b78acdb47e0087305ffb4ffa08dc85b74b6d1d59a8f95

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page