wassim249/fastapi-langgraph-agent-production-ready-template
A production-ready FastAPI template for building AI agent applications with LangGraph integration. This template provides a robust foundation for building scalable, secure, and maintainable AI agent services.
What it solves
This project provides a production-ready boilerplate for deploying AI agents. It addresses the gap between a local LangGraph prototype and a robust, scalable backend by bundling essential infrastructure like authentication, observability, long-term memory, and failure handling.
How it works
It uses FastAPI as the web framework and LangGraph to manage agent state and tool execution. The template integrates several production-grade services: it uses PostgreSQL with pgvector for long-term memory (via mem0), Langfuse for tracing, and Prometheus/Grafana for monitoring. It includes a custom LLM service layer that handles retries and circular model fallbacks, ensuring high availability even if a specific model provider experiences downtime.
Who it’s for
This is designed for AI engineers who need a structured, scalable foundation for building and deploying agentic applications without manually wiring together common production requirements.
Highlights
- Stateful Persistence: Built-in support for LangGraph checkpointing and long-term memory using pgvector.
- Resilient LLM Service: Implements exponential backoff retries and automatic circular model fallback for reliability.
- Observability Stack: Pre-configured with Langfuse tracing, structured logging, and Prometheus metrics.
- Production Ready: Includes JWT authentication, rate limiting via slowapi, and Alembic database migrations.
- Extensible: Easy to add custom tools or multi-agent supervisor architectures.
Related
- Project
- Project
- Project
- Project