PDFToChat Upgrades Its Open Source RAG Stack With Hybrid Retrieval
An open source Next.js template lets you build a hosted PDF chat app with hybrid vector search, no local embedding model required.
Takeaways
- PDFToChat is an open source Next.js template for building PDF chat apps, now at 1.4k GitHub stars.
- Recent update swaps in Chroma Cloud for hybrid dense plus sparse retrieval using Qwen and SPLADE.
- Embeddings run server side via Reciprocal Rank Fusion, so no local embedding model is required.
- Stack combines Mixtral on Together AI, LangChain.js, Bytescale storage, Clerk auth, and Vercel Postgres.
- MIT licensed and deployable to Vercel with a handful of environment variables and one Prisma migration.
- Known gaps: no retrieval benchmarks, no image support in PDFs, API routes need auth hardening.
Building a PDF chat app used to mean stitching together an embedding model, a vector store, an LLM, auth, storage, and a frontend, then praying the retrieval works well enough that users don't get hallucinated answers. PDFToChat is an open source template that solves that plumbing problem end to end, and its latest iteration swaps in a hybrid dense plus sparse retrieval pipeline that runs entirely in the cloud.
The project comes from Hassan El Mghari (Nutlope) and has crossed 1,400 stars on GitHub. It ships as a production ready Next.js app you can fork, drop API keys into, and deploy on Vercel. A hosted demo lives at pdftochat.com where you can have a conversation with your papers, textbooks, and contracts for free.
What's under the hood
The stack is deliberately opinionated, with each piece handling one job. It uses Next.js App Router for the framework, Mixtral through Together AI inference for the LLM, Chroma Cloud for vector search (hybrid dense plus sparse via Qwen and SPLADE), LangChain.js for the RAG code, Bytescale for the PDF storage, Vercel for hosting and for the postgres DB, Clerk for user authentication, and Tailwind CSS for styling.
The interesting change in the current version is retrieval. Embeddings are generated automatically by Chroma Cloud using Qwen for dense vectors and SPLADE for sparse ones, combined via Reciprocal Rank Fusion at query time. No local embedding model is needed. If you have not touched retrieval in a while, SPLADE is a learned sparse model that produces something closer to a smart bag of keywords, while Qwen embeddings capture semantic meaning. Reciprocal Rank Fusion is a simple algorithm that merges two ranked lists by summing the reciprocals of each document's rank in each list, so items that show up highly in either retriever bubble to the top.