Alibi is a deductive reasoning detective game powered by FalkorDB. Suspect statements, physical room topology, and forensic items form an isolated graph partition. Graph algorithms expose lies through shortest paths, cycle detection, and alibi-support chains.
Organizers of Track 01 require that graph databases do genuine computational work rather than serving as passive text stores. Here is how Alibi delivers on every single focus point:
Motive paths traverse up to 3 hops across KNOWN_REL edges. Physical movement feasibility runs variable-length shortest paths over connected estate rooms.
8 read tools and 2 board writes in TOOLS. The AI agent never writes ad-hoc Cypher; it dispatches parameterized, audited queries through typed Zod contracts.
pnpm mcp starts an MCP server over the standard reasoning tool registry, allowing external agent systems (Claude, Cursor, custom agents) to solve murder cases.
When graph queries detect a lie, the Inspector writes :Flag and :Hypothesis nodes directly to the board with justification references.
Every deductive assertion includes the exact room path, contradiction pair, or alibi-support chain that produced it. The verdict screen diffs what the player solved against ground truth.
Empty query results are semantically differentiated. "No path known" is a valid graph traversal state, preserving full mathematical precision without hallucinating false connections.
In AI reasoning systems, "cheating" occurs when the model or copilot has access to ground truth. Alibi enforces a cryptographic-level information barrier using dedicated FalkorDB database partitions:
Contains hidden reality: actual perpetrators, true locations at each minute, hidden secret passages, knowledge facts (knownBy), and authored claims with truth flags.
The blueprint copied at the start of an investigation. Contains known rooms, open doors, public suspect personas, and time slots. Hidden doors and true alibis are scrubbed.
The player's working graph. Grows in real-time as statements are extracted and rooms are searched. Contains :Statement, :Assertion, :Flag, and :Hypothesis nodes.
Every tool conforms to a strict Zod contract returning the standard envelope: { ok, data, trace }. Below are the 10 tools implemented in src/engine/tools/:
| Tool Name | Type | Underlying Cypher Query | Purpose & Graph Logic |
|---|---|---|---|
| getBoard | Read | Multi-MATCH | Full snapshot of active statements, evidence, flags, hypotheses, and tick count. |
| findContradictions | Read | Q60_contradictions | Finds assertions placing the same subject in two distinct rooms at the same time slot. |
| findRehearsedAlibis | Read | Q61_rehearsed | Identifies pairs/triplets of suspects giving identical specific location details. |
| findImpossibleMoves | Read | Q62 & Q63_distance | Flags sequential room claims where required room transitions exceed available time slots. |
| checkFeasibility | Read | Q66_hard_anchors | Checks if a person could have reached a target room given their fixed physical anchors. |
| whoCouldHave | Read | Q68_evidence_act | Elimination algorithm: tests candidate feasibility for a scene act; returns survivors. |
| motivePaths | Read | Q70_motive_paths | Traverses up to 3 hops of known social/business relationships between suspect and victim. |
| alibiSupport | Read | Graph Alibi Chains | Evaluates whether a corroborating witness has a reliable alibi or is compromised. |
| flag | Write | CREATE (:Flag) | Pins an inconsistency card (contradiction, impossible move, rehearsed) to the board. |
| hypothesize | Write | CREATE (:Hypothesis) | Writes a formal suspect accusation hypothesis with confidence percentage to the board. |
All Cypher in Alibi is strictly parameterized, pre-audited, and executed via roQuery for sub-10ms performance:
MATCH (a:Assertion), (b:Assertion)
WHERE a.subject = b.subject
AND a.slot = b.slot
AND a.room <> b.room
AND a.src < b.src
RETURN a.src AS srcA, a.hard AS hardA,
b.src AS srcB, b.hard AS hardB,
a.subject AS subject, a.slot AS slot,
a.room AS roomA, b.room AS roomBMATCH (a:Room {id: $from}), (b:Room {id: $to})
MATCH p = shortestPath((a)-[:CONNECTS|HIDDEN_KNOWN*..8]-(b))
WHERE ALL(r IN relationships(p) WHERE
(type(r) = 'CONNECTS' AND r.state = 'open') OR
(type(r) = 'HIDDEN_KNOWN' AND $useHidden))
RETURN length(p) AS d, [n IN nodes(p) | n.id] AS pathMATCH p = (a:Party {id: $person})-[:KNOWN_REL*1..3]-(v:Person {victim: true})
RETURN [r IN relationships(p) | r.id] AS relationIds, length(p) AS len
ORDER BY len LIMIT 3LLMs in games frequently hallucinate false clues or reveal the killer prematurely. Alibi solves this with a strict four-stage interrogation pipeline:
Q40_select_claims queries the truth graph for authorized claims matching the topic and time slot that haven't already been revealed.
The LLM verbalizes the claim text in character with a structured JSON schema returning { reply, claimIds }.
firewall.ts strictly verifies returned claim IDs and scans for forbidden keyword leaks against truth facts.
If the LLM fails validation or the network is offline (ALIBI_LLM=off), the game falls back directly to the authored claim text.
Every reasoning tool in Alibi has an oracle implementation in pure JavaScript (scripts/reference-engine.mjs). Automated test suites verify 100% parity against live FalkorDB:
Tests hit a real FalkorDB container on localhost:6379. Zero mocked database queries.
Automated leak tests verify that no ground-truth fields (culprits, knownBy) ever appear in player responses or Inspector contexts.
If an AI provider encounters rate limits or API outages, a deterministic plan executes the exact same FalkorDB tool pipeline with zero disruption.
Experience the graph reasoning engine live in the browser, review the developer field manual, or inspect the styleguide component library.