Skip to main content

Configuration Reference

The langgraph.json file is the central configuration for your LangGraph application, defining dependencies, graphs, environment settings, and deployment options.

Schema

You can enable IntelliSense and validation in your editor by adding the schema reference:

Configuration Structure

Minimal Configuration

At minimum, you need to specify dependencies and graphs:

Complete Example


Core Fields

dependencies

Type: string[]
Required: Yes (for Python projects)
List of Python packages to install. Can include:
  • PyPI packages: "langchain-openai"
  • Local packages: "." or "./my_package"
  • Git repositories: "git+https://github.com/org/repo.git"
Examples:
The "." dependency tells the CLI to install your local package (looks for pyproject.toml, setup.py, or requirements.txt).

graphs

Type: Record<string, string | GraphDef>
Required: Yes
Maps graph IDs to their import paths. Each graph must point to a compiled graph object or a context manager that returns one. Format: "path/to/file.py:variable_name" Simple format:
Extended format with descriptions:
Valid graph objects:
  • StateGraph instances
  • CompiledGraph instances
  • Functions decorated with @entrypoint
  • Any Pregel object
  • Context managers that yield a graph:

env

Type: string | Record<string, string>
Required: No
Environment variables for your application. As a file path:
As inline values:
Do not commit API keys directly in langgraph.json. Use a .env file and add it to .gitignore.

Python Configuration

python_version

Type: string
Default: "3.11"
Format: "major.minor" (e.g., "3.11", "3.12", "3.13")
Python version for Docker deployment. Must be 3.11 or higher.
Patch versions cannot be specified. The latest patch version of the specified minor version is used.

pip_config_file

Type: string
Required: No
Path to a pip configuration file for custom package indices or authentication.
Example pip.conf:

pip_installer

Type: "auto" | "pip" | "uv"
Default: "auto"
Choose which package installer to use:
  • "auto": Use uv if base image supports it, otherwise pip
  • "pip": Force use of pip
  • "uv": Force use of uv (faster, but requires compatible base image)

keep_pkg_tools

Type: boolean | string[]
Default: false
Control whether to keep packaging tools (pip, setuptools, wheel) in the final image.

Node.js Configuration

node_version

Type: string
Required: For JavaScript/TypeScript graphs
Format: Major version only (e.g., "20")
Node.js version for JavaScript/TypeScript projects. Must be 20 or higher.
If your graphs use .ts, .js, .mts, or .cts extensions, Node.js support is automatically enabled.

Docker Configuration

base_image

Type: string
Default: "langchain/langgraph-api" (Python) or "langchain/langgraphjs-api" (Node.js)
Base Docker image for your deployment.
Version pinning examples:

api_version

Type: string
Required: No
API server version to use. Alternative to specifying version in base_image.

image_distro

Type: "debian" | "wolfi" | "bookworm"
Default: "debian"
Linux distribution for the base image.
  • "debian": Standard Debian-based image
  • "wolfi": Minimal, security-focused distribution
  • "bookworm": Debian 12 (Bookworm)

dockerfile_lines

Type: string[]
Required: No
Custom Dockerfile instructions to append after the base image.
Common use cases:

Store Configuration

store

Type: StoreConfig
Required: No
Configuration for the built-in long-term memory store with semantic search.

store.index

Semantic search configuration. Required fields:
  • embed: Embedding model identifier
  • dims: Embedding dimension
Optional fields:
  • fields: JSON fields to embed (default: ["$"] - entire object)
Embedding model formats:
Common embedding dimensions:

store.ttl

Time-to-live configuration for automatic data expiration.
  • refresh_on_read: Refresh TTL on read operations (default: true)
  • default_ttl: Default TTL in minutes for new items
  • sweep_interval_minutes: Interval between TTL sweep iterations

Checkpointer Configuration

checkpointer

Type: CheckpointerConfig
Required: No
Configuration for custom checkpointer implementations.

checkpointer.path

Import path to an async context manager that yields a BaseCheckpointSaver instance.

checkpointer.ttl

Thread TTL configuration:
  • strategy: "delete" (remove thread) or "keep_latest" (keep latest state)
  • default_ttl: Default TTL in minutes
  • sweep_interval_minutes: Interval between sweeps (default: ~5 minutes)
  • sweep_limit: Max threads per sweep (default: 1000)

checkpointer.serde

Serialization/deserialization configuration:

Authentication Configuration

auth

Type: AuthConfig
Required: No
Custom authentication configuration.

Encryption Configuration

encryption

Type: EncryptionConfig
Required: No
Custom at-rest encryption for sensitive data.

HTTP Server Configuration

http

Type: HttpConfig
Required: No
Configuration for the built-in HTTP server.

Endpoint Control

Disable specific endpoint groups:

CORS Configuration


Webhooks Configuration

webhooks

Type: WebhooksConfig
Required: No
Configuration for outbound webhook delivery.

UI Configuration

ui

Type: Record<string, string>
Required: No
Named UI components emitted by your agent.

ui_config

Type: object
Required: No
Additional UI configuration.

Complete Example

Here’s a comprehensive configuration example:

Validation

The CLI validates your configuration when running any command. Common errors:

Missing Required Fields

Fix: Add at least one graph definition.

Invalid Python Version

Fix: Use Python 3.11 or higher.

Invalid Graph Path

Fix: Use correct format: "./agent.py:graph"

Reserved Package Names

Fix: Don’t use reserved names for your package directories.

Next Steps