[`agentic_crew.runners.langgraph_runner`](#module-agentic_crew.runners.langgraph_runner)
LangGraph runner implementation.
LangGraph excels at:
- Complex conditional flows
- State management
- Cycles and loops
- Integration with LangChain ecosystem
Module Contents
Section titled “Module Contents”Classes
Section titled “Classes”LangGraphRunner | Runner that uses LangGraph for crew execution. |
|---|
class agentic_crew.runners.langgraph_runner.LangGraphRunner
Section titled “class agentic_crew.runners.langgraph_runner.LangGraphRunner”Bases: agentic_crew.runners.base.BaseRunner
Runner that uses LangGraph for crew execution.
Initialization
Section titled “Initialization”Initialize LangGraph runner.
framework_name
Section titled “framework_name”‘langgraph’
build_crew(crew_config: dict[str, Any]) → Any
Section titled “build_crew(crew_config: dict[str, Any]) → Any”Build a LangGraph workflow from configuration.
Converts crew format to a LangGraph StateGraph with agents as nodes and tasks as edges.
Args: crew_config: Universal crew configuration.
Returns: Compiled LangGraph StateGraph.
run(crew: Any, inputs: dict[str, Any]) → str
Section titled “run(crew: Any, inputs: dict[str, Any]) → str”Execute the LangGraph workflow.
Args: crew: Compiled LangGraph. inputs: Inputs for the workflow.
Returns: Workflow output as string.
get_llm(model: str | None = None) → Any
Section titled “get_llm(model: str | None = None) → Any”Get LangChain-compatible LLM.
Args: model: Optional model name override.
Returns: LangChain ChatAnthropic LLM.
build_agent(agent_config: dict[str, Any], tools: list | None = None) → Any
Section titled “build_agent(agent_config: dict[str, Any], tools: list | None = None) → Any”Build a LangGraph-compatible agent.
Args: agent_config: Agent configuration. tools: Optional tools.
Returns: LangGraph agent.
build_task(task_config: dict[str, Any], agent: Any) → Any
Section titled “build_task(task_config: dict[str, Any], agent: Any) → Any”Build a task representation for LangGraph.
In LangGraph, tasks are typically represented as graph nodes or prompts to agents. Returns a dict for now.
Args: task_config: Task configuration. agent: Agent for the task.
Returns: Task configuration dict with agent reference.
_build_tools_from_tasks(crew_config: dict[str, Any]) → list
Section titled “_build_tools_from_tasks(crew_config: dict[str, Any]) → list”Convert crew tasks to LangChain tools.
For simple crews, we create tools that represent each task’s capability.
Args: crew_config: Crew configuration.
Returns: List of LangChain tools.