> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Package Tier Architecture

> How praisonaiagents, praisonai-code, praisonai-bot, praisonai-train, praisonai-browser, praisonai-mcp, and praisonai layer on top of each other

PraisonAI ships as seven packages that stack — pick the smallest one that covers what you need.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    A[praisonaiagents\nCore SDK]:::sdk --> B[praisonai-code\nTerminal CLI]:::runtime
    A --> C[praisonai-bot\nBots + Gateway]:::runtime
    A --> E[praisonai-train\nFine-tune + Agent training]:::runtime
    A --> F[praisonai-browser\nExtension bridge + Playwright]:::runtime
    A --> G[praisonai-mcp\nMCP server host]:::runtime
    B --> D[praisonai\nFull wrapper]:::wrapper
    C --> D
    E --> D
    F --> D
    G --> D

    classDef sdk fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef runtime fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef wrapper fill:#10B981,stroke:#7C90A0,color:#fff
```

## Quick Start

<Steps>
  <Step title="SDK only — embed agents in your Python app">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    pip install praisonaiagents
    ```

    The core `Agent`, tools, memory, and hooks. No CLI, no gateway.
  </Step>

  <Step title="Terminal CLI — run/chat/code, no gateway or bots">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    pip install praisonai-code
    ```

    The agentic CLI (`run`, `chat`, `code`) and LLM runtime, without channel bots.
  </Step>

  <Step title="Gateway + bots — channel runtime without the wrapper">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    pip install "praisonai-bot[gateway,bot]"
    ```

    The WebSocket gateway, Telegram/Discord/Slack bots, and the scheduler tick.
  </Step>

  <Step title="Training — fine-tune LLMs or train agents">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    pip install "praisonai-train[llm]"
    ```

    LLM fine-tuning via Unsloth and iterative agent training, without the wrapper.
  </Step>

  <Step title="Browser — automate Chrome and the web">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    pip install "praisonai-browser[all]"
    ```

    The bridge server, CDP agent, and Playwright engine — usable on their own or inside the full `praisonai` install.
  </Step>

  <Step title="MCP host — serve agents to Claude Desktop / Cursor">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    pip install "praisonai-mcp[all]"
    ```

    The heavy MCP host — full capability registry, recipes, and HTTP-stream auth — usable on its own or inside the full `praisonai` install.
  </Step>

  <Step title="Everything — the full wrapper">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    pip install praisonai
    ```

    Transitively pulls `praisonai-code`, `praisonai-bot`, `praisonai-train`, `praisonai-browser`, `praisonai-mcp`, and `praisonaiagents`.
  </Step>
</Steps>

***

## How to Choose

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph TB
    Q1{What do I want to do?}
    Q1 -->|Full CLI with gateway,<br/>bots & integrations| P1[pip install praisonai]
    Q1 -->|Gateway + bots only| P4["pip install praisonai-bot[gateway,bot]"]
    Q1 -->|Fine-tune LLMs or<br/>train agents| P5["pip install praisonai-train[llm]"]
    Q1 -->|Automate Chrome /<br/>a browser| P6["pip install praisonai-browser[all]"]
    Q1 -->|MCP server for Claude<br/>Desktop / Cursor| P7["pip install praisonai-mcp[all]"]
    Q1 -->|Run agents from the CLI,<br/>no bots| P2[pip install praisonai-code]
    Q1 -->|Embed agents in<br/>my own Python app| P3[pip install praisonaiagents]

    classDef question fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef wrapper fill:#10B981,stroke:#7C90A0,color:#fff
    classDef runtime fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef sdk fill:#8B0000,stroke:#7C90A0,color:#fff

    class Q1 question
    class P1 wrapper
    class P2,P4,P5,P6,P7 runtime
    class P3 sdk
```

Start at the top: install `praisonai` unless you know you want a lighter footprint. Each lower tier trims dependencies at the cost of features.

***

## How Tiers Interact at Runtime

The bot tier reaches wrapper-only features through a lazy bridge, so it stays installable on its own.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
sequenceDiagram
    participant User
    participant Bot as praisonai-bot
    participant SDK as praisonaiagents
    participant Bridge as Lazy config bridge

    User->>Bot: message / scheduled tick
    Bot->>SDK: Agent.start(request)
    SDK-->>Bot: agent response
    Bot->>Bridge: resolve config (only if wrapper installed)
    Bridge-->>Bot: config or standalone default
    Bot-->>User: reply
```

The bot tier never imports the wrapper directly — the bridge resolves config the same way whether you run bot-tier standalone or the full `praisonai` install.

***

## Ownership Table

Each tier owns a clear slice and must not depend upward.

