Skip to main content

PraisonAI is an AI Agents Framework with Self Reflection. PraisonAI application combines PraisonAI Agents, AutoGen, and CrewAI into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customisation, and efficient human-agent collaboration.

Project description

PraisonAI Logo

Total Downloads Latest Stable Version License

Praison AI

MervinPraison%2FPraisonAI | Trendshift

PraisonAI is a production-ready Multi-AI Agents framework with self-reflection, designed to create AI Agents to automate and solve problems ranging from simple tasks to complex challenges. By integrating PraisonAI Agents, AG2 (Formerly AutoGen), and CrewAI into a low-code solution, it streamlines the building and management of multi-agent LLM systems, emphasising simplicity, customisation, and effective human-agent collaboration.

Key Features

Feature Code Docs
๐Ÿš€ Single Agent Example ๐Ÿ“–
๐Ÿค Multi Agents Example ๐Ÿ“–
๐Ÿค– Auto Agents Example ๐Ÿ“–
๐Ÿ”„ Self Reflection AI Agents Example ๐Ÿ“–
๐Ÿง  Reasoning AI Agents Example ๐Ÿ“–
๐Ÿ‘๏ธ Multi Modal AI Agents Example ๐Ÿ“–
๐ŸŽญ AI Agent Workflow Example ๐Ÿ“–
๐Ÿ“š Add Custom Knowledge Example ๐Ÿ“–
๐Ÿง  Memory (Short & Long Term) Example ๐Ÿ“–
๐Ÿ“„ Chat with PDF Agents Example ๐Ÿ“–
๐Ÿ’ป Code Interpreter Agents Example ๐Ÿ“–
๐Ÿ“š RAG Agents Example ๐Ÿ“–
๐Ÿค” Async & Parallel Processing Example ๐Ÿ“–
๐Ÿ”ข Math Agents Example ๐Ÿ“–
๐ŸŽฏ Structured Output Agents Example ๐Ÿ“–
๐Ÿ”— LangChain Integrated Agents Example ๐Ÿ“–
๐Ÿ“ž Callback Agents Example ๐Ÿ“–
๐Ÿ› ๏ธ 100+ Custom Tools Example ๐Ÿ“–
๐Ÿ“„ YAML Configuration Example ๐Ÿ“–
๐Ÿ’ฏ 100+ LLM Support Example ๐Ÿ“–
๐Ÿ”ฌ Deep Research Agents Example ๐Ÿ“–
๐Ÿ”„ Query Rewriter Agent Example ๐Ÿ“–
๐ŸŒ Native Web Search Example ๐Ÿ“–
๐Ÿ“ฅ Web Fetch (Anthropic) Example ๐Ÿ“–
๐Ÿ’พ Prompt Caching Example ๐Ÿ“–
๐Ÿง  Claude Memory Tool Example ๐Ÿ“–
๐Ÿ’พ File-Based Memory Example ๐Ÿ“–
๐Ÿ” Built-in Search Tools Example ๐Ÿ“–
๐Ÿ“‹ Planning Mode Example ๐Ÿ“–
๐Ÿ”ง Planning Tools Example ๐Ÿ“–
๐Ÿง  Planning Reasoning Example ๐Ÿ“–
๐Ÿ”Œ MCP Transports Example ๐Ÿ“–
๐ŸŒ WebSocket MCP Example ๐Ÿ“–
๐Ÿ” MCP Security Example ๐Ÿ“–
๐Ÿ”„ MCP Resumability Example ๐Ÿ“–
โšก Fast Context Example ๐Ÿ“–
๐Ÿ–ผ๏ธ Image Generation Agent Example ๐Ÿ“–
๐Ÿ“ท Image to Text Agent Example ๐Ÿ“–
๐ŸŽฌ Video Agent Example ๐Ÿ“–
๐Ÿ“Š Data Analyst Agent Example ๐Ÿ“–
๐Ÿ’ฐ Finance Agent Example ๐Ÿ“–
๐Ÿ›’ Shopping Agent Example ๐Ÿ“–
โญ Recommendation Agent Example ๐Ÿ“–
๐Ÿ“– Wikipedia Agent Example ๐Ÿ“–
๐Ÿ’ป Programming Agent Example ๐Ÿ“–
๐Ÿ“ Markdown Agent Example ๐Ÿ“–
๐Ÿ“ Prompt Expander Agent Example ๐Ÿ“–
๐Ÿ”€ Router Agent Example ๐Ÿ“–
โ›“๏ธ Prompt Chaining Example ๐Ÿ“–
๐Ÿ” Evaluator Optimiser Example ๐Ÿ“–
๐Ÿ‘ท Orchestrator Workers Example ๐Ÿ“–
โšก Parallelisation Example ๐Ÿ“–
๐Ÿ” Repetitive Agents Example ๐Ÿ“–
๐Ÿค Agent Handoffs Example ๐Ÿ“–
๐Ÿ›ก๏ธ Guardrails Example ๐Ÿ“–
๐Ÿ’ฌ Sessions Management Example ๐Ÿ“–
โœ… Human Approval Example ๐Ÿ“–
๐Ÿ”„ Stateful Agents Example ๐Ÿ“–
๐Ÿค– Autonomous Workflow Example ๐Ÿ“–
๐Ÿ“œ Rules & Instructions Example ๐Ÿ“–
๐Ÿช Hooks Example ๐Ÿ“–
๐Ÿ“ˆ Telemetry Example ๐Ÿ“–
๐Ÿ“น Camera Integration Example ๐Ÿ“–

