Case study 04 — BUBT AI Assistant
A university chatbot that answers from official documents — and cites them.
Retrieval-augmented generation over university PDFs: upload a handbook, ask a question, get an answer with the source documents listed.
- Status
- Open source
- Year
- 2025
- Context
- Independent product
- Links
- Source on GitHub ↗
Anatomy
- Deterministic code
- Model output
- Guardrail
- Data
- 01 · In / outUniversity PDFsHandbooks, admission guides
- 02 · CodeParse & chunk1,000 chars · 200 overlap
- 03 · ModelEmbedGemini text-embedding-004
- 04 · DataFAISS indexCosine similarity · persisted
- 05 · ModelGrounded answerTop-5 chunks → Gemini
- 06 · In / outAnswer + sourcesCited documents
The problem
Admission rules, course policies and handbooks are spread across dozens of PDFs. Students ask the same questions again and again, and keyword search over PDFs rarely finds the paragraph that actually answers them.
What was built
- 01An ingestion endpoint: upload a PDF, extract text, split it into overlapping chunks, embed each chunk and add it to a FAISS index saved to disk.
- 02A chat endpoint that embeds the question, retrieves the five most similar chunks and asks Gemini to answer from that context only — returning the answer, the source documents and the number of chunks used.
- 03A health endpoint that reports the vector count, and a React chat interface.
Key decisions
Every answer shows its sources.
Students can open the handbook the answer came from. A cited answer is checkable; an uncited one is a rumour.
Overlapping chunks.
A 200-character overlap keeps answers that straddle a chunk boundary retrievable.
Index on disk.
The FAISS index is persisted, so restarts don't mean re-embedding every document.
Honest limits
- PDF upload is API-only; an admin upload screen is still on the roadmap.
Stack
- TypeScript
- Node.js
- Express
- React
- Gemini
- FAISS
Have a workflow that should run itself?
Tell me what it is, what data it touches and what “done” looks like. You'll get a straight answer on whether AI is the right tool — and what it would take.
Free 30-minute intro call. Replies within 24h.