[`agentic_crew.core.decomposer`](#module-agentic_crew.core.decomposer)
Framework decomposition - auto-detect and select AI framework.
This module provides the core capability of agentic-crew: declaring crews once and running them on CrewAI, LangGraph, or Strands depending on what’s installed. It also supports single-agent CLI runners for simpler tasks.
Usage: from agentic_crew.core.decomposer import get_runner, detect_framework
# Auto-detect best framework for multi-agentframework = detect_framework()
# Get runner for that frameworkrunner = get_runner(framework)
# Or let it auto-selectrunner = get_runner() # Uses best available
# Get single-agent CLI runnerfrom agentic_crew.core.decomposer import get_cli_runnerrunner = get_cli_runner("aider")Module Contents
Section titled “Module Contents”Functions
Section titled “Functions”is_framework_available | Check if a framework is installed and importable. |
|---|---|
detect_framework | Detect the best available AI framework. |
get_available_frameworks | Get list of all available frameworks. |
get_runner | Get a runner for the specified or auto-detected framework. |
get_cli_runner | Get a single-agent CLI runner for the specified profile. |
get_available_cli_runners | Get list of available CLI runner profiles. |
is_cli_runner_available | Check if a CLI runner profile is available (tool installed). |
decompose_crew | Decompose a crew configuration to a framework-specific crew. |
_get_install_command | Get the pip install command for a framework. |
run_crew_auto | Run a crew using the best available framework. |
_framework_cache | |
|---|---|
FRAMEWORK_PRIORITY |
agentic_crew.core.decomposer._framework_cache : dict[str, bool]
Section titled “agentic_crew.core.decomposer._framework_cache : dict[str, bool]”None
agentic_crew.core.decomposer.FRAMEWORK_PRIORITY
Section titled “agentic_crew.core.decomposer.FRAMEWORK_PRIORITY”[‘crewai’, ‘langgraph’, ‘strands’]
agentic_crew.core.decomposer.is_framework_available(framework: str) → bool
Section titled “agentic_crew.core.decomposer.is_framework_available(framework: str) → bool”Check if a framework is installed and importable.
Args: framework: Framework name (crewai, langgraph, strands)
Returns: True if framework is available
agentic_crew.core.decomposer.detect_framework(preferred: str | None = None) → str
Section titled “agentic_crew.core.decomposer.detect_framework(preferred: str | None = None) → str”Detect the best available AI framework.
Args: preferred: Optional preferred framework. If available, use it.
Returns: Name of the best available framework.
Raises: RuntimeError: If no frameworks are installed.
agentic_crew.core.decomposer.get_available_frameworks() → list[str]
Section titled “agentic_crew.core.decomposer.get_available_frameworks() → list[str]”Get list of all available frameworks.
Returns: List of framework names that are installed.
agentic_crew.core.decomposer.get_runner(framework: str | None = None) → agentic_crew.runners.base.BaseRunner
Section titled “agentic_crew.core.decomposer.get_runner(framework: str | None = None) → agentic_crew.runners.base.BaseRunner”Get a runner for the specified or auto-detected framework.
Args: framework: Framework name or None for auto-detect.
Returns: Runner instance for the framework.
Raises: RuntimeError: If framework not available. ValueError: If unknown framework specified.
agentic_crew.core.decomposer.get_cli_runner(profile: str | dict[str, Any], model: str | None = None) → agentic_crew.runners.single_agent_runner.SingleAgentRunner
Section titled “agentic_crew.core.decomposer.get_cli_runner(profile: str | dict[str, Any], model: str | None = None) → agentic_crew.runners.single_agent_runner.SingleAgentRunner”Get a single-agent CLI runner for the specified profile.
Args: profile: Profile name (e.g., “aider”, “claude-code”, “ollama”) or custom config dict. model: Optional model override.
Returns: LocalCLIRunner instance for the profile.
Raises: ValueError: If profile not found. FileNotFoundError: If profiles file missing.
Examples:
Use built-in profile
Section titled “Use built-in profile”runner = get_cli_runner(“aider”) result = runner.run(“Add error handling to auth.py”)
# Use with model overriderunner = get_cli_runner("ollama", model="deepseek-coder")result = runner.run("Fix the bug")
# Use custom configrunner = get_cli_runner({ "command": "my-tool", "task_flag": "--task", "auto_approve": "--yes",})agentic_crew.core.decomposer.get_available_cli_runners() → list[str]
Section titled “agentic_crew.core.decomposer.get_available_cli_runners() → list[str]”Get list of available CLI runner profiles.
Returns: List of profile names (e.g., [“aider”, “claude-code”, “ollama”]).
agentic_crew.core.decomposer.is_cli_runner_available(profile: str) → bool
Section titled “agentic_crew.core.decomposer.is_cli_runner_available(profile: str) → bool”Check if a CLI runner profile is available (tool installed).
Args: profile: Profile name to check.
Returns: True if the tool is installed and accessible.
agentic_crew.core.decomposer.decompose_crew(crew_config: dict[str, Any], framework: str | None = None) → Any
Section titled “agentic_crew.core.decomposer.decompose_crew(crew_config: dict[str, Any], framework: str | None = None) → Any”Decompose a crew configuration to a framework-specific crew.
This is the core function that converts a framework-agnostic crew definition into a runnable crew for the target framework.
Args: crew_config: Crew configuration from loader. framework: Target framework or None for auto-detect. If crew_config has required_framework, that takes precedence.
Returns: Framework-specific crew object ready to run.
Raises: RuntimeError: If required framework is not available.
agentic_crew.core.decomposer._get_install_command(framework: str) → str
Section titled “agentic_crew.core.decomposer._get_install_command(framework: str) → str”Get the pip install command for a framework.
agentic_crew.core.decomposer.run_crew_auto(crew_config: dict[str, Any], inputs: dict[str, Any] | None = None, framework: str | None = None) → str
Section titled “agentic_crew.core.decomposer.run_crew_auto(crew_config: dict[str, Any], inputs: dict[str, Any] | None = None, framework: str | None = None) → str”Run a crew using the best available framework.
Args: crew_config: Crew configuration from loader. inputs: Optional inputs for the crew. framework: Optional framework override. If crew_config has required_framework (from .crewai/.strands/.langgraph dir), that takes precedence.
Returns: Crew output as string.
Raises: RuntimeError: If required framework is not available. ValueError: If requested framework conflicts with required framework.