PraisonAI
AI agents that run on your own computers, even fully offline.
2M+ downloads · 9.3K stars · 600+ releases in the last year · 80+ contributors · MIT
Private AI (early access)
Private AI that earns trust one task at a time. Each task moves to your own AI only after it passes a test. If quality slips, it moves back automatically, and every step is recorded for regulators. For banks, insurers and hospitals.
How the handover works · What's new
|
Agents
Python agent framework: teams, workflows, memory, tools.
pip install praisonaiagents
Your first agent
|
Bot
Your agent on Telegram, Discord, Slack and WhatsApp, 24/7.
pip install "praisonai-bot[gateway,bot]"
praisonai-bot onboard
|
Code
An agent in your terminal that reads and edits your code.
pip install praisonai-code
praisonai-code code
|
MCP
Your agents and tools inside Cursor, Claude Desktop and other MCP clients.
pip install praisonai-mcp
praisonai-mcp connect cursor
|
Train
Fine-tune an open model on your own GPUs, and train agents on past runs.
pip install "praisonai-train[llm]"
praisonai-train --help
|
All of it
CLI, bots, dashboard and integrations in one install.
pip install "praisonai[dashboard]"
praisonai setup
|
A real run with pip install praisonai: a local Llama 3.2 model through Ollama, with no API key set.
How it fits together
Quick start
Set a key for any supported provider (OpenAI shown here), or skip the key and use a local model as in the next section.
pip install praisonai
export OPENAI_API_KEY="your-api-key"
from praisonai import Agent
agent = Agent(instructions="You are a helpful assistant.")
print(agent.start("In two sentences, why do some companies keep their data on their own computers?"))
Only want the lightweight core? pip install praisonaiagents and write from praisonaiagents import Agent; the rest of the code is the same.
Run fully offline
Run the same agent on a model on your own computer with Ollama. You need no API key, and your prompts and answers stay on the machine.
Install the package and pull the model while you still have internet; after that, the agent runs with no network at all. pip install praisonai includes local-model support; with only the core library, use pip install "praisonaiagents[llm]".
# Start Ollama first (the app, or "ollama serve" in another terminal)
ollama pull llama3.2
export DO_NOT_TRACK=true # keeps telemetry off (PraisonAI sends none unless you turn it on)
from praisonai import Agent
agent = Agent(instructions="You are a helpful assistant.", model="ollama/llama3.2")
print(agent.start("Why is the sky blue?"))
If Ollama runs on another computer on your network, pass base_url (or set OLLAMA_API_BASE):
agent = Agent(instructions="...", model="ollama/llama3.2", base_url="http://192.168.1.10:11434")
vLLM and LM Studio work the same way: use hosted_vllm/ (vLLM) or lm_studio/ with your server's base_url. More in the Ollama guide and Models docs.
What you can build

Bots Telegram, Discord, Slack and WhatsApp, with memory. Gateway
|

Dashboard Chat, agents, memory, knowledge and channels in one app.
|

Your agents in Cursor
praisonai-mcp connect cursor: 85 tools, one command. A real run.
|
Multi-agent teams Handoffs, route, parallel, loop and repeat. |
Memory and RAG Memory, knowledge and sessions, with zero extra deps to start. |
Tools and MCP Your own @tool or any MCP server. |
Coding agent
praisonai code, run and chat in your terminal. |
Browser automation An agent that uses websites for you. |
Sandboxes Run tools in Docker, E2B, Modal and more. |
Fine-tuning Train an open model on your own past work. |
YAML, no code Agents and workflows from one file. |
Deploy Ship agents as APIs or to the cloud. |
The Five-Layer Agent Stack
Most frameworks hand you one or two layers and leave the rest as homework. PraisonAI covers all five — plus the outer layer that decides where your agent actually runs.
Each layer wraps the one inside it. When an agent misbehaves, the layer tells you where to look.
| Layer |
The question it answers |
PraisonAI |
| 1 · Prompt |
Did I say it clearly? |
instructions=, role/goal/backstory, output=, templates= |
| 2 · Context |
Is the right thing in the window? |
memory=, knowledge=, context=, handoff ContextPolicy |
| 3 · Harness |
Can it act, and be checked? |
tools=, MCP(), guardrails=, approval=, hooks=, sandbox= |
| 4 · Loop |
When do we stop? |
execution=ExecutionConfig(...), reflection=, autonomy=, doom-loop detection |
| 5 · Graph |
Who runs when, and who checks whom? |
AgentFlow, route(), parallel(), loop(), repeat() |
| ⬡ Managed |
Where does it actually run? |
tools_run_on="docker" — one shared sandbox for the tools, or run_on="anthropic" for the whole agent |
Show an example for each layer, and Managed Agents
Layer 1 · Prompt — Did I say it clearly?
Role, instructions, examples, output format.
from praisonai import Agent
agent = Agent(
role="Senior Data Analyst",
goal="Turn raw numbers into decisions",
output="verbose", # markdown-formatted output
)
agent.start("Summarise Q3 revenue trends")
Layer 2 · Context — Is the right thing in the window?
Write, select, compress, isolate — the four context operations, one parameter each.
from praisonai import Agent
agent = Agent(
instructions="You are a support engineer.",
memory={"user_id": "u-42"}, # write — persists across runs (needs a user_id)
knowledge=["docs/"], # select — retrieves only what's relevant
context="summarize", # compress — auto-compacts before the limit
)
Isolate is handoffs=[specialist] — a sub-agent inherits the last few messages and the intersection of your tools, not your whole transcript. 📖 Handoffs
Layer 3 · Harness — Can it act, and be checked?
Agent = Model + Harness. Tool dispatch, plus the guides that steer before acting and the sensors that observe after.
from praisonai import Agent, MCP, tool
@tool
def deploy(env: str) -> str:
"""Deploy the current build to an environment."""
return f"Deployed to {env}"
agent = Agent(
name="ReleaseEngineer",
instructions="You are a release engineer.",
tools=[deploy, MCP("npx -y @modelcontextprotocol/server-filesystem /tmp")],
approval=True, # guide — human gate before risky tools run
)
agent.start("Deploy to staging, then list the files you can read")
Layer 4 · Loop — When do we stop?
Hard iteration caps, budget ceilings, no-progress detection and completion checks — every brake is explicit.
from praisonai import Agent, ExecutionConfig
agent = Agent(
instructions="Fix the failing tests.",
execution=ExecutionConfig(max_iter=30, max_budget=0.50, on_budget_exceeded="stop"),
autonomy=True, # required to drive the loop with run_autonomous()
)
result = agent.run_autonomous("Refactor the auth module", max_iterations=5)
print(result.completion_reason)
# goal | no_tool_calls | max_iterations | timeout | doom_loop | needs_help | error
# (with on_budget_exceeded="stop", hitting the cap raises BudgetExceededError,
# surfaced here as completion_reason="error")
Doom-loop detection is on by default. Repeated identical tool calls and A→B→A→B oscillation get caught — while a poller whose output keeps changing does not. 📖 Doom Loop Detection
Layer 5 · Graph — Who runs when, and who checks whom?
Topology as a versionable artifact: prompt chaining, routing, parallelisation, orchestrator-worker.