๐Ÿช„ Haystack 2.24 is here! Simplified pipeline connections & PDF-ready chat generators. More details

Integration: PraisonAI

Integrate PraisonAI multi-agent workflows into your Haystack pipelines

Authors
Mervin Praison

Table of Contents

Overview

This integration provides a Haystack component for PraisonAI, enabling you to run multi-agent AI workflows within your Haystack pipelines. PraisonAI orchestrates multiple AI agents to collaboratively solve complex tasks.

Installation

pip install haystack-praisonai

Usage

Components

This integration introduces the PraisonAIComponent:

  • PraisonAIComponent: Sends queries to a PraisonAI server and returns agent responses.

Basic Usage

from haystack import Pipeline
from haystack_praisonai import PraisonAIComponent

# Create the component
praisonai = PraisonAIComponent(api_url="http://localhost:8080")

# Use in a pipeline
pipeline = Pipeline()
pipeline.add_component("praisonai", praisonai)

# Run
result = pipeline.run({"praisonai": {"query": "Research the latest AI trends"}})
print(result["praisonai"]["response"])

Using a Specific Agent

from haystack_praisonai import PraisonAIComponent

component = PraisonAIComponent(api_url="http://localhost:8080")
result = component.run(query="Write an article about AI", agent="writer")
print(result["response"])

Configuration

Parameter Type Default Description
api_url str http://localhost:8080 PraisonAI server URL
timeout int 300 Request timeout in seconds

Prerequisites

Start a PraisonAI server:

pip install praisonai
praisonai serve agents.yaml --port 8080

License

haystack-praisonai is distributed under the terms of the MIT license.