Skip to content

[`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-agent
framework = detect_framework()
# Get runner for that framework
runner = get_runner(framework)
# Or let it auto-select
runner = get_runner() # Uses best available
# Get single-agent CLI runner
from agentic_crew.core.decomposer import get_cli_runner
runner = get_cli_runner("aider")
is_framework_availableCheck if a framework is installed and importable.
detect_frameworkDetect the best available AI framework.
get_available_frameworksGet list of all available frameworks.
get_runnerGet a runner for the specified or auto-detected framework.
get_cli_runnerGet a single-agent CLI runner for the specified profile.
get_available_cli_runnersGet list of available CLI runner profiles.
is_cli_runner_availableCheck if a CLI runner profile is available (tool installed).
decompose_crewDecompose a crew configuration to a framework-specific crew.
_get_install_commandGet the pip install command for a framework.
run_crew_autoRun a crew using the best available framework.
_framework_cache
FRAMEWORK_PRIORITY

None

agentic_crew.core.decomposer.FRAMEWORK_PRIORITY

Section titled “agentic_crew.core.decomposer.FRAMEWORK_PRIORITY”

[‘crewai’, ‘langgraph’, ‘strands’]

Check if a framework is installed and importable.

Args: framework: Framework name (crewai, langgraph, strands)

Returns: True if framework is available

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.

Get list of all available frameworks.

Returns: List of framework names that are installed.

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.

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:

runner = get_cli_runner(“aider”) result = runner.run(“Add error handling to auth.py”)

# Use with model override
runner = get_cli_runner("ollama", model="deepseek-coder")
result = runner.run("Fix the bug")
# Use custom config
runner = get_cli_runner({
"command": "my-tool",
"task_flag": "--task",
"auto_approve": "--yes",
})

Get list of available CLI runner profiles.

Returns: List of profile names (e.g., [“aider”, “claude-code”, “ollama”]).

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.

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.

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.