Skip to main content
praisonai-code is the standalone code-execution agent runtime that sits between the core SDK (praisonaiagents) and the full wrapper (praisonai). It is not a GUI or a gateway — it is the engine that powers the praisonai CLI, packaged so you can use it without pulling in gateway, bots, or other wrapper integrations.

Package Boundaries

praisonai-code sits in the four-tier package model between praisonaiagents (SDK) and praisonai (wrapper). It never imports the wrapper at module load, and reaches wrapper-only features through a single bridge (praisonai_code._wrapper_bridge). Its sibling praisonai-bot owns bots, gateway, channel CLI, and the gateway scheduler tick — see the praisonai-bot SDK page. You can build an Agent and call agent.start() standalone; only gateway/bot serving needs the wrapper.

Four-tier ownership

PackageOwnsMust not depend on
praisonaiagentsAgent, tools, memory, hooks, framework protocols, bot/gateway protocolspraisonai, praisonai-code, praisonai-bot
praisonai-codeTerminal CLI: run/chat/code, Typer, runtime, llm, tool resolutionPyPI cycle on praisonai (lazy _wrapper_bridge only)
praisonai-botBots, gateway server, channel CLI, OS daemon, gateway scheduler tickPyPI cycle on praisonai (lazy _wrapper_bridge + _code_bridge only)
praisonai wrapperFramework adapters (CrewAI/AutoGen), train, serve, dashboard, async jobs API, RunPolicy safety gate
Publish order: praisonaiagentspraisonai-code + praisonai-botpraisonai

Wrapper bridge

The only sanctioned way for praisonai-code code to reach wrapper modules is through praisonai_code._wrapper_bridge. This makes standalone installs work — every wrapper call is guarded, so a missing praisonai package downgrades cleanly instead of raising ImportError at import time.
HelperPurpose
wrapper_available()Probe if praisonai is importable — no side effects
import_wrapper_module(name)Import a wrapper module (e.g. "praisonai.framework_adapters.registry") with an install-hint error if missing
get_wrapper_attr(module, attr)Fetch a wrapper attribute; raise with install hint if missing
optional_wrapper_attr(module, attr, default)Fetch an attribute or return the supplied default — used by e.g. recipe_creator.py for graceful fallback

Quick Start

1

Install

pip install praisonai-code
For the full four-package overview and a “which package?” decision guide, see Installation.
2

Set your API key

export OPENAI_API_KEY=your_openai_api_key
Any supported provider key works (ANTHROPIC_API_KEY, GEMINI_API_KEY, GROQ_API_KEY, OLLAMA_HOST, …). See Provider Auto-Detection.
3

Run an agent

from praisonaiagents import Agent

agent = Agent(name="researcher", instructions="You are a helpful research assistant")
response = agent.start("What are the latest advances in multimodal AI?")
print(response)

What ships in this package

The praisonai_code Python package contains the terminal-native CLI and agent runtime. Current published versions are shown on the installation page. It contains the full CLI implementation used by the praisonai wrapper command, plus the agent runtime modules.
ModuleDescription
praisonai_code.cliFull CLI command tree (run, chat, code, agent, agents, memory, tools, mcp, hooks, and more)
praisonai_code.cli.executionCore agent execution engine
praisonai_code.cli.configurationConfiguration loader and schema
praisonai_code.cli.commands.*Individual CLI sub-commands
praisonai-code installs a praisonai-code console script and a python -m praisonai_code module entrypoint. On a standalone install (no wrapper), praisonai-code run --output actions "prompt", daemon start, config, and doctor work directly. Default run "prompt", chat, and code require the wrapper — install with pip install praisonai to unlock them (a clear install hint is printed if you invoke them standalone). See the Standalone limits table below.

Standalone limits (pip install praisonai-code only)

CommandWorks standalone?Notes
run --help, config, doctorYes
run --output actions "…"YesIn-process Agent
run "…" (default)NoRequires pip install praisonai
chat, codeNoTUI / interactive legacy live in wrapper
daemon start (foreground)Yes
daemon start --backgroundYesSpawns python -m praisonai_code.runtime
For the full terminal UX (chat, code, default run), install the wrapper: pip install praisonai.

What is not in this package

praisonai-code deliberately excludes the features that live in the praisonai wrapper:
  • Gateway — messaging relay and session management. Install praisonai-bot[gateway] for the standalone gateway, or install the full praisonai wrapper. See Standalone Bot Gateway.
  • Bots — Telegram, Discord, Slack, WhatsApp integrations. Install praisonai-bot[bot] for standalone channel bots.
  • Gateway scheduler tick — scheduled agent execution. Lives in praisonai-bot; the RunPolicy safety gate stays wrapper-only.
  • YAML-driven multi-bot orchestrationpraisonai onboard, praisonai setup (wrapper).
  • Framework adapters — CrewAI, AutoGen (wrapper).

When to pick this vs the wrapper vs the SDK

Use caseInstall
Embed agents in your own Python applicationpip install praisonaiagents
Run agents from a CLI with run --output actions / daemon onlypip install praisonai-code
Deploy a Telegram/Slack/Discord bot + gateway without the full wrapperpip install "praisonai-bot[gateway,bot]"
Full terminal UX (chat, code, default run) + gateway + framework adapterspip install praisonai

Best Practices

Always import from praisonaiagents, not from praisonai_code internals. The core SDK API is stable; internal CLI modules are implementation details.
from praisonaiagents import Agent, Task, PraisonAIAgents
Set API keys as environment variables rather than hardcoding them. praisonai-code reads the same environment variables as praisonaiagents.
export OPENAI_API_KEY=your_openai_api_key
python my_agent.py
praisonai-code inherits the full praisonaiagents multi-agent API:
from praisonaiagents import Agent, Task, PraisonAIAgents

researcher = Agent(name="researcher", instructions="Research the topic")
writer = Agent(name="writer", instructions="Write a summary")

task1 = Task(description="Research AI trends", agent=researcher)
task2 = Task(description="Summarise findings", agent=writer, context=[task1])

agents = PraisonAIAgents(agents=[researcher, writer], tasks=[task1, task2])
agents.start()
If you start with praisonai-code and later need gateway or bot features, add pip install "praisonai-bot[gateway,bot]" for the standalone bot path, or pip install praisonai for the full wrapper. Nothing in your existing code needs to change — the same from praisonaiagents import Agent imports still work.

Installation Guide

Three-package comparison and decision guide

praisonai SDK

Full wrapper with gateway and bots

praisonaiagents SDK

Core agent SDK

Quick Start

Build your first agent