Doctor

Comprehensive health checks and diagnostics for PraisonAI

Before you run your first Agent(...), run praisonai doctor --live to make sure your keys and dependencies are in order. The praisonai doctor command provides comprehensive health checks and diagnostics for your PraisonAI installation, configuration, and environment.

Quick Start

bash
# Full setup report (multi-category — first-run / troubleshooting)
praisonai doctor

# Fast env-only checks (CI-friendly)
praisonai doctor --quick        # alias for `praisonai doctor env`
praisonai doctor env

# Run checks for a specific category
praisonai doctor config
praisonai doctor tools

# Output in JSON format
praisonai doctor --json

# CI mode with deterministic output
praisonai doctor ci

Full Setup Report

Running praisonai doctor with no subcommand runs the full multi-category setup report — the recommended first-run and troubleshooting path.

FlagEffect
--quickFast env-only path (alias for praisonai doctor env)
--liveInclude live provider pings — validates API keys, not just presence
--deepEnable deeper probes across all categories
--strictTreat warnings as failures (affects exit code)
--jsonMachine-readable output for CI
bash
# Live check — pings providers with your API keys
praisonai doctor --live

# Deep + strict for release gates
praisonai doctor --deep --strict --json

Subcommands

SubcommandDescription
envCheck environment variables and system configuration
configValidate configuration files (agents.yaml, workflow.yaml)
toolsCheck tool availability and dependencies
dbCheck database drivers and connectivity
mcpCheck MCP server configuration
obsCheck observability providers (Langfuse, LangSmith, etc.)
skillsCheck agent skills directories
memoryCheck memory storage and sessions
permissionsCheck filesystem permissions
networkCheck network connectivity and proxy settings
performanceCheck import times and module counts
ciCI-optimized checks with JSON output
selftestTest agent creation and chat functionality
dockerCheck Docker installation and configuration
llm-providersCheck LLM providers configuration
memory-storeCheck memory store backends
metadata-storeCheck metadata store configuration
fixSafe auto-remediation for common setup issues (dry-run by default). Phase-1 scope: migrate deprecated cli_backend YAML.
runtimeRuntime preflight for team YAML (--team) and migrate legacy cli_backend settings (--fix)

Global Flags

FlagDescription
--quickFast env-only checks (alias for doctor env).
--liveInclude live provider pings (validates keys, not just presence).
--jsonOutput in JSON format
`–format text\json`Output format (default: text)
--output PATHWrite report to file
--deepEnable deeper probes (DB connects, network checks)
--timeout SECPer-check timeout in seconds (default: 10). For optional_deps the timeout is split across packages (max(1, min(3, timeout/4))s each), so --timeout 20 gives up to 3s per package plus safety margin.
--strictTreat warnings as failures
--quietMinimal output
--no-colorDisable ANSI colors
--only IDSOnly run these check IDs (comma-separated)
--skip IDSSkip these check IDs (comma-separated)
--list-checksList available check IDs
--versionShow doctor module version

Exit Codes

Root Command

CodeMeaning
0All checks passed
1One or more checks failed (or warnings in strict mode)
2Internal error

CI Mode

CodeMeaning
0All checks passed
1One or more checks failed
2Timeout
3Internal error

Full Setup Report

Running praisonai doctor without a subcommand runs a comprehensive report combining environment, config, tools, and provider checks for first-run and operator troubleshooting.

bash
# Full setup report
praisonai doctor

# Include live provider pings
praisonai doctor --live

# Machine-readable output
praisonai doctor --json

# Treat warnings as failures (useful for strict operator checks)
praisonai doctor --strict

When warnings or failures are found, a “Next steps:” footer lists numbered remediations:

─────────────────────────────
Next steps:
  1. ⚠ Optional Dependencies: Reinstall the broken optional package(s): chromadb (Knowledge/RAG features)
  2. ✗ OpenAI API key: Set OPENAI_API_KEY in your environment or ~/.praisonai/.env
Diagram

