The developer created an AI tutor for social studies based on two specific textbooks for grades 9 and 10. The system uses the Qwen2.5-3B-Instruct model, which is restricted to answering exclusively from provided textbook excerpts to ensure responses align with school curriculum requirements.
The pipeline uses pymupdf4llm for parsing PDF files into Markdown, preserving page numbers and headers. Text is split using MarkdownHeaderTextSplitter and RecursiveCharacterTextSplitter with a chunk size of 1000 and an overlap of 150. Embeddings are generated via intfloat/multilingual-e5-large and stored in a FAISS vector database.
The system runs on Google Colab using a free T4 GPU. To fit the model into memory, the developer applied 4-bit NF4 quantization via bitsandbytes. The search process utilizes metadata filtering to target specific chapters or grades, though the developer noted issues with metadata loss on pages lacking headers.
Current limitations include inconsistent formatting, lack of session state for user grade tracking, and the absence of automated fact-checking against the source context. Future plans involve adding session memory, implementing response validation, and expanding the pipeline to include history and biology textbooks.






