Inspiration
Studying for complex subjects often devolves into passive re-reading, isolated cramming sessions, and disorganized study materials scattered across multiple platforms. Many students struggle not only with converting raw course notes into effective active-recall tools, but also with finding peer study partners whose schedules, knowledge gaps, and target goals align with their own.
StudyHub was born from a desire to bridge this gap. We set out to create a unified, AI-driven learning ecosystem that automates the tedious parts of studying—such as generating flashcards, structuring practice quizzes, and scheduling review intervals—while connecting students into optimal, peer-to-peer study networks.
What it does
StudyHub is an intelligent study workspace and collaborative learning platform. Its core features include:
- Automated Material Processing: Students upload lecture slides, PDF notes, or raw markdown text. StudyHub parses the document, extracts key concepts, and generates structured flashcards and diagnostic practice tests.
- Algorithmic Spaced Repetition: Flashcard review schedules adapt dynamically to individual performance, ensuring retention while minimizing study time.
- Peer-Matching Engine: An automated engine computes compatibility scores between students based on shared subject areas, complementary knowledge strengths/weaknesses, and common availability.
- Interactive Study Rooms: Shared real-time whiteboards and collaborative document editors equipped with an AI study assistant that answers questions in context based solely on uploaded course materials.
How we built it
StudyHub uses a modern full-stack architecture designed for real-time interaction and quick dynamic indexing:
- Frontend: Built with Next.js, React, and Tailwind CSS to ensure a responsive, accessible dashboard across mobile and desktop devices.
- Backend: Powered by Python (FastAPI) to handle asynchronous document processing pipelines, API orchestration, and vector search operations.
- Data & Vector Storage: PostgreSQL with
pgvectorstores relational user data, study schedules, and high-dimensional embeddings generated from course documents. - AI & NLP: Document parsing uses PyPDF and LangChain to chunk text. Open-source embedding models vectorize content chunks, allowing the system to perform retrieval-augmented generation (RAG) for flashcard and quiz creation.
Mathematical Foundations
To optimize peer matching and study schedules, StudyHub integrates two core mathematical formulations directly into its backend algorithms:
- Peer Matching Compatibility Score: To match students based on topic overlap and schedule availability, we compute cosine similarity between candidate topic vector $\mathbf{u}$ and target vector $\mathbf{v}$, weighted by schedule availability overlap $A(\mathbf{u}, \mathbf{v}) \in [0, 1]$: $$\text{Score}(\mathbf{u}, \mathbf{v}) = w_1 \left( \frac{\mathbf{u} \cdot \mathbf{v}}{\Vert{}\mathbf{u}\Vert{} \Vert{}\mathbf{v}\Vert{}} \right) + w_2 A(\mathbf{u}, \mathbf{v})$$
where $w_1$ and $w_2$ are tuned weights satisfying $w_1 + w_2 = 1$.
- Adaptive Spaced Repetition Interval Update: Card review intervals are updated using an adaptation of the SuperMemo SM-2 algorithm. The modified Easiness Factor $EF'$ updates after each attempt quality rating $q \in [0, 5]$: $$EF' = \max\left(1.3,\, EF + (0.1 - (5 - q) \cdot (0.08 + (5 - q) \cdot 0.02))\right)$$
The interval $I_n$ for review $n$ is calculated recursively: $$I_n = \begin{cases} 1 & \text{if } n = 1 \ 6 & \text{if } n = 2 \ I_{n-1} \times EF' & \text{if } n > 2 \end{cases}$$
Challenges we ran into
- Context Window & Hallucination Management: Parsing lengthy, dense textbooks often produced redundant flashcards or inaccurate summary points. We had to implement semantic chunking with overlapping windows to preserve technical context before passing prompts to the language model.
- Low-Latency Streaming: Generating multi-question practice exams with structured JSON outputs initially caused noticeable UI latency. We resolved this by streaming partial responses over Server-Sent Events (SSE) and validating JSON schemas on the fly.
- Multi-Factor Matching Efficiency: Calculating real-time compatibility across large sets of active users using both scalar schedule constraints and vector embeddings was computationally heavy. Pre-filtering candidates using vector index bounds significantly lowered query latency.
Accomplishments that we're proud of
- Built a functional, end-to-end full-stack application within the hackathon timeframe.
- Implemented a custom retrieval-augmented generation pipeline capable of handling dense technical documents and extracting precise key terms.
- Successfully integrated active recall generation, spaced repetition tracking, and real-time collaboration into a clean user interface.
What we learned
- Prompt Engineering for Structured Outputs: Forcing AI models to reliably output strictly formatted schema representations (like multi-choice arrays and flashcard pairs) requires explicit systemic constraints and fallback parsing logic.
- Vector Index Optimization: Fine-tuning embedding chunk sizes directly affects retrieval accuracy. Smaller chunks ($256$ to $512$ tokens) yield far higher retrieval precision for concept extraction than large paragraph dumps.
What's next for StudyHub
- LMS Integration: Building direct integrations for platforms like Canvas, Google Classroom, and Blackboard to auto-sync course syllabus schedules and assigned reading materials.
- Audio-Based Flashcard Review: Adding a hands-free voice interface for audio-based spaced repetition sessions on mobile devices.
- Expanded Knowledge Graphs: Displaying interactive node maps that visually show dependencies between course topics and individual mastery levels over time.
Built With
- css
- electron
- github
- html5
- javascript
- md
- vercel
Log in or sign up for Devpost to join the conversation.