A noir detective game powered by local AI. Interrogate suspects, collect evidence, and issue the final verdict.
- VERDICT: The AI Detective
VERDICT: The AI Detective is a browser-based murder mystery game built for Hackiethon 2026.
The core idea is simple: replace static branching dialogue with a real local AI. Every suspect is driven by a carefully engineered system prompt, giving each one a distinct personality, a hidden alibi, and a lie they will defend under pressure.
The player takes on the role of a detective investigating the death of Victor Ashford, a wealthy businessman found poisoned in his study. Four suspects. One killer. One chance to get the verdict right.
Each suspect responds dynamically to any question the player asks. The AI stays in character, maintains its lie, and subtly shifts its story when pressured.
Players collect key statements and build a case visually. Nothing is pre-scripted — the evidence board fills with real AI-generated responses.
A dedicated AI analysis pass compares collected evidence across suspects and surfaces factual inconsistencies — without revealing the killer.
One final accusation. The AI judge evaluates the player's collected evidence and delivers a dramatic ruling.
Click the thumbnail above to watch the full gameplay demo.
All game state is stored in a single global gameState object:
const gameState = {
suspects: {
thomas: { interviewed: false, suspicious: false, timerRemaining: 180 },
eleanor: { interviewed: false, suspicious: false, timerRemaining: 180 },
mercer: { interviewed: false, suspicious: false, timerRemaining: 180 },
sophie: { interviewed: false, suspicious: false, timerRemaining: 180 }
},
evidence: [],
interviewCount: 0
}Each suspect has an isolated system prompt defining:
- Character background and personality
- A hidden secret they protect
- A specific lie they will always maintain
- Speech style and behavioural cues
// Simplified API call structure
const response = await fetch('http://localhost:11434/api/chat', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'llama3.2',
messages: [
{ role: 'system', content: suspectSystemPrompt },
...conversationHistory,
{ role: 'user', content: playerQuestion }
],
stream: false,
options: { num_predict: 200 }
})
})- 4 AI suspects — each with a unique personality, alibi, and hidden lie
- Per-suspect conversation history — the AI remembers what was said earlier in the same interrogation
- Independent interrogation timers — 3 minutes per suspect, paused when leaving the room
- Evidence board — collect and review key AI-generated statements
- Contradiction analysis — AI reviews collected evidence for inconsistencies without revealing the killer
- One-shot verdict system — the player makes a single final accusation
- Noir UI — dark atmospheric design with gold accent typography
- Fully local — no internet required after setup, no API costs, no data sent externally
| Layer | Technology |
|---|---|
| Frontend | HTML, CSS, JavaScript (Vanilla) |
| AI Runtime | Ollama (local LLM server) |
| Language Model | llama3.2 |
| Fonts | Google Fonts — Playfair Display, Inter |
| Icons | Inline SVG |
| Hosting | Local file / Python HTTP server |
- Ollama installed on your machine
- A modern browser (Chrome, Firefox, Safari)
- No Node.js, no backend, no API keys required
ollama serveollama pull llama3.2This will take approximately 5 minutes on the first run.
Option A — Open directly in browser: Open index.html in your browser
Option B — Run with a local server:
python3 -m http.server 8000Then visit http://localhost:8000
- Interrogate — Enter each suspect's room and question them freely. Each session is 3 minutes. The timer starts on your first question.
- Collect Evidence — Save important responses to your evidence board using the ADD TO EVIDENCE button.
- Analyze — Use the ANALYZE CONTRADICTIONS feature to surface inconsistencies across suspect statements.
- Verdict — Interview at least 2 suspects to unlock the ISSUE VERDICT button. You have one accusation. Choose carefully.
| Name | Role | Personality |
|---|---|---|
| Thomas Chen | Personal Butler (15 years) | Formal, loyal, over-explains when nervous |
| Lady Eleanor Ashford | Victor's Wife | Cold, precise, deflects with composure |
| Dr. Raymond Mercer | Business Partner | Aggressive, uses legal language, counter-questions |
| Sophie Hartley | Niece, Art Student | Educated but anxious, fragments under pressure |
- Randomised case generation — different killer each playthrough
- Stronger suspect memory — AI recalls specific earlier statements
- Voice synthesis for suspect responses
- Mobile-optimised layout
- Save and resume case progress
- Multiple difficulty levels affecting how well suspects conceal lies
This project is for educational and portfolio purposes.






