Building a real-time AI RPG with evolving narratives using LLMs

I’ve been working on an AI-powered RPG where the story evolves in real-time based on player choices. The goal was to combine traditional RPG mechanics (HP, XP, inventory, progression) with dynamic LLM-generated narratives.

Some of the interesting challenges we ran into:

  • Maintaining story consistency across long sessions

  • Preventing narrative drift when users take unexpected actions

  • Managing structured game state alongside free-form text

  • Handling token limits for multi-turn storytelling

Approach:

  • Using layered prompts (system + state injection)

  • Summarizing past events to maintain continuity

  • Separating narrative generation from game logic

  • Tracking player state externally instead of relying on the model

Still experimenting with improving coherence over long sessions and reducing repetition.

Would be interested to hear how others are handling:

  • Long-term memory in interactive apps

  • Narrative consistency in branching flows

  • Cost vs quality trade-offs for real-time generation

We also opened a small beta if anyone wants to test the experience:

Hi Zack! I hope you are well.

I am a journalism master’s student at Univiersity of the Arts London, and I am currently working on an article about AI RPGs and immersive experiences. I would love to get your perspective as a person who has made an AI-powered RPG (more specifically, on the technical side and what makes these experiences so compelling for users). If you’re open to it, I’d love to have a quick chat with you about your development process and where you think the whole space is headed.

Looking forward to hearing from you!