Inspiration

Every RUET student knows this cycle: a semester exam is three days out, the lecture slides are scattered across five different WhatsApp groups and a Drive folder nobody organized, and the only "study plan" is panic. We wanted an AI tool that doesn't just answer trivia questions off the open internet, but actually knows your syllabus, your slides, your past papers — and is annoying enough about deadlines to actually get you to open them. That's where the idea for Sentinel came from: not another generic chatbot bolted onto an LMS, but a strict, relentless study partner that lives inside your own course material.

What We Learned Grounding beats generic intelligence. A general-purpose model answering from its own training data is far less useful to a student than the same model answering from their lecture slide, page 14, paragraph 2. Building the FAISS + BM25 hybrid retrieval layer taught us how much retrieval quality — not just prompt quality — determines whether an answer actually feels trustworthy. Persona shapes learning behavior. Early versions of Sentinel just answered questions directly, and it turned into a homework-completion machine. Switching the assignment flow to Socratic questioning — hints instead of answers — took real prompt-engineering discipline, but it's the difference between a tool that helps a student learn and one that just does the work for them. Structured output matters as much as content. Routing "learn" vs "code" vs "lab" intents into distinct JSON schemas (concept → explanation → math → takeaways, etc.) made responses dramatically easier to scan under exam pressure than a wall of chat text. Orchestration is where the real engineering is. Wiring together intent classification, RAG retrieval, page-aware PDF context, and a LangGraph tool pipeline (web search, PDF download, repo analysis) into one coherent streaming response — without breaking latency — was the bulk of the technical work. How We Built It

We split Sentinel into two FastAPI services: a main app (:5090) handling chat, onboarding, settings, and the document library, and a dedicated RAG server (:5091) running FAISS vector search plus BM25 keyword matching over everything a student drops into books/. Every incoming message first passes through a lightweight regex-based classifier for intent and vibe (fast, zero extra model calls), then through a preprocessing layer that injects the most relevant retrieved excerpts — and the current PDF page, if one is open — into the prompt before it ever reaches Gemini. Gemini (via OpenRouter) then generates the actual response, streamed token-by-token back to a PDF.js-powered library UI. Chat history, study stats, and a persistent "user vault" of each student's weak topics and habits live in PostgreSQL, so recommendations improve the more a student uses it. We containerized the whole stack with Docker Compose so any RUET student can self-host it with just an OpenRouter API key.

Challenges We Faced Keeping retrieval fast without sacrificing accuracy. Pure vector search missed exact keyword matches (equation names, specific terms from past papers), so we added BM25 and a re-ranking step on top of FAISS — worth the added complexity, but it took tuning to keep latency reasonable during a live chat stream. Stopping the AI from just giving answers. Getting the assignment-drill mode to reliably hold back the direct answer and instead ask the right diagnostic question took several prompt iterations — it's an easy failure mode for an LLM to slip back into "helpful assistant gives the answer" behavior. PDF handling at RUET-textbook scale. Real course PDFs are often scanned, inconsistently formatted, or huge — we had to add OCR fallback and page-level chunking to keep indexing reliable across messy real-world files instead of clean sample PDFs. Time. Building intent classification, hybrid RAG, structured output modes, a proactive accountability engine, and a full PDF-viewer library UI in a single Hack Day meant constantly triaging scope — we prioritized the RAG-grounded chat and assignment drill as the core, since those are the two features that most directly address the problem.

Built With

  • docker
  • etc.
  • faiss
  • fastapi
  • gemini-api
  • google
  • google-ai-studio
  • huggingface
  • langchain
  • langgraph
  • ollama
  • openrouter
  • pdf.js
  • postgresql
  • sentence-transformers-(all-minilm-l6-v2)
Share this project:

Updates

Submission history