AI Chat with LangGraph, Google Gemini, and SSE
This project provides a streaming AI chat API using FastAPI, LangGraph, and Google Generative AI (Gemini) with tool integration (Tavily Search) and Server-Sent Events (SSE).
It is designed to integrate seamlessly with a Next.js frontend.
🚀 Features
- 🧠 Streaming AI responses using SSE for real-time chat experience.
- 🔍 Tool integration: Supports dynamic tool calls (Tavily Search).
- 💬 Chat memory: Remembers previous conversations using LangGraph checkpointing.
- 💾 Checkpointing: Maintains chat context with UUID-based checkpoints for each user/session.
- 🌐 CORS enabled: Easily integrates with frontend apps.
- ⚡ Next.js ready: Built for seamless streaming with a Next.js frontend.
🧩 Tech Stack
- Backend: FastAPI, LangGraph, LangChain Google Generative AI
- AI Model:
ChatGoogleGenerativeAIwithgemini-2.5-flash - Tools: Tavily Search Results
- Memory: LangGraph
MemorySaverfor checkpointing and chat persistence - Frontend: Next.js with SSE support
- Environment Management:
python-dotenv
