LANGGRAPH
LangGraph graph-based workflows agentic 2024.
Définition
LangGraph key concepts : (1) StateGraph : main graph builder, define states (TypedDict Python or Pydantic models), add nodes (functions taking state -> new state), add edges (transitions between nodes), can be conditional (decide next node based on state). (2) Nodes : Python functions ou LLM calls (ChatOpenAI, ChatAnthropic, etc.), transform state. (3) Edges : (a) Static edges add_edge(source, target), (b) Conditional edges add_conditional_edges(source, condition_function, mapping), enable cycles + dynamic routing. (4) Entry + End points : set_entry_point, set_finish_point. (5) Compile : graph.compile() returns Runnable executor. (6) Persistence : checkpointer SQLite + Redis + Postgres, save state across invocations, enable resume + Human-in-the-Loop interruption. (7) Multi-agent : Supervisor pattern (one agent orchestrates sub-agents), Sequential pattern, Hierarchical pattern. (8) Streaming : stream events + tokens via Runnable streaming API. Integration : LangSmith automatic tracing all nodes + transitions, debugging easy. LangGraph Cloud 2024 : SaaS managed deployment LangGraph workflows, Postgres backend, observability integrated, API access via REST. Use cases : complex multi-step agents, multi-agent collaboration, conversational flows with state, Human-in-the-Loop approval workflows.
Origine
LangGraph initial release janvier 2024 par LangChain Inc. ; ~10000+ GitHub stars 2024 ; LangGraph Cloud SaaS launched mid-2024.
Exemple en contexte
Customer support multi-agent system : LangGraph supervisor agent receives user query + decide which sub-agent invoke (Sales Specialist, Technical Support Specialist, Billing Specialist), each sub-agent has own tools + state, supervisor synthesizes responses + may invoke multiple sub-agents iteratively until query resolved ; LangGraph Cloud hosts production deployment.
Termes liés
- LangChain Agents — predecessor pattern.