Imoran ai LogoImoran ai Logo

AI Onboarding: Preventing Hallucination with the RAG Chatbot

Quick Onboard Doc is a RAG chatbot that answers from a company’s own uploaded docs and says "I don’t know" when the answer isn’t there. How I built the retrieval guardrail with Next.js, Gemini, and Vercel Blob.

Published: November 19, 2025

Last updated: June 30, 2026

image of the article

Quick Onboard Doc started from a real annoyance. New hires spend their first week asking questions that are already answered in a PDF nobody reads, and senior staff lose hours answering them. So I built a chatbot that reads a company's own documents and answers from them.

The catch with any LLM is that it will happily invent an answer. For an onboarding tool, a confident made-up answer is worse than no answer. So the entire design comes down to one rule: answer from the documents, or admit you don't know.

How RAG keeps it honest

RAG (retrieval-augmented generation) means the model doesn't answer from its training data. When you ask a question, the app first retrieves the most relevant chunks from your uploaded documents, then asks Gemini to answer using only those chunks.

The guardrail lives in the prompt. If the retrieved chunks contain the answer, it responds and points to the source. If they don't, it's told to say it doesn't have that information instead of guessing. That one constraint is the whole difference between a tool HR can trust and a liability.

A confident wrong answer about your parental-leave policy is a real problem. "I don't have that in the docs" is not.

What actually happens when you upload a PDF

The interesting work is in ingestion, not the chat box. When someone uploads a policy document:

  • the file goes to Vercel Blob for storage
  • I split the text into chunks and generate an embedding for each one
  • those embeddings get stored so I can find them later by similarity

When a question comes in, I embed the question the same way and pull the closest chunks. That retrieved context is all Gemini ever sees.

The stack, and why each piece is there

  • Next.js (App Router) for the app and the API routes that handle upload and chat.
  • Gemini for the generation step.
  • Vercel Blob for the raw document files.
  • Neon (Postgres) with Prisma for the relational data: users, workspaces, document metadata.
  • NextAuth for sign-in with Google or email, because the whole thing is multi-tenant.

That multi-tenant boundary isn't a nice-to-have. One company's HR docs leaking into another company's chatbot would kill the product, so workspace isolation is enforced on every query, not just hidden in the UI.

It's also a PWA, so a team can install it and pull up a policy answer on their phone instead of scrolling a 40-page handbook.

Frequently asked questions

How does the chatbot avoid making things up?

It only answers from the documents you upload. It retrieves the relevant passages first and is instructed to say it doesn't have the information rather than guess.

Where do uploaded documents go?

Files are stored in Vercel Blob, and the relational data (users, workspaces, metadata) lives in Postgres. Each workspace is isolated, so one company's documents never reach another's.

Can you build an AI assistant on our own documents?

Yes, that's exactly what Quick Onboard Doc does. Tell me about your documents and use case and I'll suggest an approach.

Let's Work
Together

Hand Reaching

Have a project in mind? We'd love to hear about it. Let's create something great together!

PRODUCT DEVELOPERUI ENGINEERMVP DEVELOPMENTFRONTEND DEVELOPMENTPRODUCT DEVELOPERUI ENGINEERMVP DEVELOPMENTFRONTEND DEVELOPMENTPRODUCT DEVELOPERUI ENGINEERMVP DEVELOPMENTFRONTEND DEVELOPMENT