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.
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.
Next.js frontend, Express API, BullMQ workers for async processing. OpenAI for embeddings and generation. Qdrant for vector storage with HNSW indexing. Redis for job queue.
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.
- 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.
- Vector search: OpenAI text-embedding-3-small (1536 dims), stored in Qdrant with HNSW index, top-k=5 retrieval with score threshold 0.7.
- RAG pipeline: query → embedding → vector search → context assembly → GPT-4 with source citations. Processing status shown via WebSocket.
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.
- 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.
- New file formats can be added by extending the worker pipeline, without rewriting chat logic.
Tech Stack
More Projects
Additional work across AI products, developer tooling, and full-stack systems.
Edward
Most AI builders stop at generation. Edward is everything after: admission-controlled BullMQ runs, resumable execution over an append-only event log, per-chat Docker sandboxes, and S3 + Cloudflare preview infrastructure.
Agentic Chat
An AI chat platform that routes each request through the right context — memory, documents, tools, or research — and acts on the answer through connected apps.
Bonkers by Foyer
Creative production system built at Foyer Tech — led the v2→v3 rebuild with reusable templates, multi-model routing, and faster repeat workflows for high-quality visual asset creation.