Inspiration

Student and developer burnout is a physiological problem disguised as a time-management problem. Traditional study timers (such as standard Pomodoro clocks and static voice timers) treat every day identically—whether you slept 8 hours and feel sharp, or slept 4 hours and are running on fumes. Pushing through severe sleep debt and cognitive exhaustion leads to diminishing returns, frustration, and eventual burnout.

We built StudyBuddy to turn Alexa+ into an empathetic, physiologically aware study coach that orchestrates across wearable vitals, adaptive cognitive planning, and hard circadian safety guardrails—while maintaining cross-session learning memory.

What it does

StudyBuddy goes beyond a single-turn question-answering bot by running an autonomous multi-agent pipeline over the official MCP Spec 2025-11-25 (Streamable HTTP):

  • Natural Language Voice Check-In: Students speak naturally ("Alexa, ask StudyBuddy—I'm exhausted today and my energy is 2 out of 10"). StudyBuddy extracts mood, energy (1–10), and user intent to trigger the supervisor agent.
  • Autonomous A2A Physiological Discovery: The Supervisor queries the mcp-wellness-agent worker over Agent-to-Agent (A2A) protocols for sleep duration, sleep quality, resting heart rate, and circadian metrics.
  • Adaptive Cognitive Load Planning: Dynamically maps physiological recovery against student mood to recommend evidence-based study rhythms:
    • Overkill Mode: 50 min deep work / 10 min break × 3 blocks (high energy + optimal sleep)
    • Sustenance Mode: 25 min focus / 5 min break × 4 blocks (standard Pomodoro)
    • Low Mode: 15 min focus / 5 min break × 2 blocks (moderate fatigue)
    • Custom / Rest Mode: 10 min light review or mandatory recovery (sleep deficit)
  • Dual-Layer Burnout Guardrails: Enforces non-negotiable health rules: a 240-minute daily study cap, a 22:00 sleep cutoff (with an audited 15-minute Human-in-the-Loop Override option), a 4.5-hour minimum sleep threshold, and consecutive-day burnout warnings.
  • Alexa+ Multimodal Experiences: Generates structured alexa_plus_card and 3-card alexa_plus_carousel payloads formatted for Echo Show and Alexa+ devices, paired with Claude 3 Haiku voice coaching audio.
  • Cross-Session Memory & Analytics: Stores session outcomes, atomic daily study counters, and multi-agent decision traces to adapt future recommendations to when the student is most productive.

How we built it

We built StudyBuddy using a multi-service AWS and Alexa+ serverless architecture:

  • Alexa+ MCP Server (src/server.py): Built with FastMCP and FastAPI, implementing MCP Spec 2025-11-25 over Streamable HTTP (POST /mcp with Mcp-Session-Id header handling).
  • Amazon Bedrock (bedrock-runtime Claude 3 Haiku): Generates context-aware empathetic voice coaching scripts, performs second-tier LLM safety evaluations, and creates proactive notifications.
  • Amazon DynamoDB: Single-table design (StudyBuddyData) with GSI1 for fast time-series queries, atomic counters for daily study minute caps, and automated TTL expiration on agent traces.
  • Amazon CloudWatch & EventBridge: Emits custom metrics (check_in_latency, agent_calls, user_engagement) into the StudyBuddy namespace and triggers scheduled 19:00 study check-in and 21:30 sleep cutoff reminders.
  • Unified AWS Lambda Entrypoint: Bridges both synchronous API Gateway V2 HTTP /mcp tool calls and asynchronous EventBridge scheduled rules in a single stateless function.
  • Interactive Web App & Streamlit UI: Offers Web Speech API speech-to-text, an in-memory harmonic WAV synthesizer fallback, live focus timers, and real-time decision trace inspection.

Challenges we ran into

  • MCP Streamable HTTP Transition: Upgrading from SSE transports to the official 2025-11-25 Streamable HTTP standard required custom session header (Mcp-Session-Id) preservation and unified JSON-RPC 2.0 dispatching across AWS Lambda and local containers.
  • Audio Pipeline & Sandbox Restrictions: Streamlit stripped <script> tags when rendering raw HTML in React, causing browser voice APIs to fail. We re-engineered the audio bridge with st.components.v1.html and built a zero-dependency harmonic WAV synthesizer in pure Python so audio generation never stalls offline.
  • DynamoDB Serialization & Local Development: boto3 strictly rejects Python float values, breaking Pydantic models. We implemented recursive Decimal conversion and built an instant LocalSQLiteStore fallback to eliminate 12-second boto3 retry freezes when developing offline.
  • Balancing Safety with Autonomy: Hard cutoffs can frustrate students working on urgent deadlines. We designed a Human-in-the-Loop Override that logs user intent to CloudWatch while capping late-night overrides to 15 minutes.

Accomplishments that we're proud of

  • 21 / 21 Passing Unit & Integration Tests: Comprehensive test coverage spanning multi-agent planning, safety downgrades, MCP 2025-11-25 JSON-RPC calls, EventBridge handlers, and CloudWatch metrics.
  • True Multi-Agent Collaboration: Orchestrating distinct, decoupled agents (Wellness, Planner, Safety, Supervisor) that can veto and adjust each other's outputs based on real physiological data.
  • Dual-Licensed Open Source Contribution: Extracted and published mcp-wellness-agent under the PolyForm Noncommercial 1.0.0 and GNU AGPLv3 licenses, giving the community a plug-and-play MCP server for wearable vitals.

What we learned

  • How to design and structure multimodal card and carousel payloads for the new Alexa+ Model Context Protocol ecosystem.
  • How to combine deterministic rule engines (SafetyAgent) with generative LLMs (Amazon Bedrock) to build reliable, safe AI workflows.
  • How single-table DynamoDB designs combined with EventBridge scheduled rules create cost-effective serverless agent architectures.

What's next for StudyBuddy: Energy-Aware Voice Study Coach for Alexa+

  • Direct Wearable OAuth: Connecting real-time Apple Health and Garmin API webhooks to mcp-wellness-agent.
  • Bedrock Prompt Caching: Leveraging static system prompt caching to reduce token costs and achieve sub-300ms voice responses.
  • Collaborative Study Rooms: Enabling study buddies to share anonymous energy levels and synchronise Pomodoro breaks over Alexa+ devices.

Built With

Share this project:

Updates

Submission history