Skip to content
← All work

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

Anatomy

  • Deterministic code
  • Model output
  • Guardrail
  • Data
  1. 01 · In / out
    University PDFsHandbooks, admission guides
  2. 02 · Code
    Parse & chunk1,000 chars · 200 overlap
  3. 03 · Model
    EmbedGemini text-embedding-004
  4. 04 · Data
    FAISS indexCosine similarity · persisted
  5. 05 · Model
    Grounded answerTop-5 chunks → Gemini
  6. 06 · In / out
    Answer + 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

  1. 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.

  2. Overlapping chunks.

    A 200-character overlap keeps answers that straddle a chunk boundary retrievable.

  3. 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.

Start a project

Free 30-minute intro call. Replies within 24h.