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
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
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 |
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.
from praisonai import AgentFlow
from praisonai import route, parallel, repeat
flow = AgentFlow(steps=[
classifier,
route({"bug": [bug_agent], "feature": [feature_agent], "default": [triage]}),
parallel([reviewer, tester]), # fan out, join automatically
repeat(editor, until=lambda ctx: "approved" in ctx.previous_result.lower(),
max_iterations=3), # evaluator–optimizer
])
flow.run("Ticket #123: login fails on Safari")
The same graph is expressible in YAML with no Python at all. 📖 AgentFlow
⬡ Outside the stack: Managed Agents — Where does it actually run?
The harness is commoditising; where the agent executes is the next multiplier. Rather than burning your laptop's CPU, hand an agent a short-lived cloud sandbox — repo, tools and tests run there.
pip install praisonai
The simplest way in is tools_run_on= — one whole team or workflow shares one sandbox, so a file written by step 1 is there for step 2. Thinking stays on your machine:
from praisonai import Agent, AgentFlow
writer = Agent(name="Writer", instructions="You write files.")
reader = Agent(name="Reader", instructions="You read files.")
flow = AgentFlow(tools_run_on="docker", steps=[writer, reader]) # or e2b | modal | daytona | flyio
flow.run("Write 'hello' to /workspace/note.txt, then read it back")
Same thing with no Python at all:
name: remote-demo
tools_run_on: docker # every step shares one sandbox
agents:
writer: {role: Writer, goal: Write files}
reader: {role: Reader, goal: Read files}
steps:
- agent: writer
action: "Write 'hello' to /workspace/note.txt"
- agent: reader
action: "Read /workspace/note.txt"
For a single agent, two words cover it — and they answer different questions:
from praisonai import Agent
# A. Only the TOOLS move. Thinking stays on your machine.
agent = Agent(name="builder", instructions="You build things.",
tools_run_on="docker") # docker | e2b | modal | daytona | flyio
# tenki | sandlock | ssh | novita | subprocess
# B. The WHOLE agent moves — model calls, loop and tools
agent = Agent(name="teacher", instructions="You teach.", run_on="anthropic") # hosted
agent = Agent(name="builder", instructions="You build.", run_on="docker") # self-hosted
agent.start("Write a Python script that prints the first 10 primes, then run it")
Ask any object where it runs, and it will tell you:
>>> Agent(name="builder", instructions="x", tools_run_on="docker")
Agent(name='builder', thinks_on='this machine', tools_run_on='a Docker container')
>>> agent.where_does_it_run()
Thinking (the AI model calls) happens on this machine.
Tools run on a Docker container.
Your own tools (check_db) still run on this machine -- only shell, file and
code tools move. They read and write this machine's files.
Naming a place that cannot do the job is a typo, not a preference, so it says so:
>>> Agent(name="x", instructions="i", run_on="e2b")
TypeError: Agent(run_on='e2b') is not valid: run_on= places the whole agent
-- model calls, loop and tools -- on a managed runtime, and 'e2b' runs
commands but cannot host an agent loop.
To run only the tools there: Agent(tools_run_on='e2b')
To run one block of code somewhere else, name the place on that call:
agent.execute_code_sync("print(6 * 7)", run_in="sandlock") # kernel-enforced
See what is running and reclaim strays:
praisonai managed ps # list running sandboxes
praisonai managed stop --all # reclaim them
Sandboxes shut themselves down when idle (auto_shutdown, idle_timeout_s), and a post-setup snapshot is reused so the next run skips the image pull and dependency install. Commit a .praisonai/environment.yaml and the environment travels with the repo.
📖 20 runnable examples · manage sessions with praisonai managed sessions list <agent-id> or praisonai managed sessions resume <session-id> "<prompt>"
Stack framing adapted from The Five-Layer Agent Stack and Agent Harnesses vs Orbs.
How the main features work
Multi-agent patterns. One AgentFlow, seven ways to run its steps. Docs
One agent turn. What happens between your prompt and the answer, and what stops it. Docs
Bot gateway. Ten channels in, one agent, team or flow behind them. Docs
MCP both ways. Your agents use MCP servers, and your editor uses your agents. Docs
How the handover works (early access)
- Watch: records how each task is done today.
- Test: your own AI takes an exam made from real past work it never studied.
- Hand over: a task moves to your own AI only when it passes.
- Roll back: if quality drops, the task moves back automatically.
- Record: every handover leaves a record your regulator can check.
What is "your own AI"? An open model, such as Llama, Qwen or Gemma, running on your own computers. Use it as it is, or train it on your own past work with PraisonAI Train on your own GPU servers. Your team decides when to train; nothing trains automatically. Either way, a task moves to it only after it passes that exam.
Why now. Highly regulated teams, such as banks, insurers and hospitals, want AI but can't send customer data to outside models. The largest banks built private AI in-house; most mid-size banks and insurers can't fund a team to do that. From 6 January 2027, OpenAI also takes no new self-serve fine-tuning jobs (notice), so teams that customise models need models they own.
The handover is built on parts of this framework that are live today: tracing, evaluation, fine-tuning, model routing and local models. It is in early access, and we are taking on our first design partners. The framework stays free and MIT-licensed. Design partners, investors and press: enterprise@praison.ai or praison.ai/enterprise.
JavaScript and TypeScript
npm install praisonai
The TypeScript and JavaScript SDK has its own guide at praison.ai/docs/js.
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');
Install
Desktop app
Other ways to install
One-line installer:
curl -fsSL https://praison.ai/install.sh | bash
The full praisonai package, with the CLI and integrations. Add the [dashboard] extra for bots and the dashboard (pip install "praisonai[dashboard]"):
██████╗ ██████╗ █████╗ ██╗███████╗ ██████╗ ███╗ ██╗ █████╗ ██╗
██╔══██╗██╔══██╗██╔══██╗██║██╔════╝██╔═══██╗████╗ ██║ ██╔══██╗██║
██████╔╝██████╔╝███████║██║███████╗██║ ██║██╔██╗ ██║ ███████║██║
██╔═══╝ ██╔══██╗██╔══██║██║╚════██║██║ ██║██║╚██╗██║ ██╔══██║██║
██║ ██║ ██║██║ ██║██║███████║╚██████╔╝██║ ╚████║ ██║ ██║██║
╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝
pip install praisonai
Docs, community and licence
The PraisonAI Ecosystem
Start simple with the core SDK, or expand to full visual builders and dashboards when you're ready.