A full-stack RAG app where you upload a PDF or DOCX and chat with it. Built from scratch with LangChain.js, pgvector, and OpenAI — no Python, no automation tools.

A full-stack Retrieval-Augmented Generation (RAG) app built entirely in JavaScript. Upload any PDF or DOCX file and ask questions about it in a chat interface. The AI answers only from your document — never from its training data.
The browser extracts text from the file locally using pdf.js and mammoth. Only plain text is sent to the backend, where LangChain.js chunks it, OpenAI embeds it, and pgvector stores the vectors in a real Postgres database. Questions are matched to the most relevant chunks using cosine similarity before being answered by gpt-4o-mini.
Built this to understand how RAG works behind the scenes — embeddings, vector search, chunking overlap, session isolation — rather than abstracting it away with no-code tools.