Projects / CST StudyBot
Retrieval-augmented generation · 2025

CST StudyBot

A revision assistant for Cambridge Computer Science. Ask about a topic and it finds the past-paper questions that actually test it, with examiners' notes on difficulty and common mistakes.

StudyBot showing a 2021 OCaml past-paper question with maths and code rendered correctly

A search for "functional arrays" surfaces a 2021 question, with the maths and OCaml rendered as on the page.

Overview

Past papers are the best revision there is, and the hardest to search. They're PDFs full of maths, and the same idea goes by different names from year to year.

Keyword search fails on both counts. Most of the work turned out to be getting clean data in: if the LaTeX comes out mangled, no amount of clever retrieval fixes it.

How it works

  • Scrape the public papers

    A downloader pulls the question-paper PDFs from the Computer Lab's site.

  • Read them with vision, in parallel

    Pages are rendered with PyMuPDF and read by Gemini Vision, which keeps formulae and code intact. Running it multithreaded cut processing time by 75%.

  • Add what the examiners said

    A second pipeline reads the Examiners' Reports and attaches difficulty and common mistakes to each question.

  • Search by meaning

    Questions are embedded into a local ChromaDB store; a Streamlit UI searches by concept, filters by topic and hides AI hints until you ask.

Architecture

Scraperpublic PDFs
→
Vision ingestmultithreaded
→
Report analysisdifficulty · mistakes
→
ChromaDBvector store
→
Streamlit UIsearch · hints