LangGraph

LangGraph is a framework for building controllable agentic workflows. You may self-host or deploy to the cloud.

LangGraph Studio is an agent IDE that enables visualization, interaction, and debugging of complex agentic applications.

Install

Install LangGraph with Poetry.

poetry add langgraph 

Install LangGraph Studio.

poetry add --group dev "langgraph-cli[inmem]"

Run

poetry run langgraph dev

Concepts

  • Control flow
    • Fixed - User-defined chain
    • Agent - LLM-defined chain
  • Runnable protocol
    • invoke
  • State is a dictionary.
  • Nodes are functions.

LangGraph Studio via Docker

Deprecated

LangGraph Studio now runs on the web instead of Docker. It creates a tunnel to your locally hosted graph.

Docker up

A LangGraph project can be started from the command line.

langgraph up

This spins up a Docker container. You can configure custom dependencies and commands. For example:

{
  "dockerfile_lines": [
    "RUN mkdir -p /input/upload",
    "COPY ./input/upload/ /input/upload/"
  ],
  "dependencies": ["./src/sales_ai_graph_pipeline"],
  "graphs": {
    "pipeline_agent": "./src/sales_ai_graph_pipeline/agents.py:graph"
  },
  "env": ".env",
  "python_version": "3.12"
}

Read more:

Dockerfile

You can also generate the Dockerfile locally.

langgraph dockerfile output/Dockerfile

Where output/Dockerfile is the file path to save the Dockerfile.

Parsing errors

ValueError

Error: ValueError('An output parsing error occurred. In order to pass this error back to the agent and have it try again, pass handle_parsing_errors=True to the AgentExecutor. This is the error: Could not parse tool input: {'arguments': 'query: "len(df)"', 'name': 'python_repl_ast'} because the arguments is not valid JSON.\nFor troubleshooting, visit: https://python.langchain.com/docs/troubleshooting/errors/OUTPUT_PARSING_FAILURE')

If you see an error similar to the one above, try passing handle_parsing_errors=True to the AgentExecutor.

Resources

LangGraph
Interactive graph
On this page
Install
Run
Concepts
LangGraph Studio via Docker
Docker up
Dockerfile
Parsing errors
Resources