GitHub - yeme-oss/quatuor_ai: AI conversation simulator: 4 AI characters talk autonomously, orchestrated by an invisible Director agent

4 min read Original article โ†—

๐ŸŽญ QUATUOR

Four AI characters. One invisible director. Zero human intervention.

An autonomous conversation simulator where four AI personas debate, adventure and interrupt each other in real time โ€” while you sit back and watch.

Vanilla JS Vite OpenRouter Languages


A D&D party negotiating with an ancient red dragon

The party meets an ancient red dragon โ€” the Game Master sets the scene, and the three adventurers argue their way out, each true to their own personality.

What is it?

Quatuor stages a live group conversation between four AI characters, each driven by its own system prompt. You pick a scenario, press Start, and the loop runs forever:

  1. ๐ŸŽฌ An invisible fifth agent โ€” the Director โ€” reads the transcript and decides who speaks next, and whether they speak normally or cut someone off mid-sentence.
  2. ๐Ÿ—ฃ๏ธ The chosen character receives the shared transcript and improvises its next line, in character.
  3. ๐Ÿ” The message lands in the chat, and the Director is consulted again. Forever.

There is no user turn. You're the audience โ€” like overhearing a tabletop session or a podcast that writes itself.

flowchart LR
    T[(Shared transcript)] --> D{{๐ŸŽฌ Director}}
    D -- "next_speaker + continue/interrupt" --> C[๐Ÿ—ฃ๏ธ Character LLM call]
    C -- new line --> T
Loading

Under the hood it's one single LLM called N times with different system prompts โ€” no persistent sessions, just a shared transcript replayed to whoever speaks next. If the Director ever fails to answer valid JSON, a round-robin fallback keeps the show running.

Scenarios

Three presets ship out of the box, each with four hand-tuned personas:

Scenario Cast
โš”๏ธ Tabletop RPG (D&D) Game Master ๐Ÿง™โ€โ™‚๏ธ ยท Elara the paranoid mage ๐Ÿงโ€โ™€๏ธ ยท Kaelen the impulsive warrior โš”๏ธ ยท Lyra the mischievous rogue ๐Ÿ—ก๏ธ
๐Ÿฆ‡ Vampire: The Masquerade Storyteller ๐Ÿฆ‡ ยท Victoria the Ventrue schemer ๐Ÿท ยท Dante the Brujah hothead ๐Ÿ”ฅ ยท Luna the Malkavian seer ๐Ÿƒ
๐ŸŽ™๏ธ Podcast Debate Arthur the skeptic ๐Ÿคจ ยท Beatrice the optimist โœจ ยท Charles the technophile ๐Ÿค“ ยท Diana the everywoman ๐ŸŽ™๏ธ

The Vampire: The Masquerade scenario โ€” the coterie investigates a Masquerade breach

The Prince has summoned the coterie to Elysium: a leaked video threatens the Masquerade. Victoria wants leverage, Dante wants to shake down cops, and Luna speaks in riddles that turn out to be right.

Every persona is written with an anti-stagnation rule: characters must react to consequences, never repeat a failed action, and keep the story moving instead of looping.

Quick start

No Node installed? Grab quatuor.exe from the latest release โ€” run it, and it opens in your browser. Put your OpenRouter key in a .env file next to the exe (or paste it in the app's sidebar).

Otherwise, from source:

git clone https://github.com/yeme-oss/quatuor_ai.git
cd quatuor_ai
npm install
cp .env.example .env   # then paste your OpenRouter API key
npm run dev            # โ†’ http://localhost:3000

You need an OpenRouter API key. Either put it in .env (OPENROUTER_API_KEY=sk-or-v1-...) or paste it directly in the app's configuration sidebar โ€” it's proxied through the local dev server and never baked into the client bundle.

๐Ÿ’ธ Note: Quatuor itself is free and open source, but the LLM calls are not โ€” each message consumes credits from your OpenRouter account, billed per token by the model you pick. Since the conversation runs forever, keep an eye on your usage (some models on OpenRouter are free-tier, if you want to watch without spending).

Any OpenRouter model works: type its ID in the Model field in the top bar.

Make it yours

Everything is editable live from the โš™๏ธ configuration sidebar:

  • ๐ŸŽฏ Topic โ€” rewrite the initial situation and watch the same cast improvise something new.
  • ๐Ÿ‘ฅ Characters โ€” rename them, recolor their bubbles, rewrite their system prompts entirely.
  • ๐ŸŽฌ Director prompt โ€” change the casting logic itself (interruption frequency, pacing rules...).
  • โฉ Speed โ€” from a slow 5s burn to rapid-fire 1.5s exchanges.

The podcast debate scenario, with a character typing

The podcast preset in full swing โ€” Arthur demands evidence, Charles corrects the record, and the typing indicator shows who the Director picked next.

The FR/EN button in the header switches the entire experience โ€” interface, personas and generated dialogue โ€” between English and French.

Project layout

โ”œโ”€โ”€ index.html       # Single-page UI
โ”œโ”€โ”€ index.css        # All styling
โ”œโ”€โ”€ main.js          # Simulation loop, Director logic, DOM rendering
โ”œโ”€โ”€ personas.js      # Scenario presets + Director prompt (EN & FR)
โ”œโ”€โ”€ i18n.js          # UI strings & runtime prompt templates (EN & FR)
โ””โ”€โ”€ vite.config.js   # Dev server + /api/chat proxy to OpenRouter

A weekend prototype โ€” deliberately KISS. Priority: fun to watch, not architecture. ๐Ÿฟ