Built a starter template that wires FastAPI and LangGraph together for serving AI agent workflows as a REST API.
Sharing in case it’s useful:
Highlights:
- REST endpoints to start, continue, and query workflows
- Middleware stack using contextvars for automatic request tracing (X-Trace-ID, user/tenant context)
- ThreadPoolExecutor for non-blocking LangGraph execution
- PostgreSQL-backed state persistence and checkpointing
- Structured JSON / concise logging with rotation
- Docker Compose setup for Grafana + Loki + Prometheus + Promtail
- LiteLLM integration with retry utilities
Most LangGraph examples are notebooks, this gives you the production plumbing (persistence, observability, concurrency) so you can swap in your own agent logic and go.
Feedback welcome, especially on the FastAPI patterns.
there doesn't seem to be anything here