Sonomancer

A project by Roman Slack — Lead AI Platform Engineer

Sonomancer — a project by Roman Slack

Programming · June 2025 · 2 hours · built by Roman Slack

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

Tech Stack

Next.js React TypeScript Tailwind CSS Python FastAPI OpenAI GPT ebooklib PyMuPDF YouTube Data API v3 Docker Docker Compose

View on GitHub →

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.