The Story Behind The Study Companion: Breaking the Educational "Brainrot" Cycle

💡 Inspiration

Walk into any classroom or study lounge today, and the reality is striking: students are trapped in short-form, high-dopamine "brainrot" content loops. Traditional education tools are failing to compete. When stuck on complex math concepts like Vector Calculus, students face a frustrating choice: dig through stale, non-interactive textbooks or watch generic video playlists that don't address their specific roadblocks.

We asked ourselves: What if we could fight fire with fire? What if we could build an educational tool that feels as fast, adaptive, and interactive as modern media, but channels that engagement entirely into mastering mathematics?

That is how The Study Companion was born—an intelligent, conversational HKDSE Math "Study Buddy" designed to make high-level mathematics instantly accessible, responsive, and deeply engaging for the modern student.


🛠️ How We Built It

We engineered The Study Companion to combine cutting-edge language models with rigid, production-grade data consistency.

  • The Brain (Vertex AI & Gemini Ecosystem): We utilized Google Cloud’s Gemini Agent Builder to handle conversational flows and multi-turn reasoning. By tapping into Gemini's massive context window, the agent doesn't just guess math steps—it acts as a patient, logical tutor breaking down complex mathematical operations.
  • The Grounding Source (MongoDB Atlas): LLMs notoriously struggle with precise calculations and hallucinate formulas. To ensure absolute accuracy, we implemented Retrieval-Augmented Generation (RAG) by anchoring the Gemini agent to a live MongoDB Atlas database cluster. This contains vetted HKDSE syllabus curriculum data and exact question sets.
  • The Interface (Streamlit): We wrapped the system in a clean, lightweight frontend, giving students a zero-friction playground to input equations, seek clarifications, and visualize solutions in real time.

For example, when a student struggles to compute the flux of a vector field $\mathbf{F}$ through a surface $S$, the agent pulls precise formulas from MongoDB and guides them step-by-step through the Surface Integral:

$$\iint_S \mathbf{F} \cdot \mathbf{n} \, dS$$


🚧 Challenges We Faced

Building an advanced AI orchestrator under hackathon time constraints brought intense hurdles:

  1. The LLM Math Paradox: Getting standard generative models to output pristine mathematical proofs without hallucinating variables is notoriously difficult. We solved this by strictly enforcing structural prompting rules in Agent Builder and forcing the agent to crosscheck its logic against our underlying database schema before responding.
  2. Environment Syncing under Pressure: Developing purely in cloud-hosted workspaces meant configuring precise environment variables and securely bridging local repositories to GitHub. Setting up the live database user network permissions and syncing our codebase seamlessly via custom Git pipelines required rigorous debugging, but it pushed us to maintain a completely clean, industry-ready deployment workflow.

📚 What We Learned

This project was a massive accelerator for our team. We deeply internalized the power of cloud ecosystems—learning how to scale an application rapidly using Google Cloud without needing heavy local IDE architecture. More importantly, we mastered Data Grounding. We realized that an AI model is only as powerful as the infrastructure behind it; integrating MongoDB taught us how to turn a generic conversational LLM into a highly specialized, accurate domain expert.

The Study Companion proves that with the right cloud infrastructure, we can build tools that don't just teach—they inspire.

Built With

Share this project:

Updates