Skip to main content
Sub-commands load on demand — only the module you actually use is imported, so every praisonai invocation starts in milliseconds regardless of how many commands exist.

Quick Start

1

Run a prompt directly

No sub-command is needed — and no sub-command modules load:
from praisonaiagents import Agent

Agent(
    name="Assistant",
    instructions="You are a helpful assistant",
).start("Summarise the latest sales report")
The CLI equivalent is identical in startup cost:
praisonai "Summarise the latest sales report"
2

Run a sub-command

Only the matching module loads — the other ~77 commands stay unloaded:
praisonai chat
3

List all available commands

praisonai --help

How It Works

PraisonAI keeps a static map of command names (_COMMAND_GROUPS in praisonai/cli/app.py). When you run praisonai chat, the CLI checks that map and imports only the chat module. All other ~77 modules are never touched.

Best Practices

Lazy command dispatch is always on — no flag, no environment variable. Every praisonai invocation benefits automatically.
Add an entry to _COMMAND_GROUPS in praisonai/cli/app.py:
_COMMAND_GROUPS = {
    # existing entries ...
    "mycommand": ".commands.mycommand",
}
Without this entry, praisonai --help won’t list your command and dispatch won’t reach it.
Run the built-in diagnostic to check your CLI setup:
praisonai doctor

Lazy Imports & Fast Startup

SDK-side lazy imports for litellm, chromadb, and mem0 — a different but complementary optimization

Performance Benchmarks

Measured startup times and memory usage across PraisonAI versions