M8-A — Document-Based AI Assistants

How to read this note

Module 7 taught what RAG is. Module 8 teaches what you build with it — an assistant that behaves like a smart junior who read all your files.


🤖 What is a document-based AI assistant?

It is a chat system where:

  1. You upload documents (PDF, notes, policies)
  2. Users ask questions in normal language
  3. AI answers using those documents — not random internet guesses
Student: "When is Assignment 2 due?"
Assistant: "According to the syllabus PDF, Assignment 2 is due on…"
           [citation: page 4]

That is the AI Study Assistant from the brochure capstone track.


🆚 Chatbot vs document assistant

Normal ChatGPT Document-based assistant
General knowledge Your organisation's knowledge
Same for everyone Custom to your uploads
Might invent fees/dates Should cite your fee PDF
One chat window Can be embedded in website/app

🏗️ Four parts every assistant needs

┌─────────────────────────────────────────────┐
│  1. SOURCES     │  PDFs, docs, web pages     │
├─────────────────┼───────────────────────────┤
│  2. BRAIN       │  RAG search + LLM          │
├─────────────────┼───────────────────────────┤
│  3. PERSONALITY │  Prompt: tone, rules, limits│
├─────────────────┼───────────────────────────┤
│  4. INTERFACE   │  Chat box, WhatsApp, app   │
└─────────────────┴───────────────────────────┘

Part 3 — Personality (don't skip this)

Example system prompt:

You are the Raj Computers AI Study Assistant.
Answer ONLY from uploaded course notes.
If the answer is not in the documents, say:
"I don't have that in the course material — ask your instructor."
Tone: friendly, simple, for Class 12 students.
Always mention which note the answer came from.

That prompt is what stops the assistant from making things up.


📚 Example — Coaching institute FAQ assistant

Sources to upload:

Questions it should handle:

Questions it should REFUSE:


⚙️ Backend flow (one message)

User types question in chat box
         ↓
Backend receives question
         ↓
Search vector store for top chunks
         ↓
Build prompt = system rules + chunks + question
         ↓
Send to LLM API (Gemini / OpenAI / Claude)
         ↓
Return answer + citations to user screen
Piece No-code option Code option (later)
Upload + chat NotebookLM, ChatGPT Project Custom web app
Search Built into tool LangChain, LlamaIndex
LLM Same tool's model API key + backend

🎓 Student capstone — AI Study Assistant

Brochure requirement breakdown:

Step Action
1 Collect all subject notes as PDF/Markdown
2 Upload to NotebookLM OR build simple chat UI
3 Write assistant personality prompt
4 Test 20 real exam questions
5 Log wrong answers → fix sources or prompts
6 Publish demo link + Obsidian write-up
The real insight

The hard part is not the AI. The hard part is clean documents + clear rules + testing.


✅ Quality checklist


Previous: M7-C — RAG with NotebookLM
Next: M8-B — Internal Knowledge Systems
Foundation: M7-A — What is RAG