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.


