Problem
Long PDF documents are difficult to search and even harder to trust when answers come from a general-purpose model. DocChat solves this by grounding every answer in retrieved document context and returning citations users can inspect.
Implementation Highlights
- Built a FastAPI backend for upload, ingestion, retrieval, chat, streaming, health, and source endpoints.
- Implemented PDF chunking and embedding into a persistent Chroma vector store.
- Added a provider abstraction for OpenAI and Google Gemini LLM/embedding providers.
- Used a relevance guardrail so out-of-scope questions are refused instead of hallucinated.
- Returned inline citations with source filename, page number, and snippets.
- Included an evaluation harness for retrieval quality, answer correctness, and faithfulness.
Result
The app demonstrates full-stack AI engineering: a Next.js/React interface, a Python AI backend, streaming UX, document-grounded answers, audit-friendly citations, and deployment as a single container for a custom subdomain.