Deployment Options
LangSmith Deployment
The easiest way to deploy LangGraph applications:- 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:- Web server (FastAPI, Flask)
- Persistent checkpointer (PostgreSQL, SQLite)
- Message queue (for async processing)
- Load balancer
- 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
- Set up Debugging for production issues
- Review Persistence for checkpoint management
- Explore LangSmith Deployment for managed hosting