💚 Inspiration

Millions of elderly people live alone, facing the daily challenge of managing complex medication schedules and health routines. Their families worry constantly about their well-being, often calling multiple times a day just to ask, "Did you take your pills?" We built Contigo ("With You" in Spanish) to bridge this gap. We wanted to create an assistant that is not just a cold notification on a screen, but a warm, empathetic voice that seniors enjoy talking to, while silently ensuring their safety and providing peace of mind to their loved ones in real-time.

🗣️ What it does

Contigo is an AI-powered conversational care companion. It features:

  • Empathetic Voice Call Simulator: Seniors can start a simulated phone call with "Contigo". The AI adopts a custom tone (comforting, cheerful, patient, or respectful) and integrates the senior's life interests (e.g., singing rancheras, gardening tomatoes) into the conversation.
  • Beyond-Chat Tool-Calling: If the senior mentions they have taken a pill or completed a chore during the voice conversation, the Gemini Agent automatically triggers database functions in the background, updating the dashboard live.
  • Real-time MongoDB Atlas Sync: The family dashboard is backed by a persistent MongoDB Atlas cluster, displaying medication schedules, reminders, and historic call logs.
  • Post-Call Wellness Reports: Upon hang-up, the conversation log is audited by Gemini to generate a structured report for the family, containing mood assessment, medication compliance verification, anecdotes shared, and actionable health alerts.
  • Model Context Protocol (MCP) Server: It exposes a fully compliant /api/mcp JSON-RPC endpoint, allowing third-party AI clients to inspect and write to the health dashboard tools. ## 🛠️ How we built it
  • Backend & DB: We developed an Express + Node.js server written in TypeScript. We integrated the official mongodb driver to connect to a MongoDB Atlas Shared Cluster to persist profiles, schedules, and reports.
  • AI Agent: We implemented the modern @google/genai SDK using Gemini 2.5 Flash for content generation, function declarations, and JSON-schema output format.
  • Frontend: The interactive UI was built using React, Vite, TailwindCSS, and custom micro-animations for a premium, friendly look.
  • Infrastructure: Deployed onto Google Cloud Run using continuous integration from GitHub via Cloud Build. ## 🧠 Challenges we ran into
  • Schema & SDK Validations: We navigated the strict schema expectations of the new Google GenAI SDK, resolving issue validation regarding role types ("model" vs "user" for function responses) and sanitizing conversation history to filter undefined texts.
  • Real-time Latency: Minimizing API latency is crucial for voice dialogues. We migrated from Gemini 3.5 to the highly optimized Gemini 2.5 Flash, reducing response time to under 600ms.
  • DB Whitelisting: Making sure Google Cloud Run (which uses dynamic IPs) could securely write to MongoDB Atlas by configuring the 0.0.0.0/0 access list. ## 🎉 Accomplishments that we're proud of
  • Bridging the gap between conversation and database action. Seeing a senior say they took their medicine on a phone simulator and watching the dashboard turn green in real-time is magical.
  • Building a completely responsive, premium dashboard that feels warm and accessible.
  • Exposing a standardized MCP endpoint to make our care tools open and interoperable. ## 📚 What we learned
  • How to build and expose MCP-RPC servers in web applications.
  • Optimizing server configurations in Google Cloud Run to handle dynamic ports.
  • The impact of emotional tuning (rate, pitch) in web-speech synthesis for older adults. ## 🚀 What's next for Contigo
  • WhatsApp Voice Notes: Integrating the agent directly with WhatsApp API so the elder can talk with Contigo from their normal phone line.
  • Wearables Integration: Connecting heart rate and movement sensors to MongoDB to trigger active calls from Contigo if abnormal data is detected.

Built With

Share this project:

Updates