Inspiration

High school can be overwhelming. Students juggle classes, homework, extracurriculars, and the constant pressure of upcoming exams. We noticed that most productivity tools are reactive—they only work when the user actively engages with them. Our inspiration was to create a truly proactive assistant, an "AI Mentor" that doesn't just wait for commands but actively anticipates a student's needs. We wanted to build a partner that looks at your schedule and says, "I see you have a Math exam in three days. Let's get you prepared."

What it does

AI Mentor is a conversational, agentic AI designed to be the ultimate study companion. It seamlessly integrates with a student's life to provide timely and relevant support:

  • Sees Your Schedule: It connects to the user's Google Calendar to identify upcoming exams, tests, and deadlines.
  • Finds Study Materials: Once it spots an upcoming exam, it can autonomously use the Google Custom Search API to find relevant study materials, such as tutorial videos, articles, and practice problems on that specific topic.
  • Manages Knowledge: It features a built-in Flashcard Manager, allowing users to create, store, and review key concepts by topic, turning passive learning into active recall.
  • Acts Proactively: This is its core feature. A background scheduler runs periodically, allowing AI Mentor to check the calendar on its own. If it finds an upcoming exam, it will automatically generate and deliver a helpful reminder to the user, without any user prompt.

How we built it

The core of AI Mentor is a multi-tool agent built with Python and the LangChain framework, powered by Google's Gemini-1.5-Flash model.

  1. Agentic Brain: We used LangChain's create_react_agent to build an agent capable of reasoning, planning, and executing a sequence of actions (ReAct).
  2. The Tools: We equipped the agent with three custom-built tools:
    • Google_Calendar_Reader: Authenticates via OAuth 2.0 and uses the Google Calendar API to fetch events.
    • Study_Material_Searcher: Uses the Google Custom Search JSON API to find web resources.
    • Flashcard_Manager: A custom tool that uses a simple flashcards.json file for persistent, local storage of study cards.
  3. The Proactive Heartbeat: We integrated the APScheduler library to run a background job at a set interval. This job calls the agent's tools programmatically to check the calendar and trigger notifications, making the agent truly autonomous.
  4. Interactive Interface: The application runs in the local terminal with an interactive loop, allowing the user to converse with the agent while the proactive checks happen silently in the background.

Challenges we ran into

  1. AI Formatting Quirks: The LLM would occasionally wrap its JSON-formatted Action Input in markdown backticks (` `), causing our json.loads() parser to fail. We solved this by making our parsing function more robust, teaching it to strip any non-JSON characters from the start and end of the string before parsing.
  2. OAuth Authentication Hell: Google's OAuth 2.0 flow was a significant hurdle. The run_local_server method failed in the Google Colab environment, forcing us to switch to the Colab-native auth library. Then, when moving to a local machine, we encountered 403: access_denied errors, which we traced back to the OAuth Consent Screen being in "Production" mode instead of "Testing." This taught us the importance of correctly configuring the project status in the Google Cloud Console.
  3. Subtle Data Type Mismatches: We ran into a TypeError because the agent passed a number as a string (e.g., "7") to a function expecting an integer (7). This was a great lesson in ensuring all tool functions are built defensively and explicitly handle data type conversions.

Accomplishments that we're proud of

We are incredibly proud of building an agent that is more than just a chatbot. It can reason, plan, and execute a multi-step process to solve a complex user request. Seeing it successfully check the calendar, identify the exam topic, and then find relevant study materials all in one go was a huge accomplishment. Furthermore, implementing the proactive, scheduled background task brought our initial vision to life, creating an AI that truly feels like an agent acting on the user's behalf.

What we learned

This project was a deep dive into the practical realities of building LLM agents. We learned that prompt engineering is paramount; a strict, well-defined prompt is the key to reliable agent behavior. We also learned the immense value of verbose=True mode for debugging an agent's "thought" process. Finally, we gained invaluable hands-on experience navigating the complexities of API authentication and building robust, error-tolerant tools.

What's next for AI Mentor

This is just the beginning! We have a clear roadmap for AI Mentor's future:

  • A User-Friendly Interface: Move beyond the terminal to a web front-end (using React or Vue) or a mobile application.
  • Smarter Notifications: Integrate with desktop notification systems, email, or messaging platforms like Discord/Telegram to deliver proactive reminders more effectively.
  • Robust Database: Upgrade from a JSON file to a proper database like SQLite or a cloud solution like Supabase for more scalable data management.
  • Long-Term Memory: Implement a conversational memory buffer so the agent can remember past interactions and provide even more personalized support over time.

Built With

Share this project:

Updates