Skip to main content

Conversation Flow management for Pipecat AI applications

Project description

pipecat

PyPI Docs Discord

Pipecat Flows is an add-on framework for Pipecat that allows you to build structured conversations in your AI applications. It enables you to create both predefined conversation paths and dynamically generated flows while handling the complexities of state management and LLM interactions.

The framework consists of:

  • A Python module for building conversation flows with Pipecat
  • A visual editor for designing and exporting flow configurations

Dependencies

Installation

  1. Install uv

    curl -LsSf https://astral.sh/uv/install.sh | sh
    

    Need help? Refer to the uv install documentation.

  2. Install the module

    # For new projects
    uv init my-pipecat-flows-app
    cd my-pipecat-flows-app
    uv add pipecat-ai-flows
    
    # Or for existing projects
    uv add pipecat-ai-flows
    

Using pip? You can still use pip install pipecat-ai-flows to get set up.

Quick Start

See Quick Start README.

For more detailed examples and guides, visit our documentation.

Examples

The repository includes several complete example implementations demonstrating various features of Pipecat Flows.

Available Examples

The examples demonstrate various conversation flows including food ordering, restaurant reservations, patient intake, insurance quotes, and warm transfers. All examples support multiple LLM providers (OpenAI, Anthropic, Google Gemini, AWS Bedrock) to demonstrate cross-platform compatibility.

Getting Started with Examples

For detailed setup instructions, configuration, and running examples, see the Examples README.

Quick start:

# Install dependencies
uv sync
uv pip install "pipecat-ai[daily,openai,deepgram,cartesia,silero,examples]"

# Configure environment
cp env.example .env  # Add your API keys

# Run an example
uv run examples/food_ordering.py

Contributing to the framework

  1. Clone the repository and navigate to it:

    git clone https://github.com/pipecat-ai/pipecat-flows.git
    cd pipecat-flows
    
  2. Install development dependencies:

    uv sync --group dev
    
  3. Install the git pre-commit hooks (these help ensure your code follows project rules):

    uv run pre-commit install
    

    The package is automatically installed in editable mode when you run uv sync.

Tests

The package includes a comprehensive test suite covering the core functionality.

Setup Test Environment

Install venv and dependencies:

uv sync --group dev

Running Tests

Run all tests:

uv run pytest tests/

Run specific test file:

uv run pytest tests/test_state.py

Run specific test:

uv run pytest tests/test_state.py -k test_initialization

Run with coverage report:

uv run pytest tests/ --cov=pipecat_flows

Pipecat Flows Editor

The Flows Editor is deprecated and will be removed along with Static Flows.

We have future plans to introduce a new editor capability that supports dynamic flows, but we don't have a timeline yet. We're open to collaborating with any developers or teams who have an interesting in building out this type of UI! Reach out to us on Discord if you're interested.

A visual editor for creating and managing Pipecat conversation flows.

Food ordering flow example

Features

  • Visual flow creation and editing
  • Import/export of flow configurations
  • Support for node and edge functions
  • Merge node support for complex flows
  • Real-time validation

Naming Conventions

While the underlying system is flexible with node naming, the editor follows these conventions for clarity:

  • Start Node: Named after your initial conversation state (e.g., "greeting", "welcome")
  • End Node: Conventionally named "end" for clarity, though other names are supported
  • Flow Nodes: Named to reflect their purpose in the conversation (e.g., "get_time", "confirm_order")

These conventions help maintain readable and maintainable flows while preserving technical flexibility.

Online Editor

The editor is available online at flows.pipecat.ai.

Local Development

Prerequisites

  • Node.js (v14 or higher)
  • npm (v6 or higher)

Installation

Clone the repository

git clone git@github.com:pipecat-ai/pipecat-flows.git

Navigate to project directory

cd pipecat-flows/editor

Install dependencies

npm install

Start development server

npm run dev

Open the page in your browser: http://localhost:5173.

Usage

  1. Create a new flow using the toolbar buttons
  2. Add nodes by right-clicking in the canvas
    • Start nodes can have descriptive names (e.g., "greeting")
    • End nodes are conventionally named "end"
  3. Connect nodes by dragging from outputs to inputs
  4. Edit node properties in the side panel
  5. Export your flow configuration using the toolbar

Examples

The editor/examples/ directory contains sample flow configurations:

  • food_ordering.json
  • movie_explorer.py
  • patient_intake.json
  • restaurant_reservation.json
  • travel_planner.json

To use an example:

  1. Open the editor
  2. Click "Import Flow"
  3. Select an example JSON file

See the examples directory for the complete files and documentation.

Development

Available Scripts

  • npm start - Start production server
  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build locally
  • npm run preview:prod - Preview production build with base path
  • npm run lint - Check for linting issues
  • npm run lint:fix - Fix linting issues
  • npm run format - Format code with Prettier
  • npm run format:check - Check code formatting
  • npm run docs - Generate documentation
  • npm run docs:serve - Serve documentation locally

Documentation

The Pipecat Flows Editor project uses JSDoc for documentation. To generate and view the documentation:

Generate documentation:

npm run docs

Serve documentation locally:

npm run docs:serve

View in browser by opening: http://localhost:8080

Contributing

We welcome contributions from the community! Whether you're fixing bugs, improving documentation, or adding new features, here's how you can help:

  • Found a bug? Open an issue
  • Have a feature idea? Start a discussion
  • Want to contribute code? Check our CONTRIBUTING.md guide
  • Documentation improvements? Docs PRs are always welcome

Before submitting a pull request, please check existing issues and PRs to avoid duplicates.

We aim to review all contributions promptly and provide constructive feedback to help get your changes merged.

Getting help

➡️ Join our Discord

➡️ Pipecat Flows Guide

➡️ Reach us on X

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

dv_pipecat_flows-0.0.0.dev2072.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

dv_pipecat_flows-0.0.0.dev2072-py3-none-any.whl (70.0 kB view details)

Uploaded Python 3

File details

Details for the file dv_pipecat_flows-0.0.0.dev2072.tar.gz.

File metadata

File hashes

Hashes for dv_pipecat_flows-0.0.0.dev2072.tar.gz
Algorithm Hash digest
SHA256 a042b25a4e5fa084c69ea4b35e7e9d6ca9dcd51ed8cd5d1a1795cb655ffa76a8
MD5 75adb9266ac0e2c76523f4e5dc168935
BLAKE2b-256 f11ecf9328875c4d116fb8734c66908fc5008e2db3633bcb98b585be442866bf

See more details on using hashes here.

File details

Details for the file dv_pipecat_flows-0.0.0.dev2072-py3-none-any.whl.

File metadata

File hashes

Hashes for dv_pipecat_flows-0.0.0.dev2072-py3-none-any.whl
Algorithm Hash digest
SHA256 444b8b4ead6e25a663b3d38756caca7a3946ede57d20654f16becc93ccd7381a
MD5 494c37b1c5f31d8a4851276d1c3aaa2d
BLAKE2b-256 715ee0115eda80e974730c4b087947ec7a14e2e395f0ebc9b825919ea3bb2bb1

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