Sonomancer is a vibe-aware ambient e-reader, created by Roman Slack, that syncs each chapter of a book with AI-curated background ambience sourced from YouTube. Users upload any EPUB or PDF and read through a clean, dark-mode, chapter-by-chapter interface while an autonomous AI agent generates ambient soundscapes that match the mood of the current chapter, producing an immersive, mood-aware reading experience.
The system is built as a full-stack application with a Next.js 15 and React 19 frontend styled with Tailwind CSS, and a Python 3.11 FastAPI backend. Books are parsed using ebooklib for EPUB and PyMuPDF for PDF, and a small set of API endpoints handle uploading a book, listing chapters, fetching chapter content, and returning AI analysis that maps a chapter to a mood and a matching YouTube video ID. Ambient videos auto-play with cross-fading between chapters and can be toggled on or off via an on-page speaker control without leaving the reader.
At the heart of Sonomancer is an autonomous agentic AI system. It extracts contextual excerpts from chapter text using smart sampling, deploys OpenAI GPT for creative mood classification and ambience recommendations, and generates targeted search queries for content discovery. A YouTube Search tool queries the YouTube Data API v3 with filtering, while a content scoring engine evaluates results using weighted keyword analysis to prefer calm, long-duration ambient content over music tracks, handling API failures gracefully with fallback strategies.
Sonomancer is notable for combining ebook parsing, LLM-driven mood analysis, and tool-using agent behavior into a single immersive product, packaged for one-command deployment via Docker Compose and released under the MIT license.
Key Features
- Upload and read EPUB and PDF books in a clean dark-mode interface
- AI-powered ambience that analyzes each chapter's mood and finds matching YouTube videos
- Autonomous AI agent with YouTube search and weighted content-scoring tools
- Auto-playing ambient videos with cross-fade transitions between chapters
- On-page toggle controls to turn ambience on or off without leaving the reader
- Graceful handling of API failures with fallback search strategies
- One-command deployment via Docker Compose
Tech Stack
Designed and built by Roman Slack, Lead AI Platform Engineer. See more of Roman Slack's work on the projects page or get in touch via the contact page.