← All projects

RAG-Chat

RAG-Chat is a document chat application that processes files in the background, stores searchable vectors, and returns answers with source citations.

Overview

Document-grounded chat system with background file processing. Uploads trigger async ingestion pipeline: parsing, chunking, embedding, and vector storage. Chat queries retrieve relevant chunks with citations.

How It Was Built

The main technical choices behind the product, from system design to the parts that make it work day to day.

  • Async ingestion pipeline: BullMQ workers process PDF, DOCX, and XLSX files. PDF.js for PDF extraction, mammoth.js for Word, exceljs for spreadsheets.
  • Chunking strategy: 512-token chunks with 50-token overlap, recursive character splitting preserving paragraph boundaries.

Impact

  • Chat stays responsive while large documents are processed in the background, so users aren't blocked during uploads.
  • Answers include citations and direct links to source text, making it easier to verify information against the original document.

Tech Stack

Next.jsTypeScriptOpenAILangChainQdrantDockerBullMQRedis