First run / troubleshoot

CI / fast check

Auto-remediate issues

Migrate team YAML

praisonai doctor …

Which situation?

praisonai doctor
(bare)

praisonai doctor env
or –quick

praisonai doctor fix

praisonai doctor runtime

Full setup report + Next steps footer

Env checks only — no side-effects

Dry-run proposed fixes — add –execute to apply

Runtime YAML validation / cli_backend migration

doctor fix Auto-Remediation

praisonai doctor fix runs safe auto-remediation for common setup issues.

bash
# Dry-run: list proposed changes without modifying anything (default)
praisonai doctor fix

# Apply safe fixes (creates .bak backup alongside the original file)
praisonai doctor fix --execute

# Apply without creating a backup
praisonai doctor fix --execute --no-backup

# Target a specific YAML file
praisonai doctor fix --file agents.yaml

# Minimal output
praisonai doctor fix --quiet
FlagDefaultDescription
--dry-run / --execute--dry-runPreview proposed changes vs. apply them
--no-backupFalseSkip .bak backup when --execute is set
--file, -f TEXTauto-detectConfig file to target
--quiet, -qFalseMinimal output

Phase-1 scope: migrate deprecated cli_backend YAML configuration to the new models.default.runtime format.

Examples

Environment Checks

bash
# Check all environment settings
praisonai doctor env

# Check with API key visibility
praisonai doctor env --show-keys

Optional Dependencies (deep mode)

bash
# Probe all eight optional packages in parallel
praisonai doctor env --deep

# Machine-readable output for CI
praisonai doctor env --deep --json

--deep enables the optional_deps check, which probes eight optional packages on daemon threads and reports each as available, missing, broken, or slow. A broken package (installed but failing to import) surfaces as WARN with a remediation message; missing and slow packages do not fail the check.

Configuration Validation

bash
# Validate all config files
praisonai doctor config

# Validate specific file
praisonai doctor config --file agents.yaml

# Show expected schema
praisonai doctor config --schema

Database Checks

bash
# Check database drivers
praisonai doctor db

# Test database connectivity (deep mode)
praisonai doctor db --deep

# Check specific provider
praisonai doctor db --provider postgresql

MCP Server Checks

bash
# Check MCP configuration
praisonai doctor mcp

# List MCP tools
praisonai doctor mcp --list-tools

# Test server spawning (deep mode)
praisonai doctor mcp --deep

Skills Diagnostics

bash
# Check skills health
praisonai doctor skills

# Detailed requirements diagnostics
praisonai doctor skills --requirements

# Deep skill validation
praisonai doctor skills --deep

Performance Analysis

bash
# Check import times
praisonai doctor performance

# Set import time budget
praisonai doctor performance --budget-ms 1000

# Show top slow imports
praisonai doctor performance --top 20

Self-Test

bash
# Run mock self-test (no API calls)
praisonai doctor selftest --mock

# Run live self-test with API calls
praisonai doctor selftest --live

# Use specific model
praisonai doctor selftest --live --model gpt-4o

Runtime Preflight

Validate multi-agent team YAML for runtime compatibility before AgentTeam.start(). No LLM calls or API keys required. See Runtime Preflight for the capability matrix and check IDs.

bash
# Preflight team YAML
praisonai doctor runtime --team agents.yaml

# JSON output for CI
praisonai doctor runtime --team team.yaml --json

# Deep mode (flag accepted; runtime checks do not branch on it today)
praisonai doctor runtime --team config.yaml --deep

Runtime Migration

Detect and migrate legacy cli_backend fields to the new models.default.runtime format. See Runtime Config Migration for full details.

bash
# Scan for legacy configuration
praisonai doctor runtime

# Preview what would change (dry-run)
praisonai doctor runtime --fix

# Apply migration with backup
praisonai doctor runtime --fix --execute

# Target a specific file
praisonai doctor runtime --fix --execute --file ./teams/agents.yaml

Auto-Remediation (doctor fix)

