Skip to content
All work

Case study · Product

FastRAG

A RAG starter kit for Next.js: chat with PDFs and web pages, with cited answers from Claude.

FastRAG banner: "Build AI that knows your data." Ingest PDFs and URLs, answer with Claude, deploy to Vercel.
Stack
Next.js · React · Claude Haiku 4.5 · Voyage AI · Pinecone · LangChain.js · SSE
Outcome
Launched · paid product

01 / Problem

Developers who want to chat with their own documents must wire up ingestion, embeddings, vector search, and a streaming chat UI before they can ship a single feature. Each piece is simple; getting all of them to work together in production takes weeks.

02 / Decisions

  • Server-Sent Events for the chat stream. The first event carries the retrieved sources, so citations render before the first token of the answer.
  • Cheerio instead of a headless browser for URL ingestion. It targets <main> and <article>, strips boilerplate, and stays within serverless limits.
  • RecursiveCharacterTextSplitter with 1,000-character chunks and 200-character overlap, plus separate document and query embedders (Voyage AI voyage-3.5) to tune retrieval.
  • One Pinecone index with a namespace per tenant, so documents never leak between users.
  • The LLM, the vector store, and the embeddings each sit behind a single module, so buyers can swap a provider without touching the rest of the app.

03 / Challenges

  • A public demo spends real API money. I added per-visitor rate limiting (5 messages and 3 ingestions per 24 hours) and return a reset timestamp so the UI shows an exact countdown instead of a vague error.
  • Questions with no relevant context invite hallucinated answers. Retrieval uses a 0.3 cosine similarity threshold, with a graceful fallback when nothing passes it.
  • PDF uploads up to 20 MB must parse, chunk, embed, and upsert inside a serverless function, then report chunk stats back to the UI.

04 / Results

  • Launched as a paid product with a one-time license, delivered through Gumroad with lifetime updates.
  • A public live demo runs real Claude streaming and Pinecone retrieval, with no signup.
  • Shipped the full product surface on my own: landing page, docs, pricing, and the kit itself.