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: A Systems Engineering Approach | Justin Tsugranes | Justin Tsugranes
Xinf
Building an AI Story App: A Systems Engineering Approach
←Posts

Building & Operating

Building an AI Story App: A Systems Engineering Approach

Stop building wrappers. Learn the architectural patterns for building an AI story app that maintains continuity and depth using agentic engineering and state management.

Justin Tsugranes·June 4, 2026·4 min read
On this page
  1. The Wrapper Trap and Why It Fails
  2. Agentic Engineering: The Narrative Engine
  3. The Lorebook Agent
  4. The Continuity Agent
  5. The Prose Architect
  6. The Stack: Monorepos and Agent Orchestration
  7. Lessons Learned the Hard Way
  8. Shipping Today

I am currently shipping Inky, an AI-driven storytelling platform. Most people think building an AI story app is a matter of writing a clever prompt and wrapping it in a UI. I learned the hard way that this approach fails the moment a story moves past the third chapter.

When you are building an AI story app, you aren't just managing text generation; you are managing state, memory, and narrative logic across a distributed system of agents. This is a report from the trenches on how I architected Inky to handle the complexity that simple wrappers cannot touch.

The Wrapper Trap and Why It Fails

If you send a 5,000-word story to a Large Language Model (LLM) and ask it to write the next scene, it will likely hallucinate, forget that a character died in chapter two, or lose the specific tone you established. This is the 'wrapper trap.'

In the early stages of building Inky, I tried the monolithic prompt approach. It was fast to prototype but impossible to scale. The context window is a finite resource, and even with 128k or 200k tokens, the model's 'attention' degrades. To build something durable, you have to stop thinking like an author and start thinking like a systems architect.

Agentic Engineering: The Narrative Engine

Instead of one prompt, Inky uses a system I call agentic engineering. I’ve built a custom orchestration layer, VERA, to manage how different agents interact with the story data.

In this architecture, the work is decomposed into specific roles:

The Lorebook Agent

This agent doesn't write prose. Its only job is to extract entities—characters, locations, and items—from every generated scene and update a structured database. When you are building an AI story app, your 'source of truth' shouldn't be the chat history; it should be a structured 'Lorebook' that the generator can query.

The Continuity Agent

This agent acts as a linter for the narrative. Before a scene is finalized, the Continuity Agent compares the draft against the Lorebook. If the draft says a character is holding a sword that was lost three scenes ago, the agent flags the inconsistency and triggers a rewrite. This is how you maintain a coherent world without manual intervention.

The Prose Architect

Only after the facts are verified does the Prose Architect generate the final text. It receives a 'context packet' containing the verified facts, the current character motivations, and the specific stylistic constraints. This separation of concerns ensures that the creative layer isn't burdened with remembering the logistics of the plot.

Keep reading

Related posts

All posts→
Building an AI Story App: Architecture and Lessons from Inky
Jun 3, 2026

Building an AI Story App: Architecture and Lessons from Inky

A look inside the architecture of Inky. No hype, just the systems and agentic engineering used to ship a multi-modal storytelling platform as a solo operator.

AIArchitectureInkyEngineering

The Stack: Monorepos and Agent Orchestration

I run a multi-product studio as a solo operator, which means my stack has to be optimized for speed and maintainability. For Inky, I use a monorepo architecture. This allows me to share types between the narrative engine, the frontend, and the background workers that handle long-running generation tasks.

I don't use heavy frameworks for agent orchestration. I built VERA to be a lean, event-driven system. When a user requests a new chapter, it triggers a sequence of events across my agent pool. This is all managed via a central state machine. If the Lorebook update fails, the Prose Architect never starts. This prevents the system from 'hallucinating forward' on top of bad data.

Lessons Learned the Hard Way

One of the biggest hurdles in building an AI story app is the cost-to-quality ratio. Using the most capable models for every task is a fast way to burn through your margins.

I learned that you don't need a frontier model to extract entities for the Lorebook. A smaller, faster model can handle structured data extraction with high reliability if the schema is well-defined. I save the high-parameter models for the final prose generation where nuance and 'voice' actually matter.

Another lesson: never trust the LLM to manage its own memory. You must build the memory management system yourself. In Inky, I use a combination of vector embeddings for 'semantic memory' (finding related past events) and a relational database for 'factual memory' (who is where and what do they have).

Shipping Today

Inky is not a theoretical project; it is a system I am shipping today. The goal isn't to replace the writer, but to provide a system where the 'AI as the team' handles the heavy lifting of narrative consistency, allowing the user to focus on the high-level direction.

Building in public means showing the plumbing, not just the finished house. The architecture of Inky is a reflection of my broader philosophy: build small, build durable, and let the system do the work.

If you are interested in the specific patterns I use to manage these agentic workflows, I have documented the entire process.

Full implementation in The Builder's Playbook — totalventures.io/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 Wrapper Trap and Why It Fails
  2. Agentic Engineering: The Narrative Engine
  3. The Lorebook Agent
  4. The Continuity Agent
  5. The Prose Architect
  6. The Stack: Monorepos and Agent Orchestration
  7. Lessons Learned the Hard Way
  8. Shipping Today
Building an AI Story App: Architecture and Lessons from Inky
May 21, 2026

Building an AI Story App: Architecture and Lessons from Inky

A look inside the architecture of Inky. I’m sharing how I’m building an AI story app using agentic engineering and a multi-product studio mindset.

AIArchitectureEngineeringInky
Building an AI Story App: Architecture and Lessons from Inky
May 27, 2026

Building an AI Story App: Architecture and Lessons from Inky

A look inside the architecture of Inky. I'm sharing what I learned the hard way about building an AI story app using agentic engineering and a multi-product studio model.

AIArchitectureInkyAgentic Engineering