Experiments

StoryGen: AI Stories Built on Narrative Beats, Not Vibes (An Experiment in Structured Generation)

· Experiments

StoryGen builds AI stories outline-first: ideas, environments, chapter key events, then prose. What the design proves, and what it does not.

StoryGen: AI Stories Built on Narrative Beats, Not Vibes (An Experiment in Structured Generation)

Last updated: November 15, 2026 · 6-minute read

Most AI story tools take one prompt and return one wall of prose, and the middle sags because nothing decided it in advance. StoryGen is my experiment in the opposite order: fix the structure first — premise, world, chapter outline — and only then generate prose, chapter by chapter, against that outline. This post describes the design as it stands in the repository, and states plainly what the repository does not prove.

A correction belongs at the top, because the title makes a promise the code phrases differently. The repository contains no beat sheet, no three-act template, and no named story beats anywhere in its types or prompts. What the code actually constrains each chapter with is a summary plus three to five key events, fixed before any prose exists — those key events are the closest thing to beats in this system, and the rest of this post uses the word in that strict sense only.

The Experiment, Stated Plainly

The question the design tests is narrow: does an AI story hold together better when generation is forced through a fixed outline, instead of being prompted once and left to improvise. StoryGen encodes the outline-first side in a seven-step interface, defined in src/pages/Index.tsx and the step components under src/components/steps/. The free-form side exists only as the default way people prompt a model — the repository ships no control run, no scoring, and no sample book.

Everything structural lives in four TypeScript types in src/types/book.ts: a book setup, a story idea, an environment, and a chapter with a number, title, summary, target word count, optional key events, and optional content. Generation is delegated to the Pollinations text and image APIs from src/utils/pollinations.ts, and progress persists in browser local storage. The stack is React 18, Vite, TypeScript, and Tailwind CSS, under the MIT license.

TL;DR

  • StoryGen is a React and Vite web app that generates a book outline-first: setup, three candidate ideas, three candidate environments, a chapter outline, then prose
  • Each chapter is constrained before writing by a two-to-three-sentence summary, three to five key events, and a target word count — the system's only approximation of beats
  • Chapter count is derived, not chosen: pages divided by 15, rounded up, with about 250 words per page spread across the chapters
  • Text and cover art come from the Pollinations APIs; the finished book assembles into PDF, HTML, or plain text inside the app
  • The repository contains no sample outputs, no evaluation, and no releases — whether outline-first beats free-form prompting remains unproven
  • Last push recorded by the GitHub API: May 14, 2026; the experiment is documented, not concluded

Seven Steps, Outline First

The flow opens with InitialSetup, where the reader supplies an idea, a tone, a genre, and a page target that defaults to 100 pages. StoryIdeas then asks the text API for three candidate ideas in a fixed shape: title, one-sentence logline, target audience, four to five key elements, and a short description. One idea is selected before anything else happens, which is the first structural decision the design forces.

EnvironmentSelection repeats the pattern for the world: three candidate environments, each with a name, a description, four to six key features, an atmosphere, and a visual description that also feeds the generated imagery. ChapterOutline is where the book skeleton is fixed — chapter count, titles, summaries, key events, and word targets, all generated in one pass and shown for review before prose. ManuscriptGeneration writes the chapters in sequence, CoverArt generates a cover image from the idea and the environment visual description, and BookAssembly exports the finished book as a PDF built with jsPDF, or as HTML or plain text.

The assembly step is more complete than a bare download button. The PDF generator in src/utils/pdfGenerator.ts builds an A4 book with a cover page, a contents page, an acknowledgements page, and a generated illustration at the head of each chapter — a readable artifact, not a chat transcript.

Where the Beats Actually Live

The outline prompt in src/utils/pollinations.ts does the arithmetic openly. Chapters are the page target divided by 15 and rounded up, and words per chapter are the page target times 250, divided across those chapters — so the default 100-page setup yields seven chapters of about 3,571 words each. Every chapter request returns a summary of two to three sentences and three to five key events, and those fields are stored on the chapter object itself.

The chapter-writing prompt then receives the chapter title, the setting, the tone, the target word count, the summary, and the key events as an explicit list of events to include. Continuity gets one deliberate, thin thread: the generator also passes the ending of the previous chapter, cut to its last 200 characters in ManuscriptGeneration.tsx. The prose model is therefore never writing blind — it writes to a contract — but the contract is an outline contract, not a dramatic one, and nothing in the prompts names a midpoint, a climax, or a turn.

Where It Falls Short

The honest answer: this is a well-structured generation pipeline wearing an experiment title it has not yet earned with evidence.

  • There are no results. The repository holds no generated sample book, no output files, no reader feedback, and no comparison against a free-form baseline, and the GitHub API records no releases at all. Any claim that outline-first output reads better would be invented, so this post makes none.
  • The structure is shallower than the pitch. Key events per chapter are a real constraint, but they are not a beat sheet: no act structure, no pacing curve, and no tension targets exist in the types or the prompts. A chapter can hit all five key events and still drift.
  • Continuity rests on 200 characters. Passing only the tail of the previous chapter keeps prompts small, and it also means names, promises, and subplots from earlier chapters reach the writer only through the outline summaries. Long-range consistency is the known weak point of this design.
  • Generation is an external dependency. Text and images come from the Pollinations APIs, the text calls carry a model field set to openai and a freshly randomised seed on every request, and no API key handling appears in the client code. Random seeds make runs hard to reproduce, which is a poor property for an experiment that wants comparing.
  • The README undersells and underdocuments. It describes a fast, responsive interface in general terms and never mentions the outline pipeline, the chapter arithmetic, or the export formats — everything specific here came from the code. The repository was also last pushed in May 2026, so treat it as a documented prototype, not a maintained product.

The Verdict

StoryGen is best read as a hypothesis with a user interface: that constraining a model with a fixed chapter outline — summaries, key events, and word targets settled before prose — produces a more coherent book than a single open prompt. The pipeline in the code genuinely implements that hypothesis end to end, from premise to a typeset PDF. What it has never done, in anything the repository records, is test it.

The honest next step is also the obvious one: run the same premise both ways, publish both outputs, and let readers judge the middles. Until that run exists, StoryGen belongs on the experiment shelf next to structured pipelines like SupoClip, and its inputs pair with the MarkItDown workflow for getting material into a model. The rest of the shelf lives on the projects page.

---

Not affiliated with Pollinations. Sources: StoryGen GitHub repository, including its README, src/types/book.ts, src/utils/pollinations.ts, src/utils/pdfGenerator.ts, src/pages/Index.tsx, the step components under src/components/steps/, and the GitHub API record for the repository.

ansaribilal.com — technology, tested in public.