{"id":35,"library":"langgraph","title":"LangGraph","description":"LangGraph is a low-level agent orchestration framework providing graph-based execution with durable state, built-in persistence, and human-in-the-loop patterns. As of v1.0 it is the foundational runtime for LangChain agents. Use LangChain for high-level agent abstractions, LangGraph for fine-grained control.","status":"active","version":"1.0.x","language":"python","source_language":"en","source_url":"https://changelog.langchain.com/announcements/langgraph-1-0-is-now-generally-available","tags":["langgraph","agents","orchestration","state-machine","python","nodejs","multi-agent"],"install":[{"cmd":"pip install langgraph","lang":"bash","label":"Python"},{"cmd":"npm install @langchain/langgraph","lang":"bash","label":"Node.js"}],"dependencies":[{"reason":"Required for high-level agent abstractions built on LangGraph runtime.","package":"langchain","optional":true},{"reason":"Required for persistent checkpointing with SQLite. Use for local dev.","package":"langgraph-checkpoint-sqlite","optional":true},{"reason":"Required for persistent checkpointing with Postgres. Use for production.","package":"langgraph-checkpoint-postgres","optional":true}],"imports":[{"note":"Core graph primitive. Unchanged in 1.0.","symbol":"StateGraph","correct":"from langgraph.graph import StateGraph"},{"note":"langgraph.prebuilt deprecated in 1.0. create_react_agent moved to langchain.agents. Use create_agent from langchain instead.","wrong":"from langgraph.prebuilt import create_react_agent","symbol":"create_react_agent","correct":"from langchain import create_agent"},{"note":"In-memory checkpointer for dev/testing. Not for production.","symbol":"MemorySaver","correct":"from langgraph.checkpoint.memory import MemorySaver"}],"quickstart":{"code":"from langgraph.graph import StateGraph, END\nfrom typing import TypedDict\n\nclass State(TypedDict):\n    messages: list\n\ndef call_model(state: State):\n    # your LLM call here\n    return {\"messages\": state[\"messages\"]}\n\ngraph = StateGraph(State)\ngraph.add_node(\"agent\", call_model)\ngraph.set_entry_point(\"agent\")\ngraph.add_edge(\"agent\", END)\n\napp = graph.compile()\nresult = app.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"hello\"}]})","lang":"python","description":"Minimal single-node StateGraph in LangGraph 1.0."},"warnings":[{"fix":"Replace from langgraph.prebuilt import create_react_agent with from langchain import create_agent","message":"langgraph.prebuilt module deprecated in 1.0. All prebuilt functionality moved to langchain.agents.","severity":"deprecated","affected_versions":"< 1.0.0"},{"fix":"Pin langgraph-prebuilt==1.0.1 explicitly or upgrade to latest langgraph","message":"langgraph-prebuilt==1.0.2 introduced a breaking signature change to ToolNode.afunc adding a required runtime parameter. langgraph==1.0.1 does not pin this dependency.","severity":"breaking","affected_versions":"1.0.1"},{"fix":"Use langgraph-checkpoint-postgres or langgraph-checkpoint-sqlite for persistence","message":"MemorySaver is in-memory only. State is lost on process restart. Not for production.","severity":"gotcha","affected_versions":"all"},{"fix":"app = graph.compile() then app.invoke(...)","message":"LangGraph requires a compiled graph before invocation. Always call graph.compile() before graph.invoke().","severity":"gotcha","affected_versions":"all"},{"fix":"Define all state keys in your TypedDict schema upfront","message":"State TypedDict must be defined before StateGraph instantiation. Missing keys raise KeyError at runtime not at definition time.","severity":"gotcha","affected_versions":"all"},{"fix":"Review pip warnings for environmental issues relevant to your setup. If they do not impact the application's functionality, they may be ignored or suppressed. This is not a langgraph-specific issue.","message":"Test output contains warnings and notices from the 'pip' package manager that are unrelated to the langgraph library's functionality or application-specific failures. These messages typically pertain to environmental setup (e.g., running pip as root) or general system information (e.g., pip updates).","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-12T05:16:02.231Z","next_check":"2026-03-28T00:00:00.000Z","problems":[{"fix":"Call the `.compile()` method on your `StateGraph` instance before attempting to invoke or stream from it.\n\n```python\nfrom langgraph.graph import StateGraph, END\n\nworkflow = StateGraph(State)\n# ... add nodes and edges ...\napp = workflow.compile() # Add this line\n# app.invoke(...)\n```","cause":"You are attempting to use a `StateGraph` object directly for execution (e.g., calling `invoke()`, `stream()`) without first compiling it into an executable `CompiledStateGraph`.","error":"AttributeError: 'StateGraph' object has no attribute 'compile'"},{"fix":"Rename your local `langgraph.py` file or `langgraph` directory to something else (e.g., `my_langgraph_app.py`) to avoid conflicts with the installed library. Then, try your import again.","cause":"This error often occurs when you have a local Python file or directory named `langgraph.py` or `langgraph` in your project's working directory, which shadows the installed `langgraph` package.","error":"ModuleNotFoundError: No module named 'langgraph.prebuilt'; 'langgraph' is not a package"},{"fix":"Provide a `checkpointer` instance (e.g., `SqliteSaver`) to the `compile()` method of your `StateGraph`.\n\n```python\nfrom langgraph.graph import StateGraph\nfrom langgraph.checkpoint.sqlite import SqliteSaver\n\nmemory = SqliteSaver(conn='sqlite:///graph.sqlite')\n\nworkflow = StateGraph(State)\n# ... add nodes and edges ...\napp = workflow.compile(checkpointer=memory)\n```","cause":"You are attempting to use state persistence features (like resuming an interrupted graph run) without configuring a checkpointer when compiling your `StateGraph`.","error":"No checkpointer set"},{"fix":"Ensure that your graph's state updates maintain the correct conversational turn structure: an AI message with `tool_calls` must be followed by one or more tool messages responding to those specific tool calls before any other AI or human messages are added.","cause":"This error occurs when the sequence of messages in your agent's state doesn't correctly follow the tool-calling protocol, specifically when a tool output message (`role='tool'`) is not immediately preceded by an AI message containing `tool_calls`.","error":"Invalid parameter: messages with role 'tool' must be a response to a preceeding message with 'tool_calls'."},{"fix":"Ensure that all `langgraph` related packages (`langgraph`, `langgraph-prebuilt`, etc.) are updated to their latest compatible versions. Use `pip install -U langgraph langgraph-prebuilt` (or specific versions if a known compatible set exists).","cause":"This error typically indicates a version incompatibility, where `langgraph-prebuilt` or another `langgraph` extension package is trying to import a symbol (`ServerInfo`) from `langgraph.runtime` that does not exist in your currently installed `langgraph` core library version.","error":"ImportError: cannot import name 'ServerInfo' from 'langgraph.runtime'"}],"ecosystem":"pypi","meta_description":null,"install_score":95,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.1,"mem_mb":28.9,"disk_size":"66.7M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.49,"mem_mb":28.9,"disk_size":"74M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.63,"mem_mb":31.6,"disk_size":"72.2M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.17,"mem_mb":31.6,"disk_size":"80M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.54,"mem_mb":31.1,"disk_size":"63.2M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.48,"mem_mb":31.1,"disk_size":"71M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.35,"mem_mb":31.6,"disk_size":"62.8M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.31,"mem_mb":31.6,"disk_size":"71M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.86,"mem_mb":26.8,"disk_size":"64.2M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.63,"mem_mb":26.8,"disk_size":"72M"}]},"quickstart_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}