Storia - AI agents that write complete novels
A multi-step agent system that takes a brief and generates an entire novel while keeping plot and character continuity across hundreds of pages.

Storia
The real problem isn't generating text
Why the obvious approach doesn't work
- It doesn't fit. A novel exceeds any context window. That's the obvious limitation.
- Even if it fit, it wouldn't help. Burying the relevant fact under 200 pages of noise degrades the model's attention rather than improving it. More context is not more memory - past a point, it's less signal.
The decision: separate planning, writing and remembering
- Planner agent - turns the brief into a hierarchical outline (act → chapter → scene). Structure is decided before a single line is written, so global coherence is a design constraint rather than something you hope will emerge.
- Writer agent - expands each scene preserving style and continuity. It never sees the whole book: it sees its scene and the context it needs.
- Editor agent - reviews continuity, pacing and character consistency across what's been written.
- Memory layer - pgvector stores embeddings of previous chapters. Before writing, the writer retrieves the relevant fragments instead of receiving everything.
The stack
- Next.js 15 with App Router and Server Actions
- Mastra to orchestrate the multi-step agents
- Vercel AI SDK for streaming and tool calls
- pgvector + Supabase for semantic memory across chapters
- OpenAI and Anthropic as primary providers