
Creating a mobile app that generates personalized bedtime stories for children seemed like a perfect intersection of technology and parenting. The dream was simple: use AI to create engaging, age-appropriate stories that adapt to each child’s interests—all processed locally on their device for complete privacy and security.
I’m excited to share my journey building MyBedtimeStories, an iOS app that leverages Apple’s foundation models to generate interactive stories in real-time, entirely on-device. In this post, I’ll discuss my development approach, the architectural challenges I overcame, what worked beautifully, and where I’m still working on improvements.
The Vision: AI-Powered Bedtime Stories, Locally
The core idea behind MyBedtimeStories is straightforward yet ambitious:
- Generate personalized stories tailored to each child’s age, interests, and reading level
- Process everything on-device to ensure complete privacy—no data sent to servers
- Use Apple’s foundation models to leverage cutting-edge AI without external dependencies
- Create an engaging experience that encourages children to love reading
With growing concerns about data privacy and children’s safety online, building a zero-data-collection app felt like the right direction. Every story, every preference, every interaction stays on the device where it belongs.
Development Strategy: Leveraging GitHub Copilot
When I started building MyBedtimeStories, I made a conscious decision to use GitHub Copilot as my primary development assistant. This choice significantly accelerated my development timeline and allowed me to focus on architecture and user experience rather than boilerplate code.
Why GitHub Copilot?
- Rapid prototyping – Copilot’s code suggestions helped me iterate quickly through different implementations
- Learning curve reduction – For iOS development with Apple’s new APIs, having an AI assistant familiar with best practices was invaluable
- Consistency – Copilot helped maintain consistent patterns throughout the codebase
- Documentation generation – Explaining what I wanted to build often resulted in well-documented, production-quality code
The Development Experience
Working with Copilot was genuinely productive. I’d describe what I wanted—”Create a view that presents a generated story with pagination and highlights”—and Copilot would produce functional code that required minimal refinement. This workflow let me focus my effort on solving the harder problems: architecture, API integration, and user experience.
However, like any tool, Copilot isn’t a silver bullet. It works best when you have a clear vision of what you’re building and can effectively guide it through conversation and prompts.
The Main Challenge: Finding the Right Architecture
The biggest hurdle I faced wasn’t implementing the story generation itself—it was figuring out how to elegantly integrate Apple’s foundation models into a cohesive, maintainable iOS architecture.
From Monolith to Modular Design
I initially tried a straightforward approach: call the foundation model, get back a story, display it. But as I added features—customization, multiple story types, reading progress tracking, bookmarks—the code became increasingly tangled. The breakthrough came when I restructured around a service-oriented architecture:
- StoryGenerationService – Handles all interactions with Apple’s foundation models
- StoryRepository – Manages local storage and persistence of stories
- PreferenceManager – Tracks user preferences, age groups, and interests
- UICoordinator – Manages navigation and view state
This separation of concerns meant. The UI layer never directly interacts with the ML model. Story generation can happen in the background without blocking the interface. I can easily swap implementations (e.g., testing with mock data). Each component is testable in isolation.
What Worked Well: Story Quality is Excellent
Here’s where I’m genuinely proud: the stories generated by Apple’s foundation models are excellent.
Why the Quality Exceeded Expectations
- Context awareness – The model understands character development, narrative arcs, and age-appropriate content nuances
- Customization – I can pass detailed prompts and instructions specifying themes, characters, moral lessons, and reading level
- Consistency – Generated stories maintain coherent plots and character personalities throughout
- Safety – Apple’s models are designed with safety guidelines that align perfectly with content for children
The Remaining Challenge: Siri Voice Quality
Here’s the honest part: while the story generation is outstanding, the Siri voice synthesis falls short of the experience I envisioned. The voice lacks natural intonation and emotional variation. Dialogue doesn’t sound like different characters speaking. The speaking rate feels unnatural at times, making stories harder to follow. Lack of Emotional Expression – The voice doesn’t convey excitement, sadness, or other emotional nuances that bring stories to life
Why I Choose On-Device Synthesis
I deliberately avoided commercial text-to-speech services (Google, Amazon, etc.) because:
- Privacy – I wanted zero data transmission, which is a core promise of MyBedtimeStories
- Consistency – On-device synthesis doesn’t require internet, making the app work fully offline
- Cost – External services would require significant licensing costs, affecting app pricing
The Current State
I’ve optimized what I can within the constraints of Siri’s voice synthesis:
- Strategic pausing for paragraph breaks
- Careful punctuation to improve pacing
But I’m honest with myself: it’s not ideal. The generated stories are compelling and engaging to read, but when read aloud by Siri’s voice, some of the magic is lost.
Conclusion: Privacy Meets Innovation
Building MyBedtimeStories taught me that you don’t need to compromise on privacy to deliver cutting-edge AI features. Apple’s on-device foundation models make it possible to create genuinely intelligent apps without any data leaving the device.
The story generation quality proves that foundation models are ready for consumer applications in the real world. The voice synthesis challenges remind me that AI isn’t a magic solution to every problem—thoughtful design and honest assessment of where technology excels and where it needs improvement are crucial.
For parents looking for a safe, private way to provide their children with personalized bedtime stories, I invite you to try MyBedtimeStories. For developers considering on-device AI, I hope my architectural insights and lessons learned prove useful.
The bedtime story market has been waiting for innovation. I’m excited to be bringing AI-powered storytelling to families—the right way.
Resources & Links
- MyBedtimeStories on App Store – MyBedtimeStories app
- Data Privacy Policy – DataPolicy
- Apple Foundation Models Documentation – Apple’s official documentation
- GitHub Copilot – github.com/features/copilot
