Inspiration

Generative AI is a powerful study tool, but studies show a stark gap between perceived learning and actual test performance; students that use AI perform almost 10% worse on average during exams compared to students who don't. We built retAIn to solve this. It bridges the gap by transforming passive "explain this" prompts into an active learning experience, using interactive modules focused on information recall and immediate understanding checks.

What it does

retAIn transforms a single prompt (e.g., "how do neural networks work") into a comprehensive, multi-module lesson plan. More than just a wall of text, it interleaves multiple-choice questions within the content to ensure users are actively engaging, not just skimming. Each module concludes with free-form short-answer questions to solidify understanding. Should you be interested in learning even more, each module contains a list of citations that were used to create it!

Our system sources relevant media like images and YouTube videos to create a rich, multimedia experience. It’s the interactive, test-driven learning layer you wish ChatGPT had from the start.

How we built it

Our stack is Python and FastAPI on the backend, with Angular on the front end. We used Anthropic's Claude API as the engine for a multi-agent system: Lesson Planner Agent: Outlines the high-level curriculum and module structure, proposing n modules to generate.

Module Generation Agent: Each proposed module spins up a module generation agent, which searches the internet for relevant information. After it's done researching, it generates the core instructional text for each module as well as supplemental images and YouTube videos.

EvaluationGeneratorAgent: Creates the multiple-choice and short-answer questions based on content from the module generation agent.

ImageRelevancyAgent: Validates that sourced images are contextually relevant to the topic.

To manage the complex AI outputs, we relied heavily on Pydantic models to rigorously enforce structured, type-safe JSON responses. On the front end, we used WebSockets to stream live progress updates to the user as their lesson is built.

Challenges we ran into

Our biggest hurdles were speed and content quality. Performance: The initial lesson generation was painfully slow. We refactored our backend to make all third-party API calls asynchronous, cutting the total time-to-lesson from several minutes to under 60 seconds. Content Quality: Early modules had irrelevant images, as well as broken links for both images and videos. We had to build our ImageRelevancyAgent to filter out bad results for images, as well as trying a GET request to see if the YouTube link still worked. Humorously, Claude's web searches had a bizarre affinity for Rick Astley's "Never Gonna Give You Up" on YouTube, forcing us to add a specific RegEx filter to block it!

Accomplishments that we're proud of

We're incredibly proud of both the team's growth and the final product. For two of our members, this was their first time building an API!. We all learned a massive amount about agent-based architecture and full-stack development in a single weekend.

We also dedicated significant time to the UI/UX, obsessing over transitions, color palettes, and interactivity to create a clean, polished, and inviting learning environment that we'd actually want to use.

What we learned

Integrating LLMs with the Wild West that is internet data requires robust defenses; strict type enforcement (via Pydantic), quality checks, and graceful error handling were crucial for consistent, usable output. We also learned a lot about pedagogy through feedback from family, friends, and fellow hackers; there's a fine art to balancing effective evaluation with keeping a learner engaged and motivated.

What's next for retAIn

Personalized Learning Paths: Using telemetry (e.g., MCQ vs. short-answer performance) to adapt future lessons to a user's specific learning style.

Community Hub: A place for users to browse, rate, and share the best community-generated courses.

Cost Optimization: Implementing prompt caching to dramatically reduce generation costs (currently 5-6 cents per course) and improve load times for popular topics.

Built With

Share this project:

Updates