Supported Providers

Provider Example
OpenAI Example
Anthropic Example
Google Gemini Example
Ollama Example
Groq Example
DeepSeek Example
xAI Grok Example
Mistral Example
Cohere Example
Perplexity Example
Fireworks Example
Together AI Example
OpenRouter Example
HuggingFace Example
Azure OpenAI Example
AWS Bedrock Example
Google Vertex Example
Databricks Example
Cloudflare Example
AI21 Example
Replicate Example
SageMaker Example
Moonshot Example
vLLM Example

Using Python Code

Light weight package dedicated for coding:

pip install praisonaiagents
export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx

1. Single Agent

Create app.py file and add the code below:

from praisonaiagents import Agent
agent = Agent(instructions="Your are a helpful AI assistant")
agent.start("Write a movie script about a robot in Mars")

Run:

python app.py

2. Multi Agents

Create app.py file and add the code below:

from praisonaiagents import Agent, PraisonAIAgents

research_agent = Agent(instructions="Research about AI")
summarise_agent = Agent(instructions="Summarise research agent's findings")
agents = PraisonAIAgents(agents=[research_agent, summarise_agent])
agents.start()

Run:

python app.py

3. Agent with Planning Mode

Enable planning for any agent - the agent creates a plan, then executes step by step:

from praisonaiagents import Agent

def search_web(query: str) -> str:
    return f"Search results for: {query}"

agent = Agent(
    name="AI Assistant",
    instructions="Research and write about topics",
    planning=True,              # Enable planning mode
    planning_tools=[search_web], # Tools for planning research
    planning_reasoning=True      # Chain-of-thought reasoning
)

result = agent.start("Research AI trends in 2025 and write a summary")

What happens:

  1. ๐Ÿ“‹ Agent creates a multi-step plan
  2. ๐Ÿš€ Executes each step sequentially
  3. ๐Ÿ“Š Shows progress with context passing
  4. โœ… Returns final result

4. Deep Research Agent

Automated research with real-time streaming, web search, and citations using OpenAI or Gemini Deep Research APIs.

from praisonaiagents import DeepResearchAgent

# OpenAI Deep Research
agent = DeepResearchAgent(
    model="o4-mini-deep-research",  # or "o3-deep-research"
    verbose=True
)

result = agent.research("What are the latest AI trends in 2025?")
print(result.report)
print(f"Citations: {len(result.citations)}")
# Gemini Deep Research
from praisonaiagents import DeepResearchAgent

agent = DeepResearchAgent(
    model="deep-research-pro",  # Auto-detected as Gemini
    verbose=True
)

result = agent.research("Research quantum computing advances")
print(result.report)

Features:

  • ๐Ÿ” Multi-provider support (OpenAI, Gemini, LiteLLM)
  • ๐Ÿ“ก Real-time streaming with reasoning summaries
  • ๐Ÿ“š Structured citations with URLs
  • ๐Ÿ› ๏ธ Built-in tools: web search, code interpreter, MCP, file search
  • ๐Ÿ”„ Automatic provider detection from model name

5. Query Rewriter Agent

Transform user queries to improve RAG retrieval quality using multiple strategies.

from praisonaiagents import QueryRewriterAgent, RewriteStrategy

agent = QueryRewriterAgent(model="gpt-4o-mini")

# Basic - expands abbreviations, adds context
result = agent.rewrite("AI trends")
print(result.primary_query)  # "What are the current trends in Artificial Intelligence?"

# HyDE - generates hypothetical document for semantic matching
result = agent.rewrite("What is quantum computing?", strategy=RewriteStrategy.HYDE)

# Step-back - generates broader context question
result = agent.rewrite("GPT-4 vs Claude 3?", strategy=RewriteStrategy.STEP_BACK)

# Sub-queries - decomposes complex questions
result = agent.rewrite("RAG setup and best embedding models?", strategy=RewriteStrategy.SUB_QUERIES)

# Contextual - resolves references using chat history
result = agent.rewrite("What about cost?", chat_history=[...])

Strategies:

  • BASIC: Expand abbreviations, fix typos, add context
  • HYDE: Generate hypothetical document for semantic matching
  • STEP_BACK: Generate higher-level concept questions
  • SUB_QUERIES: Decompose multi-part questions
  • MULTI_QUERY: Generate multiple paraphrased versions
  • CONTEXTUAL: Resolve references using conversation history
  • AUTO: Automatically detect best strategy

6. Agent Memory (Zero Dependencies)

Enable persistent memory for agents - works out of the box without any extra packages.

from praisonaiagents import Agent
from praisonaiagents.memory import FileMemory

# Enable memory with a single parameter
agent = Agent(
    name="Personal Assistant",
    instructions="You are a helpful assistant that remembers user preferences.",
    memory=True,  # Enables file-based memory (no extra deps!)
    user_id="user123"  # Isolate memory per user
)

# Memory is automatically injected into conversations
result = agent.start("My name is John and I prefer Python")
# Agent will remember this for future conversations

