2025 · Updated 2025-11-10

AI Tutoring RAG

Curriculum-grounded university tutoring assistant using ChromaDB vector retrieval, Gemini and SQLite.

My Role
Lead Developer & Researcher
Current Status
Working prototype · Evaluated on ABU Computer Engineering materials
Intended Users
Undergraduate Computer Engineering students and course administrators at Ahmadu Bello University, Zaria.

Overview

AI Tutoring RAG is a multi-tier educational prototype addressing high student-to-lecturer ratios in large public university engineering departments by grounding conversational tutoring and practice quiz generation strictly in lecturer-uploaded course handbooks, lecture notes and textbooks.

Problem Statement

Students studying specialized Computer Engineering modules often receive generic or hallucinated explanations from ungrounded chatbots that ignore departmental syllabi and notation conventions.

Technical Architecture

Three-tier Python application pairing a role-based Streamlit student/admin portal with ChromaDB persistent semantic vector indexing, PyPDF2 chunking pipelines, bcrypt-authenticated SQLite session/quiz storage and Google Gemini 1.5 Flash generation.

LAYER 01

Presentation & Role Portal

Separate Student (RAG chat, adaptive quiz generator, progress analytics) and Administrator (PDF/TXT ingestion, student metrics, system health) interfaces in Streamlit.

LAYER 02

Ingestion & Semantic Retrieval

DocumentProcessor extracts and chunks departmental PDFs into persistent ChromaDB embeddings queried prior to every tutor response.

LAYER 03

Relational State & Grading

SQLite DatabaseManager persists bcrypt-hashed accounts, session logs and graded multiple-choice quiz explanations.

Technology Stack

  • Python
  • Streamlit
  • Google Gemini API
  • ChromaDB
  • SQLite
  • PyPDF2
  • Pandas
  • Plotly

Application & Architecture Captures

Multi-tier architecture diagram of AI Tutoring RAG showing Streamlit UI, Python application logic, SQLite and ChromaDB data stores, and Gemini API
Multi-tier system architecture from the AI Tutoring RAG repository.

Key Engineering Decisions & Challenges

Engineering Decisions

  • Separated unstructured semantic retrieval (ChromaDB) from structured learner progress and account records (SQLite) for straightforward local deployment.
  • Gave course administrators direct PDF/TXT ingestion and health-monitoring views so curriculum updates require zero code edits.

Implementation Challenges

  • Chunking dense engineering lecture notes without severing equations or multi-paragraph definitions across retrieval boundaries.
  • Formatting structured multiple-choice quiz outputs reliably for automated grading and per-question feedback.

Testing Strategy & Demonstrated Outcomes

Testing & Verification

  • Component unit tests across DatabaseManager, DocumentProcessor and AdvancedVectorStore.
  • End-to-end RAG ingestion-to-quiz integration checks and manual factual evaluation on curriculum queries with student volunteers.

Demonstrated Outcomes

  • Complete open-source prototype supporting student RAG tutoring, custom topic/difficulty quiz generation and administrator document management.
  • Demonstrated substantially reduced off-syllabus hallucination during departmental coursework evaluation.

Lessons Learned

  • Retrieval chunk quality and source-snippet visibility matter more for student comprehension than switching to larger frontier models.