r/FastAPI • u/Moist_Tonight_3997 • Jun 08 '26
Hosting and deployment Open-source template: FastAPI + LangGraph for AI agent workflows
https://github.com/samirpatil2000/agentic-templateBuilt 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.
Duplicates
LangChain • u/Moist_Tonight_3997 • Jun 08 '26