Skip to main content
The user installs a third-party package; entry points register CLI and agent backends in one registry. Integration Registry enables third-party developers to add custom CLI tools, managed agents, and agent backends to PraisonAI through a centralized plugin system.

Quick Start

1

Use a built-in integration

2

Register at runtime

3

Distribute as a pip plugin


How It Works

Before PR #1763, praisonai/integrations/__init__.py had a 70-line if/elif ladder in __getattr__ that mapped attribute names to lazy imports. After #1763, the ladder is replaced by a 4-line dispatch backed by INTEGRATIONS_REGISTRY. The registry:
  • Subclasses the generic PluginRegistry[T] from praisonai._registry
  • Loads built-in integrations lazily (CLI tools, managed agents, sandboxed agents, hosted/local agent backends, registry helpers)
  • Supports third-party integrations via the new entry-point group praisonai.integrations — distribute a pip package, no code changes to praisonai
  • Exposes a get_by_attr(module_name, attr_name) helper that raises AttributeError (not ValueError) so the dispatch slots into module-level __getattr__

Configuration / API

INTEGRATIONS_REGISTRY remains available as a module-level name for backward compatibility — the first access triggers construction. Use get_integrations_registry() in new code to make the lazy build explicit. Underscore-prefixed submodule names (for example from praisonai.integrations import _unified_registry) now import normally instead of triggering registry construction.

Built-in Integrations

The registry includes these built-in integrations with lazy loading:

CLI Tools

  • ClaudeCodeIntegration — Claude Code CLI integration
  • GeminiCLIIntegration — Gemini CLI tools
  • CodexCLIIntegration — Codex CLI interface
  • CursorCLIIntegration — Cursor CLI integration
  • BaseCLIIntegration — Base class for CLI tools
  • CLIExecutionError — CLI execution error class

Managed Agents

  • ManagedAgent (alias: ManagedAgentIntegration) — Managed agent interface
  • AnthropicManagedAgent — Anthropic-specific managed agent
  • ManagedConfig (alias: ManagedBackendConfig) — Managed agent configuration

Local & Sandboxed Agents

  • LocalManagedAgent — Local managed agent
  • LocalManagedConfig — Local agent configuration
  • SandboxedAgent — Sandboxed agent execution
  • SandboxedAgentConfig — Sandboxed agent configuration

Agent Backends

  • HostedAgent — Hosted agent backend
  • HostedAgentConfig — Hosted agent configuration
  • LocalAgent — Local agent backend
  • LocalAgentConfig — Local agent configuration

Registry Functions

  • get_available_integrations — List available integrations
  • ExternalAgentRegistry — External agent registry
  • get_registry — Get integration registry
  • register_integration — Register new integration
  • create_integration — Create integration instance

Advanced Usage

Adding a New Built-in Backend

Built-in CLI backends (Claude Code, Gemini, Codex, Cursor) are registered from a single canonical module: praisonai/integrations/_cli_loaders.py. It exports CLASS_NAME_LOADERS (class-name → loader) used by IntegrationRegistry, and BUILTIN_INTEGRATIONS (short-alias → loader) used by ExternalAgentRegistry. Register a new built-in backend in one place and both registry surfaces pick it up.

Build Your Own Namespace

Use create_lazy_getattr(registry) from praisonai._registry for plugin authors who want to give their own package the same lazy-loading + entry-point dispatch behaviour:

Common Patterns

Last-write-wins on the canonical name.
Both the alias and the canonical name resolve.
Construct your own IntegrationRegistry() for per-tenant registration that doesn’t leak.

Best Practices

Always use a _loader function, never import the integration at module top-level — that defeats the lazy-loading:
Names are case-insensitive; pick the canonical form (matching the class name) for the registration key:
Don’t bypass the registry to import internal integration modules directly — those paths are not part of the public API:

Framework Adapter Plugins

Plugin system for multi-agent frameworks

Persistence Backend Plugins

Add custom storage backends