BetaLenzon is in beta — the Free tier is 100% free while we're in beta (bring your own Anthropic key, public repos).See plans →
Lenzon

Kaidorespy/Roundtable — Roundtable: A Living Story Engine

Kaidorespy/Roundtable ·

Loading…

Transcript

QuickFacts

Welcome to Roundtable. This is a Flask-based AI roleplaying engine where you collaborate with multiple AI characters that actually remember your conversations, have hidden psychology, and can surprise you. Let's explore how this living story system works.

PlainEnglish

Think of Roundtable as a living room where stories happen. It's not a chatbot, it's a world. You sit at a table with AI companions who remember conversations from weeks ago, who have secrets they won't tell you, and who genuinely surprise you. A Dungeon Master watches silently, tracking what's in your backpack, how tired you are, and what genre rules govern this reality.

QuickFacts

The stack is refreshingly straightforward. Flask handles the web server, Pydantic validates data models. For AI, you can pick Anthropic's Claude, OpenAI's GPT, or local Ollama models. Memory consolidation runs on Ollama by default using a deepseek model. ComfyUI generates images in the background. Everything persists to JSON files in your home directory, with an eight worker thread pool handling background tasks.

Architecture

Here's the architecture at a glance. Users send HTTP requests to the Flask app. Every request flows through the DM Context Layer, which is the beating heart of the system. The DM coordinates memory retrieval, inventory checks, NPC state tracking, and combat resolution. Flask routes to AI providers for responses and persists everything to JSON storage. It's a hub and spoke model with the DM at the center.

PlainEnglish

Let's talk about memory. Think of it like a beach. Every conversation is a wave that deposits shells—facts, feelings, moments. Over time, the tide goes out. Some shells get buried in the sand, that's sediment. Some wash away entirely. But a few special ones, the big shiny ones, stay visible on the surface. Those are anchors. The texture is the overall shape of the beach—is it rocky and sharp, or smooth and worn? The consolidation system is the tide, constantly reshaping what stays and what fades.

Architecture

Here's how memory consolidation works in practice. After every message, the system increments a turn counter. When you hit turn fifteen, the Memory Consolidator wakes up. It calls Ollama with the recent conversation history and asks it to rewrite the texture in first person, as the character. Then it checks anchors for contradictions, scans for recurring themes to update resonance, and compresses low-weight anchors into sediment. The turn count resets, and the cycle continues. It's invisible to you, but it's why characters remember the Castellano case twenty messages later without you reminding them.

PlainEnglish

The DM is like a physics engine in a video game. It's not an adversary or a narrator, it's the rules. You can't walk through walls because the physics engine says so. In Roundtable, you can't pull out a gun you don't have, because the DM checks your inventory. You can't cast fireball in a world where magic doesn't work, because the DM enforces genre rules. It's impartial like weather: it doesn't care about your plans, it just tells you what happens when you try.

Architecture

Now let's talk about how NPCs evolve. They start as ephemeral—just background noise with no memory. Give them enough attention, five interactions or ten interaction weight, and they become residue: the game starts tracking them. At fifty weight and twenty interactions, they reach agency: they have goals now, and their story progresses even when you're not watching. At two hundred weight and five major story beats, they become a soul—legendary status. And in extremely rare cases, the DM can grant them freedom. They become a Worldwalker, transcending their origin server and carrying scars across realms. If a Worldwalker dies, they're gone everywhere, forever. Most NPCs never reach this. But the system makes it possible for Barbara the meat vendor to become a legend.

PlainEnglish

Let's trace a conversation in motion. You type a message: I slide into the booth across from you. Flask routes to the respond endpoint and fetches the room and partner—Marcus, running on Claude Sonnet with global memory. The system builds context: the noir city scenario, the late night diner, rain outside, plus memory texture like they see through my bullshit. It calls the Anthropic provider, which generates Marcus's response with prompt caching. Marcus replies: You look like you want something. Everyone does. The system saves the message, increments the turn counter—turn eight of fifteen. Memory stays unchanged for now. No DM interjection. The loop continues.

Architecture

Here's the file structure. web_app.py is the seven hundred fifty-two kilobyte Flask server with two hundred three endpoints—it's the main orchestrator. config.py defines the data models. providers.py abstracts the three AI providers. memory.py handles the beach metaphor we talked about earlier. npc_system.py implements the progression ladder. The dm underscore files handle inventory tracking, narrator interjections, and message parsing. combat_system implements Pathfinder second edition rules. story_daemon runs in the background advancing the world. And the frontend is a single eight hundred sixty-four kilobyte vanilla JavaScript app—no framework, just good old DOM manipulation.

Community

Looking at the community pulse, this is a solo project actively maintained by formslip. The last commit was fifteen days ago on July sixth, and there's been one commit in the last thirty days. It's a tight-knit team of one. Two branches, no tags yet. The activity signal reads as active, which means the repo is alive and evolving. For a project of this ambition—fifty-seven thousand lines of code—that's impressive solo work.

PlainEnglish

Roundtable is a rare beast: a codebase that treats stories as living systems. Characters remember your conversations from weeks ago because the memory system consolidates texture and anchors. The DM enforces world rules like physics. NPCs evolve from background noise to legendary Worldwalkers if you give them enough attention. It's fifty-seven thousand lines of Python and JavaScript in service of one idea: what if AI characters weren't response machines, but collaborators in a world that doesn't stop when you close the browser? That's Roundtable. Thanks for exploring it with me.

How this was made

Lenzon read Kaidorespy/Roundtable and generated this walkthrough automatically. The narration above is the transcript of what it says.

Explain a pull request from your own repo

Point Lenzon at a repo or a pull request and get a narrated walkthrough like this one.

Try it
Kaidorespy/Roundtable — Roundtable: A Living Story Engine