PraisonAI Documentation

repository·main·Indexed 27 days ago

https://github.com/mervinpraison/praisonai

An AI workforce platform for deploying autonomous, self-improving agents for research, coding, and workflow automation. It features a Python SDK (praisonaiagents), CLI, visual builders, and a JavaScript SDK. The platform supports multi-agent orchestration, custom tool definition via @tool decorators, Model Context Protocol (MCP) integration, and database persistence. It provides various deployment options including Docker containers for UI, Chat, and API services, as well as integrations for Slack, Discord, and Telegram bots.

Tokens
77.2K
Snippets
184
Records
473
Agent score
93%

What's inside PraisonAI

  1. Understand PraisonAI Telemetry Privacy and Data Collection

    main

    PraisonAI telemetry is designed to be privacy-first and anonymous.

    What is collected:

    • Anonymous session IDs (no user identification)
    • Event counts (agent executions, task completions)
    • Success/failure rates
    • Tool usage patterns

    What is NOT collected:

    • User content (prompts, responses, or data)
    • Personal information (IPs are anonymized)
    • Sensitive data (API keys, passwords)

    To completely opt-out of all tracking, set the environment variable DO_NOT_TRACK=true or PRAISONAI_DISABLE_TELEMETRY=true.

  2. Understand the PraisonAI Python SDK Package Structure

    main

    The Python SDK is organized into three distinct tiers. Depending on your needs, you may interact with different packages:

    • praisonaiagents (Core SDK): Contains the fundamental building blocks including Agent, tools, memory, hooks, and protocols.
    • praisonai-code (Terminal CLI): Provides the command-line interface for run, chat, and code operations.
    • praisonai (Wrapper): Acts as a gateway and includes multi-bot orchestration (BotOS), framework adapters (e.g., CrewAI, AutoGen), and wrapper CLI commands like bot, gateway, and pairing.
  3. PraisonAI Implementation Roadmap

    main

    The PraisonAI development roadmap outlines the transition from the current architecture (C7/C7.1) towards enhanced reliability and operational excellence.

    Current State (Completed):

    • Standalone praisonai-code run/chat/code functionality without wrapper imports.
    • Three-tier ownership boundaries and _wrapper_bridge implementation.
    • CI parity with smoke standalone blocks.

    Upcoming Features (Planned/In Progress):

    • Reliability Core: Cross-platform hardening and deterministic fixtures.
    • Doctor Auto-Fix: Automated environment diagnosis and repairs.
    • Golden-Path CLI: A unified workflow following initruntestdeploy.
    • Trace + Replay: Run timelines, checkpoint replay, and failure classification.
    • Graph Studio UX: A visual editor and inspector for deterministic orchestration.
    • Safe Production Profiles: Policy presets for guardrails, approvals, and cost/time caps.
  4. Explore the PraisonAI Ecosystem

    main

    PraisonAI offers several packages depending on your development needs:

    • Core SDK (praisonaiagents): For pure Python development. pip install praisonaiagents
    • CLI (praisonai): For terminal-based developers. pip install praisonai
    • Claw Dashboard: Connect agents to Telegram, Slack, or Discord. pip install "praisonai[claw]"
    • Flow Visual Builder: Drag-and-drop workflow creation. pip install "praisonai[flow]"
    • PraisonAI UI: A clean chat interface. pip install "praisonai[ui]"
    • JavaScript SDK: For JS/TS environments. npm install praisonai
  5. Core Agent Types in PraisonAI

    main

    PraisonAI supports various agent architectures to suit different complexity levels:

    • Single Agent: A standalone agent performing specific tasks.
    • Multi Agents: Multiple agents collaborating to solve complex problems.
    • Auto Agents: Agents that can autonomously determine their own steps.
    • Self Reflection AI Agents: Agents that review and refine their own outputs.
    • Reasoning AI Agents: Agents designed for deep logical extraction and reasoning.
    • Multi Modal AI Agents: Agents capable of processing multiple types of input (e.g., text and images).
  6. Understand PraisonAI telemetry metrics

    main

    PraisonAI automatically tracks agent executions and task completions. The following metrics are collected and sent to PostHog upon program exit:

    • Agent executions: Total number of times an agent was run.
    • Task completions: Total number of tasks successfully completed within a workflow.
    • Errors: Count of errors encountered during execution.
    • Session ID: A unique identifier for the current session.
  7. Understand the PraisonAI Python Tiered Package Model

    main

    PraisonAI uses a three-tier Python package model to ensure modularity and prevent circular dependencies. Developers should choose the package that matches their specific use case:

    • Tier 1 (Core SDK): praisonaiagents contains the fundamental building blocks: Agents, tools, memory, hooks, and protocols.
    • Tier 2 (Functional Modules): Specialized packages for specific tasks:
      • praisonai-code: Core CLI and runtime (run, chat, code).
      • praisonai-bot: Bots, gateway, channel CLI, and OS daemon.
      • praisonai-train: LLM fine-tuning and agent training.
      • praisonai-browser: Browser automation and extension bridges.
      • praisonai-mcp: Model Context Protocol (MCP) server hosting.
      • praisonai-sandbox: Sandbox backends (Docker, E2B, Modal, etc.).
    • Tier 3 (Wrapper): praisonai provides framework adapters, the dashboard, and the serve command. It acts as a high-level wrapper that can access Tier 2 features via lazy bridges.
  8. Understand PraisonAI MCP Layers

    main

    PraisonAI provides three distinct MCP-related layers. It is important not to conflate them:

    1. Client Layer (praisonaiagents[mcp]): Used to connect agents to external MCP servers.
    2. Light Server Layer (praisonai-code): Provides a basic ToolsMCPServer via the command praisonai serve mcp.
    3. Heavy Host Layer (praisonai-mcp): This package. It provides a full capability/recipe MCP server.
  9. Performance Optimizations in PraisonAI Agents

    main

    PraisonAI agents have been optimized for faster initialization and execution, particularly for simple tasks like agent.start("..."). These optimizations are transparent to the user and maintain 100% backward compatibility with all existing public APIs.

    Key performance benefits include:

    • Initialization time: ~50% faster.
    • First response time: ~30% faster.
    • Memory usage: ~40% lower.

    Optimizations include lazy loading of the rich console, system prompt caching, tool formatting caching, deferred knowledge processing, one-time logging configuration, and lazy agent ID generation.

  10. Performance Optimizations in the LLM Class

    main

    The PraisonAI LLM class includes several internal performance optimizations designed to speed up agent initialization and tool processing. These optimizations are automatic and transparent to the user, maintaining 100% backward compatibility with existing public APIs.

    Key performance features include:

    • Fast Initialization: Subsequent LLM instances are ~3.4x faster due to one-time logging configuration.
    • Efficient Tool Processing: Tool formatting is up to 1764x faster on cache hits using an internal _formatted_tools_cache.
    • Memory Management: An internal _max_cache_size of 100 prevents unbounded memory growth during long-running sessions.
    • Lazy Loading: The console object is only instantiated when accessed, saving initialization time when verbose=False.
  11. Quickstart PraisonAI Browser CLI

    main

    Use the praisonai-browser CLI to start the browser service, execute automation tasks, or run diagnostic checks.

    1. Start the browser service on a specific port:
    praisonai-browser start --port 8765
    1. Run an automation task with a natural language goal:
    praisonai-browser run "Search for AI news on Google"
    1. Run diagnostics to check the environment:
    praisonai-browser doctor

    Note: If using the full praisonai stack, use the commands praisonai browser start and praisonai browser run "..." instead.

    praisonai-browser start --port 8765
    praisonai-browser run "Search for AI news on Google"
    praisonai-browser doctor