← All projects

Gambit

ongoing

An AI game master that runs real tabletop campaigns over Discord, Telegram, and the browser.

Why it exists

I wanted to see if an AI could actually run a campaign, not just wear a fantasy skin over a chatbot. Most AI game masters forget the rules the moment a player pushes on them. Gambit keeps a real, deterministic engine underneath every scene: the model proposes what happens next, and it only happens if the engine's own rules allow it.

Features

Say anything, the world only bends so far

Type what your character does in plain language. An underlying command engine holds every entity, location, and fact; the model proposes a move, and it only lands if the engine's own rules allow it, so the story can't be talked into breaking its own state.

Companions with agendas of their own

Party members track their own trust in you, hold a hidden agenda that can conflict with what they say out loud, and whisper to each other behind your back. Every whisper carries a real chance of being overheard, and getting caught costs a companion your trust.

Nothing reaches you unchecked

Every line of narration and every generated scene image passes through a review step before you see it. If that check ever fails to run, the content is blocked rather than shown anyway. Same fail-closed rule as the rules engine itself.

Play it wherever you already talk

The same engine runs behind a Discord bot, a Telegram bot, and a plain browser chat: one save file, one campaign, reachable from whichever app you have open.

A budget, not a blank cheque

Each campaign has a shared pool of turns it can spend, so a session can't quietly run up an unlimited AI bill. The pool is enforced across every device playing that campaign at once, not just on your own screen.

Why I built it

I’ve wanted an AI game master since long before the current wave of chatbots made it look easy. The hard part was never getting a model to write decent fantasy prose. It’s getting it to remember what happened three scenes ago, refuse a player who tries to talk their way past a locked door with sheer confidence, and not quietly drift off the rails once a session runs long. Most attempts I’d seen solve this by not really trying: a system prompt wearing a genre skin, no real state underneath it. I wanted to build the version that holds up over a full campaign, not just a good first ten minutes. The name is what’s left of “Gambit” once you drop the vowels, which also happens to be the bot’s actual command prefix.

What I worked on

The core decision was to keep two systems that don’t trust each other: a small, deterministic game engine that tracks entities, health, a knowledge graph of facts and rumors, and a trust ledger between the player and their companions, and a language model that only ever proposes moves against it. Every message a player sends goes through a translation step that turns free text into one of a fixed set of engine commands. If the model proposes something the engine’s own rules reject, the move fails and the story adapts around that, the same way a real game master would say no instead of letting you cheat.

> confront the merchant about the missing shipment

The Ashgate Docks — Warehouse 3

You corner Torvin Sael between two shipping crates. His practiced smile doesn't
quite recover in time. "Missing? No, no, I assure you, everything's accounted for."
Mira, standing just behind you, says nothing. You catch her glance flick to the
ledger in Torvin's coat pocket a beat too long.

[Mira's trust in you: 58 → 58]

Companions took the most iteration. Early versions just followed instructions, which made them furniture. What made them interesting was giving each one a hidden agenda that can genuinely conflict with what they say to your face, and a private channel where they whisper to each other about it. There’s a real, seeded chance a whisper gets overheard, not a scripted event but an actual roll every time one happens, and getting caught changes how much that companion trusts you afterward.

Every generated line of story, and every generated scene image, goes through a separate review pass before it reaches the player, and that pass fails closed: if it can’t run at all, the output is blocked rather than shown anyway. That mattered more once the bot went live for actual play over Telegram this week, the first time any of it ran against a real player instead of a test script, racking up a real bill against a real campaign budget instead of a mocked one. Three genre presets ship today: grimdark fantasy, cosmic horror, and cyberpunk espionage, each with its own tone and its own tolerance for how far a companion is willing to bend the truth.