Skip to main content
Check whether optional frameworks and dependencies are installed before you run agents or YAML workflows.
The user runs YAML without naming a framework; PraisonAI probes installed adapters and picks the first available.

How It Works

Quick Start

1

Run YAML — framework auto-detected

ag2 is registered and can be requested explicitly via --framework ag2 or framework: ag2 in YAML, but it is not part of the auto-detect chain because its adapter is an unimplemented stub. Selecting it explicitly will raise NotImplementedError at run time until a full implementation lands.
2

Probe before selecting a framework


API Reference


Known Probe Names

The following framework names are supported:
google_adk detection uses a three-step probe in _google_adk_probe(): (1) importlib.metadata.distribution("google-adk") — the PyPI dist must be installed; (2) importlib.util.find_spec("google.adk") — the namespace must be discoverable; (3) from google.adk.agents import Agent with fallback to from google.adk import Agent. All three must succeed for is_available("google_adk") to return True. Install with pip install 'praisonai-frameworks[google-adk]' or pip install 'praisonai[google-adk]'.
Vector store backends use the same centralized probe registry — praisonai.adapters.vector_stores calls is_available("chromadb") / is_available("pinecone") rather than maintaining its own _check_* helpers.
autogen_v2 is an adapter name registered in FrameworkAdapterRegistry, not a probe name in _framework_availability. The probe name remains autogen (it imports the autogen v0.2 package). Use the adapter’s .is_available() method to test whether a specific adapter will dispatch successfully — it folds in the implemented marker.

Adapter Availability vs Framework Availability

Two distinct concepts affect whether an AutoGen-family adapter will actually work: For AutoGen v0.4 and AG2 today: the package may import successfully, but the adapter still reports False because implemented = False. This is the safety-by-default behaviour added in PR #2086.

AG2 Detection Quirk

AG2 ships under the autogen namespace, so is_available("ag2") checks both:
  1. importlib.metadata.distribution('ag2') - Ensures AG2 distribution is installed
  2. importlib.util.find_spec("autogen") - Ensures autogen namespace is importable
This prevents false positives when only the legacy AutoGen package is installed.

Cache Management

Results are cached indefinitely until explicitly invalidated:

Thread Safety

The availability checker uses double-checked locking under threading.Lock for thread-safe caching:

Custom Adapter Usage

Plugin authors can use _framework_availability for their is_available() implementations:
Third-party adapters cannot extend the known probe names at runtime. The _PROBES dict is module-level and not extensible via public API.

Testing Support

Use invalidate() in tests that mock importlib:

Backward-compat constants on praisonai.agents_generator

Six module-level constants are available for backward compatibility and can be imported directly from praisonai.agents_generator.
For new code, use is_available("crewai") directly rather than importing these constants.

Best Practices

Package probes (is_available("autogen_v4")) only confirm importability. Use AutoGenV4Adapter().is_available() when you need to know whether execution will actually succeed.
Cached results persist for the process lifetime. Call invalidate() before and after monkey-patching importlib so probes re-run cleanly.
Custom adapters should delegate to is_available() rather than importing large packages on every CLI startup probe.
For default framework selection, call FrameworkAdapterRegistry.pick_default() rather than hard-coding probe tuples.

Framework Adapter Plugins

Creating custom framework adapters

AutoGen Framework

AutoGen framework integration

Google ADK Framework

Google ADK framework integration