Skip to main content
Deploying LangGraph applications requires careful consideration of persistence, scalability, monitoring, and infrastructure.

Deployment Options

LangSmith Deployment

The easiest way to deploy LangGraph applications:
Benefits:
  • Managed infrastructure
  • Built-in observability
  • Automatic scaling
  • Production checkpointers
  • LangGraph Studio integration
LangSmith Deployment handles persistence, scaling, and monitoring automatically.

Self-Hosted Deployment

For self-hosted deployments, you’ll need to configure:
  1. Web server (FastAPI, Flask)
  2. Persistent checkpointer (PostgreSQL, SQLite)
  3. Message queue (for async processing)
  4. Load balancer
  5. Monitoring and logging

Production Setup

Containerization

Dockerfile

Docker Compose

Kubernetes Deployment

Deployment Manifest

Service Manifest

Scaling Considerations

Horizontal Scaling

LangGraph applications can scale horizontally:

Async Processing

Handle long-running workflows asynchronously:

Caching

Implement caching for frequently accessed data:

Monitoring

LangSmith Integration

Custom Metrics

Logging

Security

Authentication

Rate Limiting

Best Practices

  • Use persistent checkpointers: PostgreSQL or managed services for production
  • Implement health checks: Monitor application and database health
  • Enable tracing: Use LangSmith for observability
  • Handle errors gracefully: Return meaningful error messages
  • Validate input: Check user input before processing
  • Set resource limits: Prevent resource exhaustion
  • Use environment variables: Never hardcode secrets
  • Implement retries: Handle transient failures
  • Monitor performance: Track latency and throughput
  • Plan for scaling: Design for horizontal scaling from the start

Next Steps