How AI Generation Works
The end-to-end flow from clicking Write to seeing prose appear.
Last updated March 2026
The Big Picture
When you click Write or Continue, Genesis Writer doesn't just fire off your text to an AI model and hope for the best. There's a carefully orchestrated pipeline that collects context about your story, reserves tokens from your balance, streams the response in real time, and gives you full control over what stays and what goes.
Understanding this flow helps you get better results, because every step is designed to give the AI the most relevant information about your story.

The generation pipeline — from button click to finished prose
Step 1: You Click Write
Everything starts when you click Write (generate new prose at the end of your draft) or Continue (extend from where your text left off). You can also use keyboard shortcuts — see Keyboard Shortcuts for the full list.
At this moment, Genesis Writer captures the current text formatting at the cursor position — font, size, alignment, styles — so the generated text matches what you've already written. It also places an invisible AI marker in the editor at the end of your content. This marker is the target where streamed text will appear.
Step 2: Context Building
Before anything reaches the AI model, Genesis Writer assembles a rich context package about your story. This is what separates it from pasting text into a generic chatbot — the AI understands your characters, your world, and your story structure.
The context builder collects:
- Document hierarchy — the content of parent and sibling nodes in your project tree (automatically trimmed to stay within model limits).
- Story Bible entries — characters, locations, worldbuilding, and draft summaries that are automatically matched to your current scene using a multi-signal scoring system.
- Character context — rich character data including biography, voice profile, and personality analysis.
- Project metadata — your genre, tone, themes, and logline, so the AI writes in the right register.
- Writing style instructions — if you've selected a writing style, its instructions are applied to shape the output's vocabulary, rhythm, and tone.
Step 3: Token Reservation
Before the AI starts generating, Genesis Writer reserves tokens from your balance. This is a hold, not a charge — think of it like a hotel putting a hold on your credit card at check-in.
The reservation system works like this:
- Tokens are reserved based on the estimated maximum output for your chosen model.
- If something goes wrong (network drops, browser crash), the hold automatically expires and your tokens come back.
- When you click Keep, the actual token cost is calculated from what the AI generated (usually less than the reservation), and only that amount is deducted. The rest is released.
- When you click Discard or Stop, the entire reservation is refunded. You pay nothing.
Step 4: Streaming
Genesis Writer streams the AI's response in real time. Instead of waiting for the entire response to finish, you see text appear as the model generates it.
This works reliably even with longer generations from slower models like Claude 4.6 Opus or Grok 4 that think before they write.
You can stop generation at any time by clicking the Stop button in the Inline Generation Toolbar or pressing Escape. You'll keep everything that's been generated so far, and only pay for the tokens used up to that point.
Step 5: Character Reveal Animation
As text streams in from the AI, you see a smooth character-by-character reveal animation. Characters appear with a slight fade-in effect, making the generation feel natural and readable rather than jarring.
The animation is designed to stay smooth even during long generations. The editor syncs once generation completes.
Step 6: Auto-Scroll
As generated text extends beyond the visible area, the editor automatically scrolls to follow the new content. This keeps you reading along as the AI writes.
If you want to scroll up to review earlier text while generation continues, just use your mouse wheel or trackpad. Genesis Writer detects genuine user scrolling (via wheel and touch events) and pauses auto-scroll so you can read freely. When generation finishes or you scroll back to the bottom, auto-scroll resumes.
Step 7: Keep or Discard
When generation finishes (or you stop it early), the Inline Generation Toolbar appears with three options:
- Keep — accepts the generated text. It becomes part of your document, and the actual token cost is finalized (deducted from your balance).
- Discard — removes all generated text. Your document returns to its state before generation. The token reservation is fully refunded.
- Stop (during generation) — halts the stream. You can then Keep or Discard what was generated so far.

The inline generation toolbar appears after AI text is generated
This Keep/Discard pattern means you never pay for text you don't want. If the AI takes a wrong turn, just discard and try again with a different model, style, or approach.
Truncation Warnings
Every AI model has a maximum output length (measured in tokens). If a generation hits that limit before the AI naturally finishes, the text gets truncated. When this happens, you'll see a yellow warning bar letting you know the output was cut short.
You can still Keep the truncated result — it's perfectly usable, just incomplete. To continue from where it stopped, click Continue to pick up the narrative thread.
How Selection Tools Differ
The pipeline described above applies to Write and Continue, which append text at the end of your document. Selection tools work differently:
- Rewrite, Expand, Describe, and Plugins operate on selected text. You highlight a passage, run the tool, and the result replaces or augments your selection.
- There's no “placement mode” — the output goes exactly where your selection is.
- The same Keep/Discard toolbar appears, and the same token reservation system applies.
For a full walkthrough of selection tools, see Selection Tools.
What Happens Behind the Scenes
When you click Write, the server performs several checks before generation begins: authentication, token balance verification, content safety validation, context assembly, style application, and token reservation. Then the AI generates your text via streaming. When you click Keep, you're charged for the actual output; when you Discard, your tokens are fully refunded.
All of this happens in milliseconds (for the setup) to seconds (for the generation itself). The system is designed so you never have to think about any of it — just click Write and start reading.
Next, learn how to pick the right model for your writing in Choosing a Model.