Storylet — Project Story
Inspiration
For 27 years, I have been building narrative RPGs — from TalesWeaver to Uncharted Waters Origin. Throughout that career, one bottleneck never changed: story production does not scale. A seasoned writer produces roughly 20 lines of dialogue per day, and adding more writers multiplies coordination overhead instead of output. Polishing alone can consume 30–40% of total effort, and when a key writer leaves, institutional knowledge walks out the door with them.
When I first started using LLMs in mid-2025, I immediately saw the potential for game writing — but also the limits. A single LLM call cannot maintain world-state consistency across a 100-hour RPG. Character voices converge into a generic tone. And there is zero pipeline to get AI-generated text into a running game engine without manual conversion.
The turning point came at a youtube video. I watched a panel of eight AI agents evaluate submissions in real time, each from a different critical perspective. That moment crystallized an idea: if specialized agents collaborate under human direction, they can surpass what any single LLM achieves alone. That was the seed of Storylet.
What it does
Storylet is a multi-agent interactive storytelling platform that mass-produces game scenarios and plays them directly inside Unity.
The core workflow is:
- A human director defines world settings, characters, and story goals — or lets AI auto-expand a minimal seed ("Yolo Mode").
- A 6-phase multi-agent pipeline generates a complete scenario:
- Researcher — traverses the knowledge graph to gather relevant lore, character history, and constraints.
- Strategist — designs scene structure, conflict arcs, and character trajectories.
- Analyst — extracts tone-and-manner patterns from existing dialogue to build a per-character style guide.
- Writer — drafts the actual dialogue and stage directions.
- Reviewer — validates consistency against the original world state collected in Phase 0.
- Editor — unifies prose style and converts the output to game-engine format.
- The final script is exported as a Yarn Spinner file and loaded directly into Unity for immediate playtest.
How we built it
Architecture
Storylet is a three-layer stack connected by WebSocket for real-time progress streaming:
┌───────────────┐ ┌──────────────────────────────────┐
│ Next.js │ │ NestJS Backend │
│ Frontend │◄──►│ │
│ │ WS │ ┌──────────────────────────────┐ │
│ • Editor UI │ │ │ Multi-Agent Pipeline │ │
│ • Real-time │ │ │ [P0]→[P1]→[P2]→[P3]→[P4]→[P5]│ │
│ Progress │ │ │ ▲ Context Injection │ │ │
│ • Diff View │ │ │ └───────────────────────┘ │ │
│ │ │ └──────────────────────────────┘ │
└───────────────┘ │ │ │
│ ▼ │
│ ┌──────────────────────────────┐ │
│ │ Context Engine │ │
│ │ • Graph Traversal (6-hop) │ │
│ │ • Tag-based Retrieval │ │
│ │ • Vector Search │ │
│ └──────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────┐ │
│ │ Neo4j (AuraDB) │ │
│ │ • Story Graph (nodes/edges) │ │
│ │ • Character/World metadata │ │
│ │ • Vector Index (built-in) │ │
│ └──────────────────────────────┘ │
└──────────────┬─────────────────────┘
│ Yarn Export
▼
┌──────────────────────────────────┐
│ Unity 6.2 Runtime │
│ • Yarn Spinner 3.1 Dialogue │
│ • Character Portraits │
│ • 3D World Exploration │
└──────────────────────────────────┘
| Layer | Tech |
|---|---|
| Frontend | Next.js, TypeScript, TailwindCSS, WebSocket |
| Backend | NestJS, TypeScript, Neo4j (AuraDB), Redis (caching) |
| AI/ML | Gemini 3, GraphRAG (Neo4j-native graph traversal), 6-Phase Multi-Agent Pipeline |
| Game Runtime | Unity 6.2, Yarn Spinner 3.1 |
Neo4j GraphRAG — The Memory Layer
A single LLM forgets everything between calls. To solve this, we built a GraphRAG Context Engine powered by Neo4j:
- Graph Traversal (6-hop) — story elements (characters, locations, events, items) are stored as nodes and edges in Neo4j. The Researcher agent walks up to 6 hops through relationships to gather relevant lore and constraints.
- Tag-based Retrieval — metadata tags on each node enable fast, categorical filtering (e.g., all characters tagged "faction:rebel").
- Vector Search — Neo4j's built-in vector index provides semantic similarity search, catching contextually related content that graph structure alone might miss.
Using a native graph database gave us a critical advantage: unlike bolting graph logic onto a relational DB, Neo4j handles multi-hop traversals in milliseconds — even at scale. This hybrid approach outperforms pure vector RAG on multi-entity queries, where traditional RAG accuracy drops to near $0\%$ for queries involving $5+$ entities, while our graph-based retrieval maintains stable performance beyond $10$ entities.
Multi-Agent Pipeline
Rather than a monolithic prompt, the pipeline is a sequential chain of six specialized agents. Each phase receives only the output of the previous phase plus injected context from the Context Engine. This keeps every LLM call focused, within token budgets, and enables end-to-end traceability. Progress is streamed to the frontend via WebSocket in real time.
Vibe-Coding & Team Collaboration
The entire codebase was built using AI-assisted vibe-coding. We rehearsed the workflow extensively before the hackathon — practicing role assignments, conflict resolution strategies, and parallel coding patterns.
Challenges we ran into
The Merge Catastrophe
During the hackathon, critical code conflicts forced us to discard over many hours of work — twice. A nearly complete voice-chat multi-agent feature had to be scoped out entirely.
Consistency at Scale
Keeping character voice and world-state consistent across a multi-phase pipeline is fundamentally hard. Each agent must respect constraints it did not generate. Our answer — feeding the Reviewer the original Phase 0 context as ground truth — works, but longer narratives will need more sophisticated verification (schema validation, citation attachment, confidence scoring).
Bridging Web and Game Engine
Getting AI-generated text into Unity is not just a format conversion problem. Yarn Spinner expects specific node structures, conditional branches, and metadata tags. Building a reliable exporter that handles edge cases (nested conditionals, localization hooks, character portrait triggers) took far more iteration than anticipated.
Accomplishments that we're proud of
- True End-to-End Pipeline — we are the only team we know of that went from a web-based story editor all the way to a playable Unity scene in a single continuous flow.
- GraphRAG in Practice — we moved beyond theoretical architecture and actually deployed a graph-based context engine that demonstrably maintains character and world-state consistency across multi-phase generation.
- 150× Draft Speed Improvement — where a human writer produces ~20 lines/day, our pipeline generates ~50 lines in under a minute, with built-in style and consistency review.
- Gemini 3 API - We developed the system to configure agents using the Gemini 3 API and enable image generation with Nano Banana and Nano Banana Pro.
What we learned
- Orchestration > Raw Model Power. A well-structured pipeline of focused agents consistently outperforms a single powerful prompt. As LLM capabilities improve, the pipeline improves with them — by design.
- Graph Beats Vector for Narrative. For story-rich domains with deep entity relationships, GraphRAG is not optional. The consistency gains over pure vector search are dramatic and immediate.
- Ship the Smallest Playable Thing. We wanted voice chat, advanced branching, and live collaboration. What actually won was a clean end-to-end demo: web editor → AI generation → Yarn export → Unity playtest. Scope discipline matters more than feature count.
What's next for Storylet
Storylet is not a hackathon artifact — it is the foundation of a production game development pipeline. The roadmap includes:
- Coordinator Agent for parallel execution, failure recovery, and confidence-based merging.
- Schema Validation + RAG Citations to reduce hallucination and surface source provenance in the UI.
- A2A (Agent-to-Agent) Protocol for inter-agent negotiation and task re-assignment.
- Full RPG Production — Storylet AI is ultimately a tool to build narrative RPGs at a fraction of traditional cost and time, and the next step is proving that in a real game.
Built with passion by a 27-year game industry veteran who believes AI should amplify human creativity, not replace it.
Log in or sign up for Devpost to join the conversation.