Has anyone integrated a multi agentic system in langgraph with fastapi ?
Hey,
I’ve built a couple of co-pilot style apps which uses langgraph (to handle the orchestration of the agents) along with fastapi. It’s designed to handle multiple user conversations concurrently.
We’re using checkpointers to manage the state of the graph. Used postgresSaver for one and this managed checkpointer service convo-sdk for one.
Let me know if you have any specific questions around the implementation or performance benchmarks.
can you please share the repo or some code , i want to see the structure and importantly, are you using websockets or sse style streaming with front end?
Since I can’t share my codebase directly, here are a couple of public examples that might help:
-
Production-grade template: wassim249/fastapi-langgraph-agent-production-ready-template
-
Simpler example: Sajith-K-Sasi/chatbot_langgraph_fastapi – A lightweight example of using LangGraph with FastAPI to build a chatbot.
In my current setup, I use FastAPI primarily as a backend for the platform layer. Each incoming request triggers the execution of a precompiled LangGraph, which is initialized once when the FastAPI app starts. I deploy this via AWS ECS Fargate.
The architecture is split into two services:
- One handles the FastAPI HTTP layer.
- The other runs the LangGraph execution (workers).
These two services communicate using a pub/sub queue pattern with Redis (AWS ElastiCache) and Celery.
For managing memory and conversation state, I use the Postgres Checkpointer (on AWS RDS) to persist thread history and agent state.
Overall, each request simply routes input to the appropriate graph and invokes it.
Let me know if you have more specific questions about the setup.
Thanks a lot, this helps