Story-Story is an engaging storytelling app designed for children. It takes the rich histories of Nigerian and African figures and turns them into child-friendly, factual stories. With vibrant illustrations and captivating narratives, Story-Story aims to make history come alive for young minds. Stories are generated using an LLM agentic workflow, see demo here.
Story-Story uses an ensemble of AI LLM agents implemented with LangGraph to generate entire 10-page stories about a hero from a single input (the hero's name).
Below is the architecture
- Planner Agent
- Responsible for generating the outline / chapter titles for the story
- input:
historical_figure - output:
chapter_title - model: GPT-4o
- Storyteller Agent (GPT-4o)
- Responsible for generating accurate content for the chapter
- input:
historical_figurechapter_title - output:
chapter_content - model: GPT-4o
- Illustrator Agent
- Responsible for generating prompts that will be used to generate images
- input:
chapter_titlehistorical_figure - output:
prompt - model: GPT-4o
- Image Creator
- Responsible for generating the illustrations given a prompt
- input:
historical_figureprompt - outputs:
image - model: Flux.1 Schnell
- Publisher Agent
- Responsible for verifying validity of outputs, making sure it's okay for child consumption
- inputs:
historical_figurechapter_contentimage - outputs:
score - model: GPT-4v
- Install requirements
pip install -r requirements.txt- Add OpenAI API Key to environment
export OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxx" - Add Supabase credentials to environment
export SUPABASE_URL="https://your-project-url.supabase.co"
export SUPABASE_KEY="your-supabase-key"- Add Hugging Face token to environment
export HF_TOKEN="hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"python main.py --historical_figure "Ahmadu Bello"This will create the 10-page content including illustrations about Ahmadu Bello and upload to a Supabase database
The app uses Supabase for storing story-related data. Here's a brief schema overview:
- Stories:
id: Primary Keytitle: Title of the storyhistorical_figure: Name of the figuredescription: Brief descriptioncreated_at: Timestamp
- StoryPages:
id: Primary Keystory_id: Foreign Key (References Stories)page_number: Page number in the storychapter: Chapter contentillustration_url: URL for the illustrationprompt: Prompt used to generate illustrations
Contributions are highly welcome!
Here are ideas I am currently working on
- Illustrations
- Add reference store so storyteller agent can perform RAG
- Narrator
