#6262nd of 110 in Backend and cloud templates
fastapi-langgraph-agent-production-ready-template
FastAPI backend template for LangGraph agents with memory, auth and tracing
Run it:RackNerd ↗ (opens in a new tab)RepoCloud ↗ (opens in a new tab)Affiliate links, no effect on a rank.
- Stars
- 2.8k
- License
- MIT
- Last commit
- Oct 2026
- Language
- Python
2,056 on 28 Mar 20262,753 on 21 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
A Python backend template that wires a stateful LangGraph agent into FastAPI with JWT sessions, slowapi rate limiting, Alembic migrations and PostgreSQL checkpointing. Long-term memory runs in-process through mem0 and pgvector, and LLM calls go through a service with retries and circular model fallback. Observability comes from Langfuse tracing, Prometheus metrics and Grafana dashboards.
Who it is for: AI engineers building a LangGraph agent API on FastAPI and Postgres
Strengths
- Circular model fallback with tenacity retries and a total timeout budget
- Per-user long-term memory via mem0 and pgvector in your own PostgreSQL
- Langfuse tracing, Prometheus metrics and Grafana dashboards included
- Custom tools are added by registering a LangChain @tool function
Weaknesses
- Ships a single agent; supervisor or sub-agent setups must be wired by hand
- mem0 memory needs an OpenAI API key for fact extraction and embeddings
- Requires PostgreSQL with the pgvector extension
- Non-OpenAI providers need extra packages and registry edits
What it needs
- Python, OpenAI, Anthropic, Ollama, Google GenAI
- Needs PostgreSQL, pgvector, Langfuse (optional), Valkey/Redis (optional), Prometheus and Grafana (optional)
- Docker
- env example file
Also in Backend and cloud templates
See all 110| Rank | Project | Score |
|---|---|---|
| #60 | dropwizardJava framework bundling Jetty, Jersey and Jackson for REST services | 65 out of 100 |
| #61 | typescript-express-starterCLI that generates TypeScript Express REST API projects with selectable tooling | 65 out of 100 |
| #63 | backendProduction-ready NestJS Todo API with a 16-chapter guide on CI/CD and observability | 62 out of 100 |
| #64 | taotao-cloud-projectSpring Cloud Alibaba microservice scaffold with a B2B2C mall and big-data modules | 61 out of 100 |
| #65 | genlayer-project-boilerplateGenLayer starter with a Python betting contract, tests, and Next.js frontend | 60 out of 100 |