This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine*
What I Built
Rashomon of the Dead is an offline-first, open-model detective game where five haunted ghost witnesses witnessed a single manor murder—and each tells a completely different story.
Inspired by the classic Rashomon effect, the mystery operates on an immutable Ground Truth Fact Ledger—a structured dataset storing the exact true events of the crime. Each ghost receives only a partial or biased slice of this ledger. You cross-examine the ghosts by voice or text, while a real-time contradiction engine scans their statements against the ledger, flagging misremembered details and outright lies. You win by reconciling the testimonies and submitting the true culprit, weapon, and motive.
Demo
Live Demo: https://shivani0818.github.io/rashomon-of-the-dead/
Code
Shivani0818
/
rashomon-of-the-dead
An offline-first, open-model detective game where five haunted ghost witnesses cross-examine against a ground truth fact ledger using local Gemma LLM and speech synthesis.
👻 Rashomon of the Dead
A local, open-model detective game where five haunted ghosts witnessed a single manor death—and each tells a different story.
📌 Overview
"Rashomon of the Dead" is an offline-first cross-examination detective game powered by local LLMs (Gemma via Ollama) and speech synthesis. The mystery operates on a Ground Truth Fact Ledger—a structured dataset storing the exact true events of the murder.
Each ghost witness receives only a partial or biased slice of this ledger, allowing players to cross-examine, catch contradictions, and solve the case.
✨ Key Features
-
Open-Model & Offline First: Runs 100% locally using Gemma via Ollama (
http://localhost:11434) with fallback offline logic. - 5 Ghost Witnesses: Distinct voices, pitch/rate controls, avatar profiles, and biased perspectives.
- Ground Truth Fact Ledger Inspector: Direct view of true case facts vs. ghost-specific knowledge slices.
- Real-Time Contradiction Engine: Automatically flags lies against the ledger with visual highlight cards.
- …
How I Built It
Open-Model Core: Built to run locally on open-weights Gemma 2B via Ollama (http://localhost:11434).
Prompt Slicing & Constraint System: Each ghost persona prompt is dynamically injected with only its designated slice of the JSON fact ledger, constraining Gemma to reason strictly within its character's limited knowledge or bias.
Fallback & Standalone Execution: Features a client-side simulation engine so the game remains 100% playable in browser without active server requirements, maintaining full offline availability.
Multimodal Speech Synthesis: Integrates the browser's native SpeechSynthesis API (with optional ElevenLabs API support) to deliver distinct vocal pitches, speeds, and audio tones for every ghost.
Real-Time Contradiction Engine: Built with a client-side keyword and attribute matcher that parses live responses against true ledger keys to highlight discrepancies on-screen.
System Architecture
Why Does Open Innovation Matter?
Open innovation and open-weight models like Gemma make fully private, token-free interactive narrative systems possible. Using a closed API for dynamic detective cross-examinations introduces cost per token, rate limiting, and dependency on remote infrastructure.
With open models running locally through Ollama:
Zero Marginal Cost: Players and developers can generate endless procedural mysteries and conduct unlimited interrogations without paying per API call.
Total Privacy & Offline Portability: Game logic and player conversations remain on the local machine.
Model Interchangeability: Players can swap Gemma for any open model size (or light/heavy parameter variants) based on their local hardware capabilities.
The Spirit of It
The moment it landed was during testing when interrogating Lord Harrington and Lady Eleanor back-to-back about the time of the death. Hearing Eleanor confidently claim she heard the clock strike midnight while the Ground Truth Ledger flagged her statement in glowing red against Harrington's earlier timeline gave true classic detective intrigue—all powered by local AI running right in the browser.
Prize Categories
-
Google Cloud & Gemma (Open-Weight Models): Built around Google's open-weight Gemma model (
gemma:2b/gemma:7b) for character-constrained ghost personas and local inference. - Ollama (Local AI & Open-Source Frameworks): Utilizes Ollama as the local inference runner for zero-latency, offline execution and open-model swapping.
- ElevenLabs (Voice & Audio AI): Integrated with ElevenLabs API (alongside browser-native Web Speech Synthesis) for distinctive ghost vocal tones, pitch modulation, and cross-examination audio synthesis.
- GitHub Pages & Actions (Deployment & Open Source): Hosted completely on GitHub Pages with automated CI/CD deployment via GitHub Actions.

Top comments (0)