Memory Types:

  • Short-term: Rolling buffer of recent context (auto-expires)
  • Long-term: Persistent important facts (sorted by importance)
  • Entity: People, places, organizations with attributes
  • Episodic: Date-based interaction history

Advanced Features:

from praisonaiagents.memory import FileMemory

memory = FileMemory(user_id="user123")

# Session Save/Resume
memory.save_session("project_session", conversation_history=[...])
memory.resume_session("project_session")

# Context Compression
memory.compress(llm_func=lambda p: agent.chat(p), max_items=10)

# Checkpointing
memory.create_checkpoint("before_refactor", include_files=["main.py"])
memory.restore_checkpoint("before_refactor", restore_files=True)

# Slash Commands
memory.handle_command("/memory show")
memory.handle_command("/memory save my_session")

Storage Options:

Option Dependencies Description
memory=True None File-based JSON storage (default)
memory="file" None Explicit file-based storage
memory="sqlite" Built-in SQLite with indexing
memory="chromadb" chromadb Vector/semantic search

6. Rules & Instructions

PraisonAI auto-discovers instruction files from your project root and git root:

File Description Priority
PRAISON.md PraisonAI native instructions High
PRAISON.local.md Local overrides (gitignored) Higher
CLAUDE.md Claude Code memory file High
CLAUDE.local.md Local overrides (gitignored) Higher
AGENTS.md OpenAI Codex CLI instructions High
GEMINI.md Gemini CLI memory file High
.cursorrules Cursor IDE rules High
.windsurfrules Windsurf IDE rules High
.claude/rules/*.md Claude Code modular rules Medium
.windsurf/rules/*.md Windsurf modular rules Medium
.cursor/rules/*.mdc Cursor modular rules Medium
.praison/rules/*.md Workspace rules Medium
~/.praison/rules/*.md Global rules Low
from praisonaiagents import Agent

# Agent auto-discovers CLAUDE.md, AGENTS.md, GEMINI.md, etc.
agent = Agent(name="Assistant", instructions="You are helpful.")
# Rules are injected into system prompt automatically

@Import Syntax:

# CLAUDE.md
See @README for project overview
See @docs/architecture.md for system design
@~/.praison/my-preferences.md

Rule File Format (with YAML frontmatter):

---
description: Python coding guidelines
globs: ["**/*.py"]
activation: always  # always, glob, manual, ai_decision
---

# Guidelines
- Use type hints
- Follow PEP 8

7. Auto-Generated Memories

from praisonaiagents.memory import FileMemory, AutoMemory

memory = FileMemory(user_id="user123")
auto = AutoMemory(memory, enabled=True)

# Automatically extracts and stores memories from conversations
memories = auto.process_interaction(
    "My name is John and I prefer Python for backend work"
)
# Extracts: name="John", preference="Python for backend"

8. Workflows

Create reusable multi-step workflows in .praison/workflows/:

from praisonaiagents.memory import WorkflowManager

manager = WorkflowManager()

# Execute a workflow
result = manager.execute(
    "deploy",
    executor=lambda prompt: agent.chat(prompt),
    variables={"environment": "production"}
)

9. Hooks

Configure in .praison/hooks.json:

from praisonaiagents.memory import HooksManager

hooks = HooksManager()

# Register Python hooks
hooks.register("pre_write_code", lambda ctx: print(f"Writing {ctx['file']}"))

# Execute hooks
result = hooks.execute("pre_write_code", {"file": "main.py"})

Using No Code

Auto Mode:

pip install praisonai
export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
praisonai --auto create a movie script about Robots in Mars

Query Rewriting (works with any command):

# Rewrite query for better results (uses QueryRewriterAgent)
praisonai "AI trends" --query-rewrite

# Rewrite with search tools (agent decides when to search)
praisonai "latest developments" --query-rewrite --rewrite-tools "internet_search"

# Works with any prompt
praisonai "explain quantum computing" --query-rewrite -v

Deep Research CLI:

# Default: OpenAI (o4-mini-deep-research)
praisonai research "What are the latest AI trends in 2025?"

# Use Gemini
praisonai research --model deep-research-pro "Your research query"

# Rewrite query before research
praisonai research --query-rewrite "AI trends"

# Rewrite with search tools
praisonai research --query-rewrite --rewrite-tools "internet_search" "AI trends"

# Use custom tools from file (gathers context before deep research)
praisonai research --tools tools.py "Your research query"
praisonai research -t my_tools.py "Your research query"

# Use built-in tools by name (comma-separated)
praisonai research --tools "internet_search,wiki_search" "Your query"
praisonai research -t "yfinance,calculator_tools" "Stock analysis query"

# Save output to file (output/research/{query}.md)
praisonai research --save "Your research query"
praisonai research -s "Your research query"

# Combine options
praisonai research --query-rewrite --tools tools.py --save "Your research query"

# Verbose mode (show debug logs)
praisonai research -v "Your research query"

Planning Mode CLI:

# Enable planning mode - agent creates a plan before execution
praisonai "Research AI trends and write a summary" --planning

# Planning with tools for research
praisonai "Analyze market trends" --planning --planning-tools tools.py

