StoryGen — Multi-Agent Children’s Story Generator (Gemini API) with Inline Vocabulary Assist

StoryGen Multi Agent Childrens Story Generator with Inline Vocabulary Assist using Gemini API

Hello all

I wanted to share a small browser based application I built recently using the Gemini API

It began as a practical exercise my daughter enjoys being read to but often encounters unfamiliar words in stories and is understandably reluctant to interrupt to ask what they mean or how they are pronounced The aim was to provide a way for her to explore new vocabulary independently in context without breaking the flow of reading

The result is StoryGen a zero dependency client side web application which generates personalised childrens stories using a staged multi agent pipeline implemented via Gemini

Rather than prompting a single model to produce a complete story in one pass the application orchestrates a sequence of specialised agents each responsible for a distinct part of the process

Crafter then Elaborator then Reviewer then Polisher then Cleaner then Titler
with an optional Consolidation pass where required

Each stage operates with its own prompt constraints and role identity loosely mirroring a simplified editorial workflow The intention was to produce outputs that feel internally consistent and considered particularly for multi episode story arcs where tone drift can otherwise become noticeable

The main user facing feature is an Assist tab which activates when the reader clicks on any word in a generated story From there they can view definitions phonetics and part of speech see example sentences and hear pronunciation via dictionary recordings from Wikimedia or browser text to speech

This allows children to explore unfamiliar vocabulary in situ without leaving the page or explicitly asking for help which was an important design goal

Additional controls allow adjustment of reading difficulty narrative framework such as Three Act Story Circle or Kishotenketsu authorial tone pacing humour and emotional intensity Stories can also be generated as short series with continuity metadata passed between chapters

From an implementation perspective the application is pure vanilla JS HTML and CSS with no build step or npm dependencies entirely client side where the user supplies their own Gemini API key using the generativelanguage.googleapis.com v1beta models endpoint

Repository and demo are available here

GitHub https://github.com/LightningPhil/StoryGen
Demo https://lightningphil.github.io/StoryGen

I would be very interested in any feedback particularly from others experimenting with multi stage orchestration patterns or educational accessibility use cases on Gemini

Many thanks
Phil Leichauer