RAG PDF Chat
A full-stack, educational retrieval-augmented-generation demo: upload a PDF, the FastAPI backend chunks and embeds it into a per-session FAISS index, and a React app streams LLM answers grounded in the retrieved passages.
RAG PDF Chat is a production-style, educational full-stack project that shows how to turn PDF documents into searchable knowledge and chat with them using retrieval-augmented generation. A user uploads a PDF; the backend extracts its text, splits it into chunks, embeds each chunk, and stores the vectors in a FAISS index scoped to an anonymous browser session.
For each question, the backend retrieves the most relevant chunks, sends the question and context to a large language model with provider failover, and returns a grounded answer that can optionally stream over server-sent events, with source snippets showing where the answer came from. The frontend is a Vite single-page React and TypeScript application; the API is FastAPI with LangChain in a multi-agent pipeline, kept as a separate deployable service rather than a combined Next.js app so learners can see CORS, environment variables, reverse proxies and split deploys in practice.
It covers document chunking, embeddings, vector search, streaming responses and deployment to Vercel and a Coolify VPS, with device-local chat history and preferences.