Google Cloud Rapid Agent Hackathon — MongoDB Track

sl33p-space

Sleep deprivation is one of the most widespread public health challenges of our time. We built an agentic sleep companion to do something about it.

0
adults regularly sleep fewer than 7 hours
CDC
0
annual US economic cost of sleep deprivation
RAND Corporation
0
drowsy driving crashes per year
NHTSA

The problem

The World Health Organization has identified a link between chronic sleep disruption and increased risk of cardiovascular disease, type 2 diabetes, obesity, and depression. The NHS estimates 1 in 3 people in the UK suffer from poor sleep. Despite these numbers, most people who sleep poorly don't seek help.

The tools that exist tend to be either clinical and inaccessible, or passive trackers that tell you what happened but do nothing to change it.

What sl33p-space does differently

sl33p-space is an agentic sleep companion. Rather than passively recording your sleep, it actively helps you prepare for it.

  • AI-generated soundscapes — Using Google's Lyria model, sl33p-space creates unique ambient music shaped by your mood and history. Not generic white noise.
  • Mood-aware playlists — Each session builds a multi-track playlist with a sleep arc: settling, transition, and deep sleep.
  • MongoDB-powered insights — Aggregation pipelines compute which tracks work for which moods, your optimal sleep window, and factor correlations. Evidence-based, not guesswork.
  • Persona adaptation — Whether you're a shift worker, first responder, light sleeper, or insomniac — the agent adjusts to your situation.
  • Works for naps and full nights — No minimum session length. A 20-minute nap is just as valid as an 8-hour sleep.

The stack

Built for the Google Cloud Rapid Agent Hackathon (MongoDB track: "Building Agents for Real-World Challenges").

Google Cloud
Cloud Run for hosting, Cloud Build for CI, Secret Manager for credentials, Cloud Storage for audio files.
Google ADK + Gemini
The Agent Development Kit powers the sleep coach. Gemini reasons about your sleep history and makes data-driven suggestions.
Google Lyria
AI music generation creates unique soundscapes from text prompts. Each track is one-of-a-kind.
MongoDB Atlas
The persistence and analytics layer. Aggregation pipelines drive the recommendation engine — not just storage, but reasoning.
Firebase Auth
Google Sign-In for identity. Session cookies for page loads, Bearer tokens for API calls.
NASA APOD
Astronomy Picture of the Day provides immersive cosmic backgrounds during sleep sessions.

How MongoDB fits in

MongoDB isn't just a database here — it's the reasoning engine behind the agent's recommendations.

  • Sleep sessions — every mood, duration, rating, and factor stored as rich documents
  • Track performance$group + $avg by soundscape to find what works
  • Mood × Track matrix$group by {mood, track} to match the right sound to the right feeling
  • Sleep window$hour + $group to find your optimal bedtime
  • Factor correlations$unwind + $group to show how caffeine, exercise, or stress affect your sleep quality

Open source

sl33p-space is released under the MIT License. The full source code is available at github.com/pixjobs/sl33p-space.

Contributions, feedback, and ideas are welcome. Open an issue or submit a pull request.

Hackathon context

This project was built for the Google Cloud Rapid Agent Hackathon, specifically the MongoDB track focused on building agents for real-world challenges. The goal: demonstrate that MongoDB's aggregation framework can power intelligent, data-driven agent behaviour — not just store chat logs.

The agent doesn't guess. It queries. Every recommendation traces back to a MongoDB aggregation pipeline running over your real session history.