Inspiration Self-directed online learning is one of the most powerful tools of the modern age, yet it suffers from a silent epidemic: a 99% completion dropout rate. We set out to answer a simple question: Why do we fail to finish the goals we set?

The answer lies in two friction points:

Passive Roadmaps: A study plan is a static list of items. Without allocating actual calendar time, it decays immediately. The Slippage Spiral: When we miss a planned task, we experience guilt, the plan becomes outdated, and we abandon it entirely. We wanted to build TrackMates—an active, agentic personal coach. It doesn't just remind you to work; it schedules time on your Google Calendar, evaluates real evidence of your progress, and dynamically reorganizes your schedule when life gets in the way.

How We Built It

We engineered TrackMates from the ground up to support a tight, secure agent-human feedback loop:

The Brain (Gemini): We leveraged Gemini via the Google GenAI SDK to generate structured learning milestones, evaluate submitted proofs, and calculate realistic recovery schedules. The Memory (MongoDB + MCP): All agentic state—commitments, milestones, proof outcomes, quiz responses, and calendar action histories—is stored in MongoDB. We built a MongoDB MCP (Model Context Protocol) server that sits directly in the agent's critical path, enabling the LLM to query and write state natively. The Calendar Integration: We integrated the Google Calendar API to allow the agent to read user availability, and then proposed and applied calendar blocks (creating, moving, and protecting time slots) under user oversight. The Interface: Built with a custom, high-fidelity Dark Neobrutalist Design System in Next.js (React, TypeScript, vanilla CSS) to make goal-tracking feel premium, responsive, and visually exciting.

Challenges We Faced Prerendering & Dynamic Parameters: During Next.js static builds, pages utilizing search parameters would bail out. We resolved this by refactoring dynamic query segments into separate boundaries. Proof Ambiguity: Handing cases where progress proof was weak or unclear (e.g., a short sentence or a simple link). Instead of pretending certainty, we built a fallback system where Gemini generates a custom, context-aware follow-up quiz for the user to answer to prove they did the work. Reasoning Engine Event Loops: While running the agent runtime in the cloud, multi-threaded requests triggered a RuntimeError due to conflicts with the cached client authentication lock in the google-genai library. We successfully diagnosed and resolved this by monkey-patching the client's internal lock retrieval to make it thread-safe across dynamic event loops.

What We Learned We learned how to design a true Human-in-the-Loop agentic system. An agent shouldn't make destructive changes unilaterally; instead, it should act as an assistant that builds recovery plans and drafts calendar invites, leaving final activation and confirmation in the user's hands. We also learned how Model Context Protocol (MCP) radically simplifies database-to-agent interactions compared to traditional API routing.

Built With

  • 2.0
  • google
  • google-calendar-api
  • javascript
  • languages:-typescript
  • mongodb
  • mongodb-mcp-apis-&-services:-google-gemini-api-(vertex-ai-/-reasoning-engines)
  • oauth
  • playwright-(python)
  • prisma
  • python-frameworks-&-libraries:-next.js-16-(app-router)
  • react-19
  • tailwind-css
Share this project:

Updates