explaingit

jaspershiii/ai-detective-game

0TypeScriptAudience · vibe coderComplexity · 3/5ActiveLicenseSetup · moderate

TLDR

A mobile-first browser detective game where each suspect is a Gemini 2.5 Flash chatbot with a hidden alibi. Players tune temperature, top-P, system prompt, and attached evidence to break their cover.

Mindmap

mindmap
  root((ai-detective-game))
    Inputs
      Player questions
      Slider values
      Evidence files
      Hidden prompt edits
    Outputs
      Streamed AI replies
      Confessions
      Local progress save
    Use Cases
      Play an interrogation game
      Learn prompt engineering basics
      Demo Gemini streaming
      X-Ray model configs
    Tech Stack
      React
      TypeScript
      Vite
      Tailwind
      Zustand
      Gemini
      Supabase

Things people build with this

USE CASE 1

Play an interrogation game on mobile where each suspect is a real LLM

USE CASE 2

Teach yourself what temperature and top-P do by sliding them and seeing the suspect change

USE CASE 3

Study a working pattern for proxying Gemini calls through a Supabase Edge Function

USE CASE 4

Build a similar narrative game using streaming Server-Sent Events for live token output

Tech stack

ReactTypeScriptViteTailwindZustandGeminiSupabaseDeno

Getting it running

Difficulty · moderate Time to first run · 30min

Needs a Supabase project, a Gemini API key, and the example env file filled in before the Edge Function proxy will work.

All rights reserved by the author unless otherwise stated, so the code cannot be freely reused or redistributed.

In plain English

Unmasking AI's Lies is a small browser game, designed mainly for mobile phones, where you play a detective interrogating suspects in a murder case. The twist is that every suspect is a real large language model (a chatbot AI, similar to ChatGPT) running behind the scenes with a hidden personality and alibi. Your job is to ask questions in a way that makes the guilty one slip up and confess. The README describes it as a mobile-first H5 game with no signup needed and progress saved locally. The game tries to teach prompt engineering as a side effect of playing. Each interface control corresponds to a real setting that AI developers use. Two sliders called Emotional Pressure and Logical Rigor change the model's temperature and top-P, which control how random or focused the AI's answers are. You can also paste extra instructions into the suspect's hidden prompt to try to break their cover, and you can attach evidence documents directly to the AI's context to confront them with proof. An X-Ray Mode lets you peek behind the curtain to see the actual configuration and system prompt being sent. The front end is built with React 19, TypeScript, Vite (a tool for bundling web code), Tailwind CSS for styling, and Framer Motion for animations. State is kept with a small library called Zustand and stored in the browser. The actual AI calls go to Google's Gemini 2.5 Flash model, with replies streamed token by token over Server-Sent Events so the text appears as it is generated. The game is available in English and Chinese. The backend is a Supabase Edge Function written in Deno that acts as a proxy. The README notes that the AI API key never reaches the browser, because all calls go through this Edge Function, which also handles authentication, CORS, and rate limits. To run it locally, you copy an example env file and fill in Supabase project credentials, an app id, and a login type. Production builds and linting run on a platform called Miaoda. The project was built for a hackathon, and the author keeps all rights unless stated otherwise.

Copy-paste prompts

Prompt 1
Clone ai-detective-game, fill in the Supabase env file, and run it locally against my own Gemini API key
Prompt 2
Walk me through the Supabase Edge Function in ai-detective-game that hides the Gemini key from the browser
Prompt 3
Add a new suspect persona to ai-detective-game with a custom system prompt and alibi
Prompt 4
Show me how the Emotional Pressure and Logical Rigor sliders map onto Gemini temperature and top-P
Prompt 5
Swap the Gemini 2.5 Flash backend in ai-detective-game for Claude Haiku and adjust the streaming SSE handler
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.