| Tier | Package             | Owns                                                                   | Must not depend on                         |
| ---- | ------------------- | ---------------------------------------------------------------------- | ------------------------------------------ |
| 1    | `praisonaiagents`   | Agent, tools, memory, hooks, protocols                                 | any wrapper                                |
| 2a   | `praisonai-code`    | `run`/`chat`/`code`, Typer CLI, runtime, LLM                           | `praisonai` PyPI (lazy bridge only)        |
| 2b   | `praisonai-bot`     | Bots, gateway, channel CLI, OS daemon, **gateway scheduler tick**      | `praisonai` PyPI (lazy bridge for jobs/UI) |
| 2c   | `praisonai-train`   | LLM fine-tuning (Unsloth), iterative agent training, `train` CLI group | `praisonai` PyPI                           |
| 2d   | `praisonai-browser` | Extension bridge, CDP agent, Playwright engine, browser CLI            | `praisonai` PyPI                           |
| 2e   | `praisonai-mcp`     | Heavy MCP host, adapters, recipe bridge, HTTP-stream auth              | `praisonai` PyPI (lazy `_wrapper_bridge`)  |
| 3    | `praisonai`         | Framework adapters (CrewAI/AutoGen), serve, dashboard, async jobs API  | —                                          |

**Publish order:** `praisonaiagents` → `praisonai-code` + `praisonai-bot` + `praisonai-train` + `praisonai-browser` + `praisonai-mcp` → `praisonai`

***

## Config Kernel

Shared configuration lives in `praisonai_code/cli/configuration/`. The `praisonai-bot` tier reaches it through a lazy internal bridge, so the bot package stays installable on its own without importing the wrapper. You never call this bridge directly — it resolves config the same way whether you run bot-tier standalone or the full wrapper.

***

## Common Patterns

### Embed agents in my app

Install the SDK and call `Agent` directly.

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent

agent = Agent(name="assistant", instructions="You are a helpful assistant.")
agent.start("Summarise the latest release notes.")
```

### Deploy a bot with scheduled updates, no CrewAI

Install the bot tier and run a scheduled agent tick — no wrapper required.

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import asyncio
from praisonaiagents import Agent
from praisonaiagents.scheduler import ScheduleRunner, FileScheduleStore
from praisonai_bot.scheduler import ScheduledAgentExecutor

agent = Agent(name="watcher", instructions="Summarise new alerts.")
runner = ScheduleRunner(FileScheduleStore("./schedules"))
executor = ScheduledAgentExecutor(runner=runner, agent_resolver=lambda _id: agent)

asyncio.run(executor.run_loop(interval=15.0))
```

***

## Best Practices

<AccordionGroup>
  <Accordion title="Start with praisonai unless you know you want a lighter install">
    The full wrapper pulls every tier and is the recommended default. Drop to `praisonai-code`, `praisonai-bot`, `praisonai-train`, `praisonai-browser`, `praisonai-mcp`, or `praisonaiagents` only when you have a specific reason to trim dependencies.
  </Accordion>

  <Accordion title="Shims keep old imports working — you don't need to migrate immediately">
    After the C9 module moves, the old `praisonai.scheduler.executor` and `praisonai.scheduler.condition_gate` paths remain importable as backward-compatibility shims when the wrapper is installed. New code should import from `praisonai_bot.scheduler.*`, but existing code keeps running.
  </Accordion>

  <Accordion title="The scheduler tick works standalone from bot tier; RunPolicy needs the wrapper">
    `ScheduledAgentExecutor` ships in `praisonai-bot`, so scheduled ticks run without the wrapper. The `RunPolicy` safety gate stays in `praisonai` — install the wrapper if you need it for unattended runs.
  </Accordion>
</AccordionGroup>

***

## Related

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/docs/installation">
    Six-package install comparison
  </Card>

  <Card title="praisonai-browser Package" icon="box" href="/docs/features/praisonai-browser-package">
    Browser-tier package guide
  </Card>

  <Card title="praisonai-mcp Package" icon="plug" href="/docs/features/praisonai-mcp-package">
    MCP-host package guide
  </Card>

  <Card title="praisonai-bot SDK" icon="comments" href="/docs/sdk/praisonai-bot/index">
    Bot-tier package reference
  </Card>

  <Card title="praisonai-train Package" icon="graduation-cap" href="/docs/features/praisonai-train-package">
    Training-tier package guide
  </Card>

  <Card title="Scheduler Pre-Run Gate" icon="filter" href="/docs/features/scheduler-pre-run-gate">
    Cost-efficiency gate for scheduled ticks
  </Card>

  <Card title="Scheduled Run Policy" icon="shield-halved" href="/docs/features/scheduled-run-policy">
    Safety gate for unattended runs
  </Card>
</CardGroup>
