Skip to main content

Configuration File

The langgraph.json file in your project root defines your deployment configuration:
langgraph.json

Configuration Options

array
required
List of dependency sources. Use ["."] to include current directory, or specify paths to local packages.Example: "dependencies": [".", "../shared-libs"]
object
required
Map of graph names to their module paths. Format: "name": "path/to/file.py:variable"Example: "graphs": { "agent": "./langgraph/agent.py:graph", "assistant": "./langgraph/assistant.py:assistant_graph" }The variable name (after :) must be a compiled LangGraph graph.
object
Environment variables for your deployment. Never put actual API keys here - use LangSmith secrets instead.Example: "env": { "MODEL_NAME": "claude-sonnet-4-5-20250929", "LANGSMITH_TRACING": "true" }
string
Python version: "3.10", "3.11", or "3.12". Default: "3.11"
array
Custom Dockerfile commands to run during build.Example: "dockerfile_lines": ["RUN apt-get update && apt-get install -y curl", "RUN uv pip install custom-package"]

Graph Definition

Your graph must be defined in a Python module and exported as a variable:
langgraph/agent.py
The variable name in langgraph.json must match the exported variable name in your Python file.

Dependencies

Dependencies are specified in langgraph/requirements.txt:
langgraph/requirements.txt
Keep dependencies minimal for faster builds and lower cold start times.

Environment Variables

Setting Variables

Set environment variables in two ways:
  1. langgraph.json - For non-sensitive config
  2. LangSmith Secrets - For API keys and sensitive data

Available at Runtime

Access environment variables in your code:

Multiple Environments

Create separate deployments for each environment:

Advanced Configuration

Custom Build Steps

Add custom build commands:

Multiple Graphs

Deploy multiple graphs in one deployment:

Test locally

langgraph dev

Verify graph can be imported

python -c “from langgraph.agent import graph; print(graph)“

Example graph export

How to export a compiled graph for LangGraph Platform: