Skip to main content
PraisonAI provides four core components for building AI applications. Each serves a distinct purpose in the architecture.

Quick Reference

ComponentPurposeUse When
AgentSingle autonomous unitSimple tasks, single-purpose automation
AgentManagerMulti-agent coordinatorTask delegation, hierarchical teams
WorkflowDeterministic pipelinesStep-by-step flows, loops, conditionals
AgentAppProduction deploymentWeb APIs, production services

Agent

The fundamental building block. A single AI entity with instructions and tools.
from praisonaiagents import Agent

agent = Agent(
    name="Researcher",
    instructions="You research topics thoroughly",
    tools=[search_tool]
)

result = agent.start("What is quantum computing?")

Key Features

  • Single purpose, focused execution
  • Direct tool access
  • Memory and context support
  • Works standalone or within orchestrators

AgentManager

Coordinates multiple agents through task assignment. Think: “Who does what task.”
from praisonaiagents import Agent, AgentManager, Task

researcher = Agent(role="Researcher", instructions="Research topics")
writer = Agent(role="Writer", instructions="Write content")

task1 = Task(description="Research AI", agent=researcher)
task2 = Task(description="Write article", agent=writer, context=[task1])

manager = AgentManager(
    agents=[researcher, writer],
    tasks=[task1, task2],
    process="sequential"
)
result = manager.start()

Key Features

  • Task-based delegation with explicit agent assignment
  • Sequential, parallel, or hierarchical execution
  • Task dependencies via context
  • Manager LLM for hierarchical validation

Workflow

Executes deterministic step sequences with advanced patterns. Think: “What happens in order.”
from praisonaiagents import Agent
from praisonaiagents.workflows import Workflow, route, loop

researcher = Agent(instructions="Research topics")
writer = Agent(instructions="Write content")

workflow = Workflow(
    steps=[
        researcher,
        route({
            "positive": [writer],
            "default": [fallback]
        })
    ]
)
result = workflow.run("Research AI trends")

Key Features

  • Pattern-based: route(), parallel(), loop(), repeat(), when()
  • Steps can be agents OR functions
  • CSV/file iteration with loop(from_csv="data.csv")
  • Recipe composition with include()

AgentApp

Deploys agents, managers, or workflows as production web services.
from praisonai import AgentApp
from praisonaiagents import Agent, AgentManager, Workflow

assistant = Agent(name="assistant", instructions="Be helpful")
manager = AgentManager(agents=[...], tasks=[...])
workflow = Workflow(steps=[...])

app = AgentApp(
    name="My AI API",
    agents=[assistant],
    managers=[manager],
    workflows=[workflow]
)
app.serve(port=8000)

Key Features

  • FastAPI-based REST endpoints
  • WebSocket support
  • Auto-generated API docs (/docs)
  • CORS configuration
  • Health checks (/health)

Endpoints

EndpointMethodDescription
/GETApp status and component list
/healthGETHealth check
/api/agentsGETList all agents
/api/chatPOSTChat with an agent

Comparison Matrix

CapabilityAgentAgentManagerWorkflowAgentApp
Single Task✅ Primary⚠️ Via step✅ Wraps
Multi-Agent✅ Primary✅ Via steps✅ Wraps
SequentialN/A✅ DefaultN/A
ParallelN/Aparallel()N/A
HierarchicalN/AN/A
Conditional⚠️ condition={}route(), when()N/A
Looping⚠️ loop_overloop()N/A
Repeat Untilrepeat()N/A
Web API✅ Primary
Functions as StepsN/A

When to Use What

1

Simple single task

Use Agent directly:
Agent(instructions="...").start("prompt")
2

Multi-agent with task delegation

Use AgentManager:
AgentManager(agents=[...], tasks=[...]).start()
3

Deterministic pipeline with patterns

Use Workflow:
Workflow(steps=[...]).run("input")
4

Production deployment

Wrap in AgentApp:
AgentApp(agents=[...]).serve(port=8000)

Shared Parameters

All orchestrators (AgentManager, Workflow) support identical feature parameters:
ParameterTypeDescription
memorybool / MemoryConfigEnable memory
planningbool / PlanningConfigPlanning mode
contextbool / ContextConfigContext management
outputstr / OutputConfigOutput settings
hooksHooksConfigLifecycle callbacks
autonomybool / AutonomyConfigAgent autonomy
knowledgebool / KnowledgeConfigRAG configuration
guardrailsbool / GuardrailConfigValidation
webbool / WebConfigWeb search
reflectionbool / ReflectionConfigSelf-reflection
cachingbool / CachingConfigCaching

Best Practices

Begin with a single Agent. Only add orchestration when you need multiple agents or complex flows.
Don’t mix AgentManager and Workflow for the same task. Pick based on your mental model.
Even for single agents, AgentApp provides proper API structure, CORS, and health checks.
If you need guaranteed execution order, conditional branching, or loops, use Workflow.