Skip to content

Repository files navigation

Alibi

Interrogate AI-powered suspects. Find the killer. Don't get played.

Alibi is a murder mystery interrogation game where every suspect is controlled by a fine-tuned LLM with its own personality, secrets, alibi, and breaking point. Your job is to find contradictions, present evidence, cross-reference testimony, and apply enough pressure to crack the guilty suspect — without falling for red herrings from the innocent ones.

https://github.com/user-attachments/assets/placeholder

How It Works

You're a detective. Someone's dead. You have 2-3 suspects in separate rooms, a growing pile of evidence, and a case board to track your investigation.

The suspects lie. The guilty one has a carefully constructed alibi with specific holes you can exploit. The innocent ones have their own secrets they're hiding — affairs, theft, fraud — which makes them look suspicious even though they didn't kill anyone.

Your tools:

  • Ask questions — open-ended interrogation
  • Present evidence — confront suspects with physical evidence and watch their reaction
  • Use testimony — quote what one suspect said to another ("Karen says she saw you at 11pm...")
  • Silence — say nothing and let them sweat
  • Bluff — claim you have evidence you don't (risky — 40% chance it backfires)
  • Confront contradictions — call out inconsistencies between their story and the facts

The pressure system tracks each suspect's stress level across 6 tiers. As pressure builds, guilty suspects start slipping — shorter answers, emotional outbursts, near-confessions. Push hard enough and they break. But innocent suspects crack too, and a false confession means you lose.

The Prompt Architecture

Each suspect runs on an 8-layer dynamic prompt system that rebuilds every turn:

Layer Type Purpose
1. Character Foundation Static Name, personality, speech patterns, background
2. Knowledge State Static What they know, what they're hiding, what they don't know
3. Alibi & Lies Static Lie hierarchy with fallback positions, breaking point conditions
4. Pressure State Dynamic Behavioral instructions change across 6 tiers (guilty) or 4 tiers (innocent)
5. Evidence Awareness Dynamic Reactions to presented evidence, fear of unpresented evidence
6. Conversation Context Dynamic Topic tracking, staleness counters, available redirects
7. Cross-Reference Alert Conditional Injected when player quotes another suspect's testimony
8. Guardrails Static Anti-repetition, response length, character consistency rules

The full prompt system is documented in PROMPT_ARCHITECTURE.md with complete examples.

See GAME_LOGIC.md for the detailed game design document.

Cases

Three handcrafted cases with escalating difficulty:

Case Difficulty Suspects Premise
The Partner's Share Easy 2 Business partner bludgeoned in his office. One suspect embezzled, the other had an affair.
Bitter Medicine Medium 3 Retired oncologist poisoned at her own dinner party. A gambling son, a fraudulent colleague, a pill-stealing nurse.
The Last Toast Hard 3 Tech CEO stabbed in his penthouse. A betrayed CTO losing $360M, a blackmailing ex, a corrupt security chief.

Each case includes full evidence chains, timeline events, suspect psychological profiles, contradiction definitions, and a complete ground truth narrative.

Fine-Tuned Model

The game ships with support for a custom fine-tuned Qwen 3.5 4B model trained specifically for suspect roleplay.

  • 1,736 synthetic multi-turn interrogation conversations in ShareGPT format
  • Generated with Claude Opus 4.6 using 75 parallel agents
  • 18 personality archetypes (nervous academic, cocky executive, grieving spouse, stone-cold sociopath...)
  • 10+ crime types with distinct interrogation dynamics
  • 7 confession styles (tearful breakdown, defiant admission, calculated surrender...)
  • Jailbreak resistance training — suspects stay in character even under adversarial prompting
  • Full pressure escalation arcs from calm denial to breaking point
  • Base: Qwen 3.5 4B
  • Fine-tuned via LoRA (Unsloth, A100 80GB)
  • Quantized: Q4_K_M (2.5GB) and Q8_0 (4.2GB)
  • Final training loss: ~1.27
  • ChatML format

The model runs locally via LM Studio, Ollama, or any GGUF-compatible runtime. No API keys needed.

Setup

npm install
npm start        # http://localhost:3000

LLM Backend Options

Option A: LM Studio (recommended for local play)

  1. Download alibi-suspect-qwen3.5-4b-gguf Q4_K_M
  2. Load in LM Studio, start server on port 1234
  3. Use server_v2.js as your server

Option B: Claude (file queue) The default server.js uses a file-based queue system where an external Claude instance processes requests. Write requests go to queue/pending/, responses come back in queue/completed/.

Option C: Any OpenAI-compatible API Point the LM Studio URL in server_v2.js to any compatible endpoint.

Scoring

When you make your accusation, you're graded on a 100-point scale:

Component Points Criteria
Killer ID 30 Did you finger the right suspect?
Motive 15 Why did they do it?
Method 15 How did they do it?
Evidence Usage 15 Did you present relevant evidence effectively?
Contradictions Found 15 Did you catch their lies?
Confession Extracted 10 Did you break them before accusing?

Project Structure

├── server.js                  # Production server (Claude file-queue backend)
├── server_v2.js               # LM Studio backend server
├── CASES.json                 # 3 handcrafted murder mystery cases
├── PROMPT_ARCHITECTURE.md     # 8-layer dynamic prompt system design
├── GAME_LOGIC.md              # Complete game design document
├── public/
│   └── index_v2.html          # Game frontend (dark noir aesthetic)
└── package.json

Architecture

┌─────────────┐    SSE stream     ┌──────────────┐     prompt      ┌─────────────┐
│   Browser    │ ◄──────────────► │   Express    │ ──────────────► │  LLM Engine │
│   (noir UI)  │   /api/interro-  │   Server     │   8-layer       │  (local or  │
│              │    gate          │              │   dynamic       │   cloud)    │
│  Evidence    │                  │  Session     │   system        │             │
│  Case Board  │                  │  Pressure    │   prompt        │  Qwen 3.5   │
│  Transcripts │                  │  Contradict. │                 │  4B GGUF    │
│  Accusation  │                  │  Evidence    │                 │  (or Claude)│
└─────────────┘                  └──────────────┘                 └─────────────┘

Built with Express, vanilla JS, and the conviction that the best AI games don't need a game engine — just good prompts and a murder to solve.

About

AI-powered murder mystery interrogation game. Interrogate LLM suspects with dynamic pressure mechanics, evidence systems, and 8-layer prompt architecture.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages