LangGraph RAG Agent — MongoDB Edition
A production-ready FastAPI + LangGraph self-correcting RAG agent with MongoDB persistence, Qdrant vector search, and Redis/ARQ background workers. Includes a full Next.js + TypeScript frontend with real-time SSE streaming.
Core capabilities
- Self-Correcting RAG Loop: a LangGraph StateGraph that retrieves, grades context relevance, rewrites the query if retrieval was insufficient, and generates a cited answer.
- Dense Vector Search: Qdrant with BAAI/bge-small-en-v1.5 CPU-friendly embeddings.
- Multi-Provider LLM Support: Google Gemini, OpenAI, and Groq, switchable per request.
- Async Document Ingestion: PDF parsing, chunking, and embedding generation run on Redis/ARQ background workers with live SSE progress.
- MongoDB Persistence: chat threads and LangGraph checkpoint state stored via MongoDBSaver.
Two genuinely additive tiers
- Basic: the no-auth text RAG engine described above — single-tenant, no login required, 10 API routes.
- Pro: everything in Basic, plus JWT authentication (bcrypt password hashing, refresh cookies, password reset), an admin dashboard with audit logs, and a full local voice pipeline — Whisper STT for transcription and Kokoro-82M for speech synthesis, both running locally with zero external voice-API costs. Pro's backend has 46 API routes, roughly 4.5x Basic's surface.
Unlike some of our other multi-tier products, this one really is additive — every route in Basic's backend also exists in Pro's, confirmed directly against both codebases.
