Overview
Sharif's academic regulations are spread across a pile of PDFs and bylaws that students are expected to navigate on their own. SharifAC is a machine learning course project that turns them into something you can ask questions of, and get answers that cite where they came from.
Why retrieval, not fine-tuning
The failure mode that matters for this problem is confident invention. A student asking whether they can drop a course after week six needs the actual clause, not a plausible-sounding paraphrase of one. That constraint rules out answering from model weights alone.
Retrieval-augmented generation fits because it inverts the trust relationship: the authoritative text comes from the document store, and the model's job is narrowed to phrasing and synthesis. Every answer carries the clauses it was built from, so a reader can check the source rather than trusting the summary.
Pipeline
Official PDF and Markdown documents are chunked and embedded into a FAISS index. A question is embedded, matched against that index, and the top passages are passed to the model as grounding context alongside the conversation history. Persistence runs through SQLAlchemy against SQLite in development and PostgreSQL in deployment.
The LLM integration is deliberately pluggable — OpenAI when a hosted model is appropriate, Ollama when it needs to run locally. Keeping that boundary behind an interface meant the retrieval and evaluation work never had to care which one was active.
Delivery and evaluation
Two front doors: an embeddable web widget and a Telegram bot, chosen because they cover how students actually behave on desktop and on mobile without asking them to learn a new destination.
Langfuse handles observability and evaluation, which matters more than it sounds — without traces of what was retrieved for a given question, debugging a bad answer is guesswork. The full system is containerized with Docker.