Skip to main content

Loading…

Skip to main content
HomeProjectsPostsContact
Justin Tsugranes LogoJustin Tsugranes Logo

Justin Tsugranes

HomeProjectsPostsContact

Stay in the loop

Occasional notes on what I'm building, lessons earned, and the studio behind it.

By subscribing, you agree to receive No spam. Unsubscribe in one click anytime. from Justin Tsugranes. No spam. Unsubscribe anytime. Privacy Policy

© 2026 Total Ventures LLC. All rights reserved.

Privacy PolicyTerms of ServiceCookie Policy
Building an AI Story App: The Systems Behind Inky | Justin Tsugranes | Justin Tsugranes
Xinf
Building an AI Story App: The Systems Behind Inky
←Posts

Building & Operating

Building an AI Story App: The Systems Behind Inky

A technical breakdown of building an AI story app. I cover agentic engineering, narrative state management, and the lessons learned from shipping Inky.

Justin Tsugranes·May 11, 2026·4 min read
On this page
  1. The Shift from Prompts to Agentic Engineering
  2. Managing Narrative State Across Long Contexts
  3. The Media Pipeline: Beyond Text
  4. What I Learned the Hard Way
  5. Shipping Today

Building an AI story app is often framed as a prompt engineering exercise. It isn't. If you are building a system that generates a cohesive, multi-chapter narrative with consistent characters and visual assets, you aren't writing prompts—you are architecting a state machine.

I am currently building Inky, a multi-product studio project designed to handle long-form storytelling. The goal was to move past the 'chatbot' interface and create a system that functions as a production house. This required moving away from simple API calls and toward what I call agentic engineering.

Here is the architecture, the stack, and the lessons I learned the hard way while shipping today.

The Shift from Prompts to Agentic Engineering

When you start building an AI story app, the temptation is to send a massive prompt to Claude or GPT-4 and ask for a story. This works for a few paragraphs. It fails for a book. The context window drifts, the narrative arc flattens, and the 'AI voice' becomes repetitive.

Inky uses VERA, my custom agent orchestration layer, to break the production into discrete roles. Instead of one prompt, the system runs a sequence of specialized agents:

  1. The Architect: Defines the narrative arc, themes, and world-building constraints.
  1. The Casting Director: Generates detailed character descriptions and visual 'seeds' to ensure consistency across chapters.
  1. The Scribe: Writes the actual prose, one scene at a time, constrained by the Architect’s outline.
  1. The Continuity Editor: Reviews the output against the global state to ensure a character who lost a sword in Chapter 2 doesn't suddenly have it in Chapter 4.

This modularity allows me to swap models based on the task. I might use Claude 3.5 Sonnet for the prose because of its nuance, but use a faster, cheaper model for the initial structural outlining. By treating AI as the team rather than a single oracle, the system becomes resilient.

Managing Narrative State Across Long Contexts

Consistency is the primary friction point when building an AI story app. If the reader is ten chapters deep, the system must remember the emotional weight of a previous scene without re-sending the entire book text in every API call—which is both expensive and prone to noise.

I solved this by implementing a 'Narrative Ledger.' This is a structured JSON object stored in a Postgres database that tracks:

  • Character State: Current location, inventory, and relationship status.
  • Plot Points: Resolved vs. unresolved threads.
  • Visual Anchors: Specific physical descriptions used to generate consistent image prompts.

Before the Scribe agent writes a single word, the system queries the Ledger for the relevant context. This keeps the prompt size down and the focus sharp. I learned the hard way that relying on the LLM's 'memory' is a recipe for hallucinations. The database is the source of truth; the LLM is just the processor.

Keep reading

Related posts

All posts→
EditorialB
Jun 5, 2026

Building an AI Story App: Systems Over Hype

A look inside the architecture of Inky, an AI storytelling app. No buzzwords, just the systems and agentic engineering required to ship a durable product.

aiengineeringsystems-architecture

The Media Pipeline: Beyond Text

Inky isn't just text. It’s a visual and auditory experience. Integrating image generation (Stable Diffusion via Replicate) and audio synthesis (ElevenLabs) into the workflow introduced a new set of engineering challenges.

To keep characters looking the same, the Casting Director agent generates a 'Visual DNA' string for each character. This string is prepended to every image generation prompt. I also implemented a feedback loop where the system analyzes the generated image to ensure it matches the DNA. If the hair color is wrong, the system catches it before the user does.

For audio, the challenge was latency. Generating high-quality narration for a 2,000-word chapter can take 30 seconds. I moved this to an asynchronous worker pattern. The text is generated, the user starts reading, and the audio is streamed in chunks as it becomes available. Shipping today means managing user expectations around the 'wait time' inherent in heavy inference tasks.

What I Learned the Hard Way

I’ve spent my career building systems—from Army logistics to e-commerce platforms with 8,000 SKUs. Software is just another dialect of that same impulse. Here are the specific technical lessons from the Inky build:

  • Rate limits are the real ceiling: When you have four agents calling APIs simultaneously for a single user request, you hit tier limits fast. I had to build a robust queuing system to prevent the entire app from locking up during peak usage.
  • Structured output is non-negotiable: Never ask an LLM for 'a story.' Ask for a JSON object with keys for \prose\, \visual_prompt\, and \state_updates\. It makes the downstream integration much cleaner.
  • The 'AI' is 20% of the code: The other 80% is standard, boring, reliable engineering. Auth, database migrations, error handling, and UI state. Don't get so caught up in the model that you forget to build a good app.

Shipping Today

Inky is currently running in a private beta. It isn't a 'paradigm shift' or a 'game-changer.' It is a tool for people who want to build worlds. By treating AI as an operating layer rather than a magic wand, I’ve been able to build a system that produces consistent, high-quality results without a massive team.

If you are building an AI story app, stop focusing on the prompts and start focusing on the state. The value isn't in the model you use—it's in the system you architect around it.

I’m working in public on this and other studio products. If you want to see the specific implementation details of the VERA orchestration layer, I’ve documented the process in my resources.

Happy to talk.

Full implementation in The Builder's Playbook — justintsugranes.dev/resources/builders-playbook

Recommended$79

The Builder’s Playbook

How I run a multi-brand studio with AI agents — the systems, not the hype.

  • •The agent-augmented operating model
  • •Real workflows you can copy
  • •From idea to shipped, repeatably
Get the playbook →
If this resonated

The studio is where the rest of it lives.

Total Ventures is the umbrella — the products, the resources, the strategy session.

totalventures.io
  • Resources

    Launch Checklist + the Builder’s Playbook bundle.

  • Strategy session

    A focused hour on your repo, stack, and monetization.

  • The brands

    The portfolio of products I’m building, end to end.

Studio Notes

How I’m building the studio.

The operator’s log — systems, decisions, and what’s working.

JT

Written by

Justin Tsugranes

Founder, Total Ventures

Solo-founder building a multi-brand product studio with AI agents. Writing about building, operating, and shipping.

ShareXLinkedInFacebook
#ai#engineering#inky#systems-architecture

On this page

  1. The Shift from Prompts to Agentic Engineering
  2. Managing Narrative State Across Long Contexts
  3. The Media Pipeline: Beyond Text
  4. What I Learned the Hard Way
  5. Shipping Today
inky
Building an AI Story App: Lessons from Shipping Inky
Jun 7, 2026

Building an AI Story App: Lessons from Shipping Inky

I am building Inky, an AI storytelling app. Here is the architecture, the failures, and the systems required to ship a generative product that actually works.

aiarchitectureinkyshipping
Building an AI Story App: Lessons from the Studio Floor
Jun 6, 2026

Building an AI Story App: Lessons from the Studio Floor

Inside the architecture of Inky. A look at agentic engineering, narrative coherence, and the lessons learned the hard way while building an ai story app.

aiarchitectureagentic-engineeringinky