Skip to content

[`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
LangGraphRunnerRunner 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.

Initialize LangGraph runner.

‘langgraph’

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.

Execute the LangGraph workflow.

Args: crew: Compiled LangGraph. inputs: Inputs for the workflow.

Returns: Workflow output as string.

Get LangChain-compatible LLM.

Args: model: Optional model name override.

Returns: LangChain ChatAnthropic LLM.

Build a LangGraph-compatible agent.

Args: agent_config: Agent configuration. tools: Optional tools.

Returns: LangGraph agent.

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.

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.