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.
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").
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+$avgby soundscape to find what works - Mood × Track matrix —
$groupby{mood, track}to match the right sound to the right feeling - Sleep window —
$hour+$groupto find your optimal bedtime - Factor correlations —
$unwind+$groupto 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.