# Planning with chain-of-thought reasoning
praisonai "Complex analysis task" --planning --planning-reasoning

# Auto-approve plans without confirmation
praisonai "Task" --planning --auto-approve-plan

Memory CLI:

# Enable memory for agent (persists across sessions)
praisonai "My name is John" --memory

# Memory with user isolation
praisonai "Remember my preferences" --memory --user-id user123

# Memory management commands
praisonai memory show                      # Show memory statistics
praisonai memory add "User prefers Python" # Add to long-term memory
praisonai memory search "Python"           # Search memories
praisonai memory clear                     # Clear short-term memory
praisonai memory clear all                 # Clear all memory
praisonai memory save my_session           # Save session
praisonai memory resume my_session         # Resume session
praisonai memory sessions                  # List saved sessions
praisonai memory checkpoint                # Create checkpoint
praisonai memory restore <checkpoint_id>   # Restore checkpoint
praisonai memory checkpoints               # List checkpoints
praisonai memory help                      # Show all commands

Rules CLI:

# List all loaded rules (from PRAISON.md, CLAUDE.md, etc.)
praisonai rules list

# Show specific rule details
praisonai rules show <rule_name>

# Create a new rule
praisonai rules create my_rule "Always use type hints"

# Delete a rule
praisonai rules delete my_rule

# Show rules statistics
praisonai rules stats

# Include manual rules with prompts
praisonai "Task" --include-rules security,testing

Workflow CLI:

# List available workflows
praisonai workflow list

# Execute a workflow
praisonai workflow run deploy

# Execute with variables
praisonai workflow run deploy --workflow-var environment=staging --workflow-var branch=main

# Show workflow details
praisonai workflow show deploy

# Create a new workflow template
praisonai workflow create my_workflow

Hooks CLI:

# List configured hooks
praisonai hooks list

# Show hooks statistics
praisonai hooks stats

# Create hooks.json template
praisonai hooks init

Claude Memory Tool CLI:

# Enable Claude Memory Tool (Anthropic models only)
praisonai "Research and remember findings" --claude-memory --llm anthropic/claude-sonnet-4-20250514

Using JavaScript Code

npm install praisonai
export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
const { Agent } = require('praisonai');
const agent = new Agent({ instructions: 'You are a helpful AI assistant' });
agent.start('Write a movie script about a robot in Mars');

PraisonAI CLI Demo

Star History

Star History Chart

AI Agents Flow

graph LR
    %% Define the main flow
    Start([โ–ถ Start]) --> Agent1
    Agent1 --> Process[โš™ Process]
    Process --> Agent2
    Agent2 --> Output([โœ“ Output])
    Process -.-> Agent1
    
    %% Define subgraphs for agents and their tasks
    subgraph Agent1[ ]
        Task1[๐Ÿ“‹ Task]
        AgentIcon1[๐Ÿค– AI Agent]
        Tools1[๐Ÿ”ง Tools]
        
        Task1 --- AgentIcon1
        AgentIcon1 --- Tools1
    end
    
    subgraph Agent2[ ]
        Task2[๐Ÿ“‹ Task]
        AgentIcon2[๐Ÿค– AI Agent]
        Tools2[๐Ÿ”ง Tools]
        
        Task2 --- AgentIcon2
        AgentIcon2 --- Tools2
    end

    classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef tools fill:#2E8B57,stroke:#7C90A0,color:#fff
    classDef transparent fill:none,stroke:none

    class Start,Output,Task1,Task2 input
    class Process,AgentIcon1,AgentIcon2 process
    class Tools1,Tools2 tools
    class Agent1,Agent2 transparent

AI Agents with Tools

Create AI agents that can use tools to interact with external systems and perform actions.

flowchart TB
    subgraph Tools
        direction TB
        T3[Internet Search]
        T1[Code Execution]
        T2[Formatting]
    end

    Input[Input] ---> Agents
    subgraph Agents
        direction LR
        A1[Agent 1]
        A2[Agent 2]
        A3[Agent 3]
    end
    Agents ---> Output[Output]

    T3 --> A1
    T1 --> A2
    T2 --> A3

    style Tools fill:#189AB4,color:#fff
    style Agents fill:#8B0000,color:#fff
    style Input fill:#8B0000,color:#fff
    style Output fill:#8B0000,color:#fff

AI Agents with Memory

Create AI agents with memory capabilities for maintaining context and information across tasks.

flowchart TB
    subgraph Memory
        direction TB
        STM[Short Term]
        LTM[Long Term]
    end

    subgraph Store
        direction TB
        DB[(Vector DB)]
    end

    Input[Input] ---> Agents
    subgraph Agents
        direction LR
        A1[Agent 1]
        A2[Agent 2]
        A3[Agent 3]
    end
    Agents ---> Output[Output]

    Memory <--> Store
    Store <--> A1
    Store <--> A2
    Store <--> A3

    style Memory fill:#189AB4,color:#fff
    style Store fill:#2E8B57,color:#fff
    style Agents fill:#8B0000,color:#fff
    style Input fill:#8B0000,color:#fff
    style Output fill:#8B0000,color:#fff

AI Agents with Different Processes

Sequential Process

The simplest form of task execution where tasks are performed one after another.

graph LR
    Input[Input] --> A1
    subgraph Agents
        direction LR
        A1[Agent 1] --> A2[Agent 2] --> A3[Agent 3]
    end
    A3 --> Output[Output]

    classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef transparent fill:none,stroke:none

    class Input,Output input
    class A1,A2,A3 process
    class Agents transparent

Hierarchical Process

Uses a manager agent to coordinate task execution and agent assignments.

graph TB
    Input[Input] --> Manager
    
    subgraph Agents
        Manager[Manager Agent]
        
        subgraph Workers
            direction LR
            W1[Worker 1]
            W2[Worker 2]
            W3[Worker 3]
        end
        
        Manager --> W1
        Manager --> W2
        Manager --> W3
    end
    
    W1 --> Manager
    W2 --> Manager
    W3 --> Manager
    Manager --> Output[Output]

    classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef transparent fill:none,stroke:none

    class Input,Output input
    class Manager,W1,W2,W3 process
    class Agents,Workers transparent

Workflow Process

Advanced process type supporting complex task relationships and conditional execution.

graph LR
    Input[Input] --> Start
    
    subgraph Workflow
        direction LR
        Start[Start] --> C1{Condition}
        C1 --> |Yes| A1[Agent 1]
        C1 --> |No| A2[Agent 2]
        A1 --> Join
        A2 --> Join
        Join --> A3[Agent 3]
    end
    
    A3 --> Output[Output]

    classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef decision fill:#2E8B57,stroke:#7C90A0,color:#fff
    classDef transparent fill:none,stroke:none

    class Input,Output input
    class Start,A1,A2,A3,Join process
    class C1 decision
    class Workflow transparent

Agentic Routing Workflow

Create AI agents that can dynamically route tasks to specialized LLM instances.

flowchart LR
    In[In] --> Router[LLM Call Router]
    Router --> LLM1[LLM Call 1]
    Router --> LLM2[LLM Call 2]
    Router --> LLM3[LLM Call 3]
    LLM1 --> Out[Out]
    LLM2 --> Out
    LLM3 --> Out
    
    style In fill:#8B0000,color:#fff
    style Router fill:#2E8B57,color:#fff
    style LLM1 fill:#2E8B57,color:#fff
    style LLM2 fill:#2E8B57,color:#fff
    style LLM3 fill:#2E8B57,color:#fff
    style Out fill:#8B0000,color:#fff

Agentic Orchestrator Worker

Create AI agents that orchestrate and distribute tasks among specialized workers.

flowchart LR
    In[In] --> Router[LLM Call Router]
    Router --> LLM1[LLM Call 1]
    Router --> LLM2[LLM Call 2]
    Router --> LLM3[LLM Call 3]
    LLM1 --> Synthesizer[Synthesizer]
    LLM2 --> Synthesizer
    LLM3 --> Synthesizer
    Synthesizer --> Out[Out]
    
    style In fill:#8B0000,color:#fff
    style Router fill:#2E8B57,color:#fff
    style LLM1 fill:#2E8B57,color:#fff
    style LLM2 fill:#2E8B57,color:#fff
    style LLM3 fill:#2E8B57,color:#fff
    style Synthesizer fill:#2E8B57,color:#fff
    style Out fill:#8B0000,color:#fff

Agentic Autonomous Workflow

Create AI agents that can autonomously monitor, act, and adapt based on environment feedback.

flowchart LR
    Human[Human] <--> LLM[LLM Call]
    LLM -->|ACTION| Environment[Environment]
    Environment -->|FEEDBACK| LLM
    LLM --> Stop[Stop]
    
    style Human fill:#8B0000,color:#fff
    style LLM fill:#2E8B57,color:#fff
    style Environment fill:#8B0000,color:#fff
    style Stop fill:#333,color:#fff

Agentic Parallelization

Create AI agents that can execute tasks in parallel for improved performance.

flowchart LR
    In[In] --> LLM2[LLM Call 2]
    In --> LLM1[LLM Call 1]
    In --> LLM3[LLM Call 3]
    LLM1 --> Aggregator[Aggregator]
    LLM2 --> Aggregator
    LLM3 --> Aggregator
    Aggregator --> Out[Out]
    
    style In fill:#8B0000,color:#fff
    style LLM1 fill:#2E8B57,color:#fff
    style LLM2 fill:#2E8B57,color:#fff
    style LLM3 fill:#2E8B57,color:#fff
    style Aggregator fill:#fff,color:#000
    style Out fill:#8B0000,color:#fff

Agentic Prompt Chaining

Create AI agents with sequential prompt chaining for complex workflows.

flowchart LR
    In[In] --> LLM1[LLM Call 1] --> Gate{Gate}
    Gate -->|Pass| LLM2[LLM Call 2] -->|Output 2| LLM3[LLM Call 3] --> Out[Out]
    Gate -->|Fail| Exit[Exit]
    
    style In fill:#8B0000,color:#fff
    style LLM1 fill:#2E8B57,color:#fff
    style LLM2 fill:#2E8B57,color:#fff
    style LLM3 fill:#2E8B57,color:#fff
    style Out fill:#8B0000,color:#fff
    style Exit fill:#8B0000,color:#fff

Agentic Evaluator Optimizer

Create AI agents that can generate and optimize solutions through iterative feedback.

flowchart LR
    In[In] --> Generator[LLM Call Generator] 
    Generator -->|SOLUTION| Evaluator[LLM Call Evaluator] -->|ACCEPTED| Out[Out]
    Evaluator -->|REJECTED + FEEDBACK| Generator
    
    style In fill:#8B0000,color:#fff
    style Generator fill:#2E8B57,color:#fff
    style Evaluator fill:#2E8B57,color:#fff
    style Out fill:#8B0000,color:#fff

Repetitive Agents

Create AI agents that can efficiently handle repetitive tasks through automated loops.

flowchart LR
    In[Input] --> LoopAgent[("Looping Agent")]
    LoopAgent --> Task[Task]
    Task --> |Next iteration| LoopAgent
    Task --> |Done| Out[Output]
    
    style In fill:#8B0000,color:#fff
    style LoopAgent fill:#2E8B57,color:#fff,shape:circle
    style Task fill:#2E8B57,color:#fff
    style Out fill:#8B0000,color:#fff

Adding Models

Ollama Integration

export OPENAI_BASE_URL=http://localhost:11434/v1

Groq Integration

Replace xxxx with Groq API KEY:

export OPENAI_API_KEY=xxxxxxxxxxx
export OPENAI_BASE_URL=https://api.groq.com/openai/v1

No Code Options

Agents Playbook

Simple Playbook Example

Create agents.yaml file and add the code below:

framework: praisonai
topic: Artificial Intelligence
roles:
  screenwriter:
    backstory: "Skilled in crafting scripts with engaging dialogue about {topic}."
    goal: Create scripts from concepts.
    role: Screenwriter
    tasks:
      scriptwriting_task:
        description: "Develop scripts with compelling characters and dialogue about {topic}."
        expected_output: "Complete script ready for production."

To run the playbook:

praisonai agents.yaml

Use 100+ Models

Custom Tools

Using @tool Decorator

from praisonaiagents import Agent, tool

@tool
def search(query: str) -> str:
    """Search the web for information."""
    return f"Results for: {query}"

@tool
def calculate(expression: str) -> float:
    """Evaluate a math expression."""
    return eval(expression)

agent = Agent(
    instructions="You are a helpful assistant",
    tools=[search, calculate]
)
agent.start("Search for AI news and calculate 15*4")

Using BaseTool Class

from praisonaiagents import Agent, BaseTool

class WeatherTool(BaseTool):
    name = "weather"
    description = "Get current weather for a location"
    
    def run(self, location: str) -> str:
        return f"Weather in {location}: 72ยฐF, Sunny"

agent = Agent(
    instructions="You are a weather assistant",
    tools=[WeatherTool()]
)
agent.start("What's the weather in Paris?")

Creating a Tool Package (pip installable)

# pyproject.toml
[project]
name = "my-praisonai-tools"
version = "1.0.0"
dependencies = ["praisonaiagents"]

[project.entry-points."praisonaiagents.tools"]
my_tool = "my_package:MyTool"
# my_package/__init__.py
from praisonaiagents import BaseTool

class MyTool(BaseTool):
    name = "my_tool"
    description = "My custom tool"
    
    def run(self, param: str) -> str:
        return f"Result: {param}"

After pip install, tools are auto-discovered:

agent = Agent(tools=["my_tool"])  # Works automatically!

Prompt Expansion

Expand short prompts into detailed, actionable prompts:

CLI Usage

# Expand a short prompt into detailed prompt
praisonai "write a movie script in 3 lines" --expand-prompt

# With verbose output
praisonai "blog about AI" --expand-prompt -v

# With tools for context gathering
praisonai "latest AI trends" --expand-prompt --expand-tools tools.py

# Combine with query rewrite
praisonai "AI news" --query-rewrite --expand-prompt

Programmatic Usage

from praisonaiagents import PromptExpanderAgent, ExpandStrategy

# Basic usage
agent = PromptExpanderAgent()
result = agent.expand("write a movie script in 3 lines")
print(result.expanded_prompt)

# With specific strategy
result = agent.expand("blog about AI", strategy=ExpandStrategy.DETAILED)

# Available strategies: BASIC, DETAILED, STRUCTURED, CREATIVE, AUTO

Key Difference:

  • --query-rewrite: Optimizes queries for search/retrieval (RAG)
  • --expand-prompt: Expands prompts for detailed task execution

Web Search, Web Fetch & Prompt Caching

CLI Usage

# Web Search - Get real-time information
praisonai "What are the latest AI news today?" --web-search --llm openai/gpt-4o-search-preview

# Web Fetch - Retrieve and analyze URL content (Anthropic only)
praisonai "Summarize https://docs.praison.ai" --web-fetch --llm anthropic/claude-sonnet-4-20250514

# Prompt Caching - Reduce costs for repeated prompts
praisonai "Analyze this document..." --prompt-caching --llm anthropic/claude-sonnet-4-20250514

Programmatic Usage

from praisonaiagents import Agent

# Web Search
agent = Agent(
    instructions="You are a research assistant",
    llm="openai/gpt-4o-search-preview",
    web_search=True
)

# Web Fetch (Anthropic only)
agent = Agent(
    instructions="You are a content analyzer",
    llm="anthropic/claude-sonnet-4-20250514",
    web_fetch=True
)

# Prompt Caching
agent = Agent(
    instructions="You are an AI assistant..." * 50,  # Long system prompt
    llm="anthropic/claude-sonnet-4-20250514",
    prompt_caching=True
)

Supported Providers:

Feature Providers
Web Search OpenAI, Gemini, Anthropic, xAI, Perplexity
Web Fetch Anthropic
Prompt Caching OpenAI (auto), Anthropic, Bedrock, Deepseek

MCP (Model Context Protocol)

PraisonAI supports MCP Protocol Revision 2025-11-25 with multiple transports.

MCP Client (Consume MCP Servers)

from praisonaiagents import Agent, MCP

# stdio - Local NPX/Python servers
agent = Agent(tools=MCP("npx @modelcontextprotocol/server-memory"))

# Streamable HTTP - Production servers
agent = Agent(tools=MCP("https://api.example.com/mcp"))

# WebSocket - Real-time bidirectional
agent = Agent(tools=MCP("wss://api.example.com/mcp", auth_token="token"))

# SSE (Legacy) - Backward compatibility
agent = Agent(tools=MCP("http://localhost:8080/sse"))

# With environment variables
agent = Agent(
    tools=MCP(
        command="npx",
        args=["-y", "@modelcontextprotocol/server-brave-search"],
        env={"BRAVE_API_KEY": "your-key"}
    )
)

MCP Server (Expose Tools as MCP Server)

Expose your Python functions as MCP tools for Claude Desktop, Cursor, and other MCP clients:

from praisonaiagents.mcp import ToolsMCPServer

def search_web(query: str, max_results: int = 5) -> dict:
    """Search the web for information."""
    return {"results": [f"Result for {query}"]}

def calculate(expression: str) -> dict:
    """Evaluate a mathematical expression."""
    return {"result": eval(expression)}

# Create and run MCP server
server = ToolsMCPServer(name="my-tools")
server.register_tools([search_web, calculate])
server.run()  # stdio for Claude Desktop
# server.run_sse(host="0.0.0.0", port=8080)  # SSE for web clients

MCP Features

Feature Description
Session Management Automatic Mcp-Session-Id handling
Protocol Versioning Mcp-Protocol-Version header
Resumability SSE stream recovery via Last-Event-ID
Security Origin validation, DNS rebinding prevention
WebSocket Auto-reconnect with exponential backoff

Development:

Below is used for development only.

Using uv

# Install uv if you haven't already
pip install uv

# Install from requirements
uv pip install -r pyproject.toml

# Install with extras
uv pip install -r pyproject.toml --extra code
uv pip install -r pyproject.toml --extra "crewai,autogen"

Bump and Release

# From project root - bumps version and releases in one command
python src/praisonai/scripts/bump_and_release.py 2.2.99

# With praisonaiagents dependency
python src/praisonai/scripts/bump_and_release.py 2.2.99 --agents 0.0.169

# Then publish
cd src/praisonai && uv publish

Contributing

  • Fork on GitHub: Use the "Fork" button on the repository page.
  • Clone your fork: git clone https://github.com/yourusername/praisonAI.git
  • Create a branch: git checkout -b new-feature
  • Make changes and commit: git commit -am "Add some feature"
  • Push to your fork: git push origin new-feature
  • Submit a pull request via GitHub's web interface.
  • Await feedback from project maintainers.

Advanced Features

Research & Intelligence:

  • ๐Ÿ”ฌ Deep Research Agents (OpenAI & Gemini)
  • ๐Ÿ”„ Query Rewriter Agent (HyDE, Step-back, Multi-query)
  • ๐ŸŒ Native Web Search (OpenAI, Gemini, Anthropic, xAI, Perplexity)
  • ๐Ÿ“ฅ Web Fetch (Retrieve full content from URLs - Anthropic)
  • ๐Ÿ“ Prompt Expander Agent (Expand short prompts into detailed instructions)

Memory & Caching:

  • ๐Ÿ’พ Prompt Caching (Reduce costs & latency - OpenAI, Anthropic, Bedrock, Deepseek)
  • ๐Ÿง  Claude Memory Tool (Persistent cross-conversation memory - Anthropic Beta)
  • ๐Ÿ’พ File-Based Memory (Zero-dependency persistent memory for all agents)
  • ๐Ÿ” Built-in Search Tools (Tavily, You.com, Exa - web search, news, content extraction)

Planning & Workflows:

  • ๐Ÿ“‹ Planning Mode (Plan before execution - Agent & Multi-Agent)
  • ๐Ÿ”ง Planning Tools (Research with tools during planning)
  • ๐Ÿง  Planning Reasoning (Chain-of-thought planning)
  • โ›“๏ธ Prompt Chaining (Sequential prompt workflows with gates)
  • ๐Ÿ” Evaluator Optimiser (Generate and optimize through iterative feedback)
  • ๐Ÿ‘ท Orchestrator Workers (Distribute tasks among specialized workers)
  • โšก Parallelisation (Execute tasks in parallel for improved performance)
  • ๐Ÿ” Repetitive Agents (Handle repetitive tasks through automated loops)
  • ๐Ÿค– Autonomous Workflow (Monitor, act, adapt based on environment feedback)

Agent Types:

  • ๐Ÿ–ผ๏ธ Image Generation Agent (Create images from text descriptions)
  • ๐Ÿ“ท Image to Text Agent (Extract text and descriptions from images)
  • ๐ŸŽฌ Video Agent (Analyze and process video content)
  • ๐Ÿ“Š Data Analyst Agent (Analyze data and generate insights)
  • ๐Ÿ’ฐ Finance Agent (Financial analysis and recommendations)
  • ๐Ÿ›’ Shopping Agent (Price comparison and shopping assistance)
  • โญ Recommendation Agent (Personalized recommendations)
  • ๐Ÿ“– Wikipedia Agent (Search and extract Wikipedia information)
  • ๐Ÿ’ป Programming Agent (Code development and analysis)
  • ๐Ÿ“ Markdown Agent (Generate and format Markdown content)
  • ๐Ÿ”€ Router Agent (Dynamic task routing with cost optimization)

MCP Protocol:

  • ๐Ÿ”Œ MCP Transports (stdio, Streamable HTTP, WebSocket, SSE - Protocol 2025-11-25)
  • ๐ŸŒ WebSocket MCP (Real-time bidirectional connections with auto-reconnect)
  • ๐Ÿ” MCP Security (Origin validation, DNS rebinding prevention, secure sessions)
  • ๐Ÿ”„ MCP Resumability (SSE stream recovery via Last-Event-ID)

Safety & Control:

  • ๐Ÿค Agent Handoffs (Transfer context between specialized agents)
  • ๐Ÿ›ก๏ธ Guardrails (Input/output validation and safety checks)
  • โœ… Human Approval (Require human confirmation for critical actions)
  • ๐Ÿ’ฌ Sessions Management (Isolated conversation contexts)
  • ๐Ÿ”„ Stateful Agents (Maintain state across interactions)

Developer Tools:

  • โšก Fast Context (Rapid parallel code search - 10-20x faster than traditional methods)
  • ๐Ÿ“œ Rules & Instructions (Auto-discover CLAUDE.md, AGENTS.md, GEMINI.md)
  • ๐Ÿช Hooks (Pre/post operation hooks for custom logic)
  • ๐Ÿ“ˆ Telemetry (Track agent performance and usage)
  • ๐Ÿ“น Camera Integration (Capture and analyze camera input)

Other Features

  • ๐Ÿ”„ Use CrewAI or AG2 (Formerly AutoGen) Framework
  • ๐Ÿ’ป Chat with ENTIRE Codebase
  • ๐ŸŽจ Interactive UIs
  • ๐Ÿ“„ YAML-based Configuration
  • ๐Ÿ› ๏ธ Custom Tool Integration
  • ๐Ÿ” Internet Search Capability (Tavily, You.com, Exa, DuckDuckGo, Crawl4AI)
  • ๐Ÿ–ผ๏ธ Vision Language Model (VLM) Support
  • ๐ŸŽ™๏ธ Real-time Voice Interaction

Video Tutorials

Topic Video
AI Agents with Self Reflection Self Reflection
Reasoning Data Generating Agent Reasoning Data
AI Agents with Reasoning Reasoning
Multimodal AI Agents Multimodal
AI Agents Workflow Workflow
Async AI Agents Async
Mini AI Agents Mini
AI Agents with Memory Memory
Repetitive Agents Repetitive
Introduction Introduction
Tools Overview Tools Overview
Custom Tools Custom Tools
Firecrawl Integration Firecrawl
User Interface UI
Crawl4AI Integration Crawl4AI
Chat Interface Chat
Code Interface Code
Mem0 Integration Mem0
Training Training
Realtime Voice Interface Realtime
Call Interface Call
Reasoning Extract Agents Reasoning Extract

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

praisonai-2.3.12.tar.gz (174.4 kB view details)

Uploaded Source

Built Distribution

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

praisonai-2.3.12-py3-none-any.whl (167.2 kB view details)

Uploaded Python 3

File details

Details for the file praisonai-2.3.12.tar.gz.

File metadata

  • Download URL: praisonai-2.3.12.tar.gz
  • Upload date:
  • Size: 174.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for praisonai-2.3.12.tar.gz
Algorithm Hash digest
SHA256 7a87359f50a911c082f43989ba3d11f2c1af80fbe6b7cb9def22827088e4e1f4
MD5 f24e4c45384e6148465b662f2d8ee82b
BLAKE2b-256 5d5cb1412de951ea5e92fa13c8dde2be44aebfd4a9ea3e3988d5ac0dc0a30166

See more details on using hashes here.

File details

Details for the file praisonai-2.3.12-py3-none-any.whl.

File metadata

  • Download URL: praisonai-2.3.12-py3-none-any.whl
  • Upload date:
  • Size: 167.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for praisonai-2.3.12-py3-none-any.whl
Algorithm Hash digest
SHA256 42b9bcd050753404a6fff751551ed7ed81e6d1791af86e6c6ad9513635cbbfe5
MD5 ff1d776bcfe31e7febcfc1c0418a08d1
BLAKE2b-256 e3030dd61b9843ecf0167fb3c3006ddc1c768b4d52c58179a9acb7a145aa6559

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