praisonai doctor fix runs safe auto-remediation for common setup issues — dry-run by default, no changes without --execute.

Phase-1 scope: migrating deprecated cli_backend YAML configuration. This does not yet fix all possible issues.

  • Dry-run by default; --execute applies changes.
  • A .bak backup is created on --execute unless --no-backup.
  • --file/-f targets a specific YAML; otherwise searches cwd.
  • --quiet/-q suppresses non-essential output.
FlagDefaultPurpose
--dry-run / --execute--dry-runPreview vs apply
--no-backupFalseSkip .bak creation on execute
--file, -f TEXTauto-detect in cwdSpecific config file to fix
--quiet, -qFalseMinimal output
bash
# Preview what would change (default)
praisonai doctor fix

# Apply safe fixes with .bak backup
praisonai doctor fix --execute

# Apply without creating .bak files
praisonai doctor fix --execute --no-backup

# Target a specific file
praisonai doctor fix --file ./teams/agents.yaml

See also: Runtime Config Migration — describes the cli_backend→runtime mapping that fix currently automates.

Docker Checks

bash
# Check Docker installation and configuration
praisonai doctor docker

# Deep probes
praisonai doctor docker --deep

# JSON output
praisonai doctor docker --json

LLM Provider Checks

bash
# Check LLM providers configuration
praisonai doctor llm-providers

# Deep probes
praisonai doctor llm-providers --deep

# JSON output
praisonai doctor llm-providers --json

Memory Store Checks

bash
# Check memory store backends
praisonai doctor memory-store

# Deep probes
praisonai doctor memory-store --deep

# JSON output
praisonai doctor memory-store --json

Metadata Store Checks

bash
# Check metadata store configuration
praisonai doctor metadata-store --json

CI Integration

bash
# Run CI checks with JSON output
praisonai doctor ci

# Fail fast on first error
praisonai doctor ci --fail-fast

# Save report to file
praisonai doctor ci --output report.json

Filtering Checks

bash
# List all available checks
praisonai doctor --list-checks

# Run only specific checks
praisonai doctor --only python_version,openai_api_key

# Skip specific checks
praisonai doctor --skip network_dns,network_https

# Combine filters
praisonai doctor env --only openai_api_key,anthropic_api_key

Status Symbols

The text formatter automatically picks symbols that match your terminal encoding.

StatusUTF-8 terminalsNon-UTF-8 terminals (e.g. Windows cp1252)
Pass✓[OK]
Warn⚠[!]
Fail✗[X]
Skip○[-]
Error✗[X]

Use --json for machine-readable output that does not depend on terminal encoding.

Diagram

UTF-8

cp1252 / ascii / other

praisonai doctor

stdout
encoding?

✓ ⚠ ✗ ○

OK ! X –

Render report

JSON Output Format

json
{
  "version": "1.0.0",
  "timestamp": "2025-01-01T00:00:00.000000+00:00",
  "duration_ms": 150.5,
  "environment": {
    "python_version": "3.11.0",
    "os_name": "Darwin",
    "praisonai_version": "2.7.0"
  },
  "results": [
    {
      "id": "python_version",
      "title": "Python Version",
      "category": "environment",
      "status": "pass",
      "message": "Python 3.11.0 (>= 3.9 required)",
      "duration_ms": 0.5
    },
    {
      "id": "optional_deps",
      "title": "Optional Dependencies",
      "category": "environment",
      "status": "warn",
      "message": "5 available, 2 missing, 1 slow/skipped (chromadb)",
      "metadata": {
        "slow": ["chromadb"],
        "missing": ["crawl4ai", "praisonaiagents-embeddings"]
      }
    }
  ],
  "summary": {
    "total": 50,
    "passed": 45,
    "warnings": 3,
    "failed": 1,
    "skipped": 1,
    "errors": 0
  },
  "exit_code": 1
}

Optional Dependencies

praisonai doctor probes optional packages in parallel on daemon threads, one per package, with a per-package timeout.

Packages probed:

  • chromadb — Knowledge/RAG features
  • crawl4ai — Web crawling
  • duckduckgo_search — Web search
  • praisonaiagents — Core agents
  • litellm — LLM providers
  • openai — OpenAI provider
  • anthropic — Anthropic provider
  • mem0 — Memory features

Each package falls into one of four outcome buckets:

BucketStatusMeaning
availablePASSImport succeeded
missinginformationalImportError raised — not installed
brokenWARNOther exception during import (e.g. broken C extension) — remediation: reinstall
slowinformationalThread still alive past deadline — daemon thread abandoned, never blocks CLI exit

When any package is broken, the check reports WARN with the remediation message:

Reinstall the broken optional package(s): {names}

Check Categories

Diagram

praisonai-code doctor exit code

Yes

No

No

Yes

📋 doctor invoked

🔍 praisonai wrapper installed?

🧠 Run every check

⏭ SKIP 4 wrapper checks + retarget python -m

Any core FAIL?

✅ exit 0

⛔ exit 1

Environment (env)

  • Python version validation
  • Package installation checks
  • API key configuration
  • OS and architecture info
  • Virtual environment detection
  • Binary availability (git, docker, npx)
  • Optional dependencies deep probe (--deep) — runs concurrently with a per-package timeout; slow imports are reported as slow/skipped instead of blocking the full check.

Configuration (config)

  • agents.yaml existence and syntax — the framework: field is validated against the adapter registry, so any installed adapter (built-in or third-party entry-point plugin) passes the check
  • workflow.yaml validation
  • Project config directory — canonical .praisonai/ first, with a legacy .praison/ read-only fallback
  • .env file detection

Tools (tools)

  • Tool registry access
  • Web search tools
  • File operation tools
  • Code execution tools
  • API key requirements

Database (db)

  • Driver availability (PostgreSQL, SQLite, Redis, MongoDB)
  • ChromaDB for RAG
  • Connection testing (deep mode)

MCP (mcp)

  • Configuration file validation
  • npx availability
  • Python MCP package
  • Server configuration validation
  • Server spawn testing (deep mode)

Observability (obs)

  • Langfuse configuration
  • LangSmith configuration
  • AgentOps configuration
  • PraisonAI telemetry

Skills (skills)

  • Skills directory discovery
  • SKILL.md validation
  • PraisonAI skills module
  • Capability requirements (active/degraded/unavailable counts, enforcement level)

Memory (memory)

  • Memory directories
  • JSON file integrity
  • Session storage
  • ChromaDB vector memory

Permissions (permissions)

  • ~/.praison directory (legacy home fallback — intentionally not migrated in PR #4946)
  • Project .praison directory (legacy fallback — intentionally not migrated in PR #4946)
  • Temp directory
  • Current working directory
  • Config directory

Network (network)

  • DNS resolution (deep mode)
  • HTTPS connectivity (deep mode)
  • Proxy configuration
  • SSL/TLS settings
  • OpenAI base URL

Performance (performance)

  • Package import times
  • Slow import detection (deep mode)
  • Loaded module count

performance_praisonai_import skips with reason “Install full wrapper: pip install praisonai” when pip install praisonai-code is used without the praisonai wrapper (PR #2851).

Packaging (packaging)

  • praisonai_package_structure — validates the praisonai wrapper’s __main__.py entry point
  • console_script_execution — runs praisonai --version
  • python_module_execution — runs python -m {praisonai|praisonai_code} --version (retargets on standalone)

praisonai_package_structure and console_script_execution skip with reason “Install full wrapper: pip install praisonai” when pip install praisonai-code is used without the praisonai wrapper (PR #2851). python_module_execution does not skip — it retargets to python -m praisonai_code --version on standalone.

Self-Test (selftest)

  • Agent import
  • Agent instantiation
  • LLM configuration
  • Mock/live chat testing
  • Tools wiring

Runtime (runtime)

  • Team YAML runtime compatibility (--team)
  • Handoff and capability validation across agents
  • Mixed-runtime warnings
  • Legacy cli_backend migration (--fix, --execute) — also reachable via top-level praisonai doctor fix
  • Workflow YAML placeholder (--workflow — returns SKIP)

Skips with reason “Install full wrapper: pip install praisonai” when pip install praisonai-code is used without the praisonai wrapper.

Serve & Endpoints (serve)

  • Serve module availability
  • Endpoints module availability
  • Endpoints CLI handler
  • Server connectivity (deep mode)
  • Discovery endpoint (deep mode)
  • A2U module availability
  • Provider adapters availability
  • FastAPI availability
  • Uvicorn availability

Skips with reason “Install full wrapper: pip install praisonai” when pip install praisonai-code is used without the praisonai wrapper.

Bots (bots)

  • Bot token environment variables (bot_tokens)
  • Bot.yaml configuration file validation (bot_config) †
  • Bot security configuration checks (bot_security) †
  • Multi-channel token configuration validation (multi_channel_tokens) † — MEDIUM
  • Gateway config validation (gateway_config_validation) † — HIGH
  • Gateway security settings (gateway_security) † — HIGH
  • Gateway config migration (gateway_config_migration) † — MEDIUM
  • Gateway environment variables (gateway_env_substitution) — MEDIUM
  • Gateway shell readiness (gateway_shell_readiness) † — HIGH
  • Gateway channel probe (gateway_channel_probe) † — HIGH, deep-only (--deep)
  • Gateway duplicate services (gateway_duplicate_services) † — HIGH, deep-only (--deep)
  • Gateway recent inbound (gateway_no_inbound_recent) † — MEDIUM, deep-only (--deep)

Skips with reason "Install full wrapper: pip install praisonai" when pip install praisonai-code is used without the praisonai wrapper.

ACP

  • acp_module — ACP module import (praisonai.acp)
  • ACP server reachability
  • ACP protocol handshake validation
  • Agent Client Protocol configuration

Skips with reason “Install full wrapper: pip install praisonai” when pip install praisonai-code is used without the praisonai wrapper.

Multi-Channel Token Check Details

The multi_channel_tokens check validates your multi-channel bot setup:

Category: BOTS

Severity: MEDIUM

PASS Conditions:

  • Each channel uses a unique environment variable
  • Each environment variable resolves to a unique token value
  • Follows `PLATFORM_

_BOT_TOKEN` naming convention

WARN Conditions:

  • Environment variable doesn’t follow naming convention
  • Environment variable is unset but referenced in config

FAIL Conditions:

  • Two channels point to the same environment variable
  • Two environment variables resolve to the same token value

Skip Condition:

  • bot.yaml missing → check is skipped

Sample Remediation Messages:

  • “Each channel must have a unique bot token. Create separate bots in @BotFather and use unique environment variables.”
  • “Consider following the naming convention PLATFORM_ROLE_BOT_TOKEN for clarity.”

Gateway Config Validation (gateway_config_validation)

Severity: HIGH

StatusCondition
PASSgateway.yaml or bot.yaml validates against GatewayConfigSchema; message includes channel and agent counts.
WARNNo config file found — suggests praisonai onboard.
FAILSchema validation errors in the config file.
bash
praisonai doctor --only gateway_config_validation

Gateway Security (gateway_security)

Severity: HIGH

StatusCondition
PASSEvery channel has user restrictions (or unknown_user_policy: pair), tokens, and no critical issues.
WARNrespond_all group policy, GATEWAY_AUTH_TOKEN not set, or a channel has no allowed_users/allowlist/blocklist with the default unknown_user_policy=deny (DMs from unknown users are dropped).
FAILA channel has no allowed_users/allowlist/blocklist and unknown_user_policy=allow (bot responds to EVERYONE), or a required token is missing.
SKIPNo config file found.

As of PR #6046, the empty-restrictions verdict mirrors the resolved unknown_user_policy: allow fails, deny (default) warns, pair passes.

bash
praisonai doctor --only gateway_security

Gateway Config Migration (gateway_config_migration)

Severity: MEDIUM

StatusCondition
PASSConfig already uses the canonical format.
WARNLegacy single-bot, BotOS platforms:, or string allowed_users detected — migration available.
SKIPNo config file found.
bash
praisonai doctor --only gateway_config_migration

See Gateway Config Migration for before/after examples.

Gateway Environment Variables (gateway_env_substitution)

Severity: MEDIUM

StatusCondition
PASSAll ${VAR} references in the config resolve (or none referenced).
FAILOne or more referenced environment variables are unset.
SKIPNo config file found.
bash
praisonai doctor --only gateway_env_substitution

Gateway Shell Readiness (gateway_shell_readiness)

Severity: HIGH

Offline validation of allow_shell / auto_approve_shell / approval wiring per channel — no LLM or network calls. Auto-discovers config from --file, then gateway.yaml, then bot.yaml.

StatusCondition
PASSEvery allow_shell: true channel has execute_command wired, an approval backend, and a synced approval registry. Also PASS when no channel enables shell.
WARNNo gateway/bot config found.
FAILOne or more channels have missing shell tools, no approval backend, or an unsynced approval registry.

The check builds each shell-enabled channel through the same enable_shell_tools() path the gateway uses, so an exposed/multi-user channel that would be downgraded surfaces as a WARN — matching the gateway’s runtime WARN when auto_approve_shell: true is set on a 0.0.0.0 bind or a channel with a group_policy without auto_approve_shell_acknowledge_exposed: true. See Bot Shell Execution → Exposure-aware auto-approval.

bash
praisonai doctor --only gateway_shell_readiness
praisonai doctor bots --file /path/to/bot.yaml

Gateway Channel Probe (gateway_channel_probe)

Severity: HIGH · Deep-only (requires_deep=True)

Live per-channel credential probe (auth.test / getMe / identify). Runs only under praisonai doctor --deep or praisonai doctor bots --deep.

StatusCondition
PASSEvery channel’s credentials probe successfully (surfaces bot identity).
FAILOne or more channels fail the probe. Remediation points at praisonai gateway test --config <path>.
SKIPNo config file or no channels configured.
bash
praisonai doctor bots --deep --only gateway_channel_probe
praisonai doctor --deep --only gateway_channel_probe

Gateway Duplicate Services (gateway_duplicate_services)

Severity: HIGH · Deep-only (requires_deep=True)

Scans for competing gateway services and shared Slack tokens — the same scan behind praisonai gateway test --check-duplicates. Inspects macOS LaunchAgents (ai.praison.bot, ai.hermes.gateway), both .env files, and Hermes runtime state. Runs only under praisonai doctor --deep.

StatusCondition
PASSNo duplicate LaunchAgent conflict and no shared token fingerprint.
WARNA competing gateway, shared *_TOKEN fingerprint, or connected Hermes Slack channel is detected.
SKIPNo gateway/bot config found.

Remediation: “Compare SLACK_APP_TOKEN across services; stop duplicate gateways before messaging Slack.” See Duplicates tier.

bash
praisonai doctor --deep --only gateway_duplicate_services

Gateway Recent Inbound (gateway_no_inbound_recent)

Severity: MEDIUM · Deep-only (requires_deep=True)

Scans the gateway log for recent @mention received: markers (last 10 minutes) — the same check behind praisonai gateway test --check-inbound. Runs only under praisonai doctor --deep.

StatusCondition
PASSOne or more inbound mentions found in the window.
WARNNo inbound delivery in recent logs — hint suggests messaging the bot.
SKIPNo gateway/bot config found.

Remediation: “Send a Slack @mention to your bot, then run: praisonai gateway test –config &lt;cfg&gt; –check-inbound –since 5m.” See Inbound tier.

bash
praisonai doctor --deep --only gateway_no_inbound_recent