Praison AI Agents
raw JSON → 1.6.33 verified Fri May 01 auth: no python
Praison AI Agents is a Python framework for building and orchestrating multi-agent systems with self-reflection capabilities. It supports various AI models (OpenAI, Anthropic, Ollama, etc.) and provides tools for complex task decomposition, agent collaboration, and iterative refinement. The current version is 1.6.33, with a release cadence of multiple updates per month.
pip install praisonaiagents Common errors
error ModuleNotFoundError: No module named 'praisonaiagents' ↓
cause Typo or incorrect package name (e.g., 'praisonai' instead of 'praisonaiagents').
fix
Run
pip install praisonaiagents (note the 'agents' suffix). error ImportError: cannot import name 'Agent' from 'praisonaiagents' ↓
cause Old import path; Agent class was moved to submodule.
fix
Use
from praisonaiagents.agent import Agent. error TypeError: __init__() missing 1 required positional argument: 'llm' ↓
cause Passing arguments to PraisonAIAgents without keyword, or missing required config.
fix
Pass
llm=os.environ.get('OPENAI_API_KEY') as a keyword argument. error KeyError: 'OPENAI_API_KEY' ↓
cause Environment variable not set but required by default LLM provider.
fix
Set
export OPENAI_API_KEY='your-key' or pass a different API key via llm. Warnings
breaking Version 1.0.0 moved the Agent and Task classes into submodules. Direct imports from the top-level package (e.g., `from praisonaiagents import Agent`) will fail. ↓
fix Use `from praisonaiagents.agent import Agent` and `from praisonaiagents.task import Task`.
breaking The `PraisonAIAgents` class no longer accepts `llm` as a positional argument; it must be passed as a keyword argument. ↓
fix Use `PraisonAIAgents(agents=[...], tasks=[...], llm=api_key)` instead of positional.
gotcha The `llm` parameter in `PraisonAIAgents` expects an API key string or a config object, not a model name. Passing a model name directly will cause authentication errors. ↓
fix Ensure you pass `os.environ.get('OPENAI_API_KEY')` or a properly configured `LLMConfig` object.
gotcha By default, agents use 'openai/gpt-4' model. If you do not set an API key, the agent will fail silently or raise ambiguous errors. ↓
fix Set the `OPENAI_API_KEY` environment variable or pass an `llm` parameter to `PraisonAIAgents`.
deprecated The `PraisonAIAgents.initialize()` method is deprecated in favor of `start()`. ↓
fix Use `agents.start()` instead of `agents.initialize()`.
Imports
- PraisonAIAgents wrong
from praisonai import PraisonAIAgentscorrectfrom praisonaiagents import PraisonAIAgents - Agent wrong
from praisonai import Agentcorrectfrom praisonaiagents.agent import Agent - Task
from praisonaiagents.task import Task
Quickstart
import os
from praisonaiagents import PraisonAIAgents
from praisonaiagents.agent import Agent
from praisonaiagents.task import Task
api_key = os.environ.get('OPENAI_API_KEY', '')
agent = Agent(
name="ResearchAgent",
llm="gpt-4",
system_prompt="You are a helpful research assistant."
)
task = Task(
description="Summarize the latest AI trends",
agent=agent
)
agents = PraisonAIAgents(
agents=[agent],
tasks=[task],
llm=api_key
)
result = agents.start()
print(result)