Inspiration
AI chat is rapidly becoming one of the most common ways people interact with technology. Much of that momentum, however, is directed toward open-ended conversation, instant engagement, and attention-grabbing entertainment.
We felt that an important possibility was receiving less attention: using the same generative capabilities to create thoughtful, age-appropriate experiences for children and families.
Rather than placing an unrestricted chatbot in front of a child, we asked a different question:
What if AI worked quietly behind the scenes to create a safe, illustrated story where a child's choices genuinely matter—and give families something meaningful to talk about afterward?
Children often reveal curiosity, caution, empathy, imagination, and personal values more naturally through play than through direct questions. Stories provide a gentle space to explore these qualities without making children feel that they are being tested.
We also did not want education to feel like a lesson pasted onto an adventure. Instead, we wanted children to encounter ideas such as empathy, courage, honesty, patience, cooperation, and responsibility through characters, choices, and consequences.
The goal is not to lead every child toward the same "correct" answer. It is to create opportunities for children and parents to wonder together:
- Why did this choice feel right?
- How might the other character have felt?
- What could have happened on the path we did not take?
- Would we choose differently next time?
That idea became Forking Forest (두갈래숲).
What it does
Forking Forest is an agent-generated, illustrated storybook experience designed for children ages 4–9 and the adults who read with them.
The child becomes the protagonist. At several moments in each story, they decide how to approach a character, respond to a problem, or explore the world.
Some choices create short, playful variations before returning to the main story. More meaningful choices can open genuinely different paths and endings. The child is therefore not simply pressing a decorative button—their decision becomes part of the story's causal history.
Each choice can carry two kinds of context:
- An observational dimension, such as curiosity, caution, self-expression, imagination, or cooperation
- A value-related theme, such as empathy, honesty, courage, patience, or responsibility
Across multiple stories, Forking Forest can summarize recurring patterns in a child's choices. Parents can use these patterns as conversation starters and as one reference when choosing future stories.
This is intentionally not a diagnosis, personality test, or score. One fictional decision cannot define a child, and there are no universally correct choices. A cautious response can be thoughtful in one situation, while taking a risk can be meaningful in another.
Rather than telling parents what their child "is," Forking Forest helps them notice questions worth exploring together.
Future stories can then offer a balanced next experience—for example, revisiting a theme the child enjoys, encountering a perspective they have not explored recently, or thinking about the same value in a different situation. These suggestions are designed to broaden experience, not correct the child or optimize them toward a predetermined personality.
The same story structure can also be adapted for different reading ages, with shorter and simpler language for younger children and richer descriptions for older readers.
How we built it
We learned early that writing a linear story first and attaching branches afterward creates continuity problems.
A character might appear on a path they never entered. The protagonist might suddenly know something they never discovered. A choice might sound important but have no meaningful effect. Different endings can feel attached to the story rather than earned by it.
We therefore redesigned the generator around a chapter-level story DAG.
An agent first plans the story's shared events, chapter boundaries, lightweight rejoining choices, major forks, and possible endings. It also records which facts must remain true across every path and which events depend on a particular choice.
Writing agents then expand individual chapters while receiving the relevant causal context from earlier chapters and choices. This keeps each section manageable while preserving continuity across the complete story.
Specialized validation and repair stages check:
- Whether each branch respects the choice that led to it
- Whether characters, objects, locations, and knowledge remain consistent
- Whether choices produce understandable consequences
- Whether every ending is reachable and narratively earned
- Whether the language and page length suit the target age
- Whether options remain balanced instead of implying a morally correct answer
- Whether the structured output can be safely compiled into the reader
- Whether illustrations belong to the correct page and story revision
When a validator discovers a problem, the system classifies its scope. A formatting issue can be repaired directly. A broken scene can regenerate only the affected chapter. A deeper causal problem can return to the relevant branch or plan without automatically discarding the entire book.
The workflow uses OpenAI models through Codex, with LangGraph and LangChain coordinating structured planning, writing, validation, repair, and illustration tasks. The product is built with Next.js, React, TypeScript, and Supabase.
We also built a visual authoring studio where generated stories can be inspected as graphs, compared across immutable revisions, and eventually edited directly by human creators.
Challenges we ran into
The hardest problem was not producing prose. It was preserving causality across branching paths.
Every choice can change what the protagonist has seen, who accompanied them, what objects they carry, and what other characters know. Passing only the previous page to the next writing step was not enough. We had to represent story state explicitly and validate complete reading paths.
Illustration introduced another challenge. Character sheets must guide the image generator without being mistaken for the final scene, and each generated image must remain attached to the correct story, revision, chapter, and page.
A third challenge was defining the ethical boundary between helpful observation and inappropriate assessment.
A child's choice inside a fictional world should never become a psychological conclusion. We therefore designed the system to preserve context, look for repeated patterns rather than isolated answers, communicate uncertainty, and avoid ranking one personality or value above another.
Accomplishments that we're proud of
We are especially proud that Forking Forest treats branching as part of the story's foundation rather than a decorative feature.
The system supports both lightweight choices and meaningful forks with multiple endings, while preventing the graph from expanding uncontrollably. Its repair loop can improve a specific chapter or path while preserving validated writing and illustrations elsewhere.
We are also proud of connecting the child-facing reading experience with a graph-based creation tool. The same structured story can be generated by agents, validated by specialized gates, inspected by humans, revised safely, and rendered as an illustrated book.
Most importantly, we found a way to pursue educational value without turning the story into a disguised questionnaire or moral lesson. Children can stay immersed in the adventure, while families gain a natural opportunity to discuss choices, consequences, feelings, and alternative perspectives.
What we learned
Generative AI becomes more reliable when creativity is supported by clear structural contracts.
We learned that a planner, chapter writer, validator, repair agent, and illustrator need different responsibilities and different context. Asking a single model to repeatedly rewrite the entire book was both less reliable and more wasteful.
We also learned that educational value does not have to mean delivering a predetermined lesson. It can mean helping children consider another character's perspective, imagine consequences, articulate why they made a choice, and remain curious about paths they did not take.
Finally, we learned that trust cannot be added after building a product for children. It has to shape the data model, prompts, validation rules, interface language, parent guidance, and the conclusions the product deliberately refuses to make.
What's next for Forking Forest
Next, we plan to:
- Continue generation-and-review cycles to improve narrative and illustration quality
- Complete English localization and develop more culturally diverse story worlds
- Strengthen character and visual consistency across every branch
- Give parents gentle controls for preferred themes and topics to avoid
- Add optional post-reading conversation prompts for families
- Recommend future stories by balancing the child's interests, recently explored themes, and less familiar perspectives
- Generate personalized follow-up stories using reading history without forcing a fixed developmental direction
- Expand the graph studio into a collaborative environment where writers and educators can edit stories directly
- Explore printed editions of the stories created by each family
Our long-term goal is to show that generative AI for children does not have to mean unrestricted chatting, passive consumption, or endless stimulation.
It can be a carefully designed creative partner—one that helps children imagine, choose, encounter different perspectives, and think together with the adults who care for them.
Built With
- codex
- langchain
- langgraph
- next.js
- openai
- react
- supabase
- typescript
- vercel
Log in or sign up for Devpost to join the conversation.