Python engine · Guaranteed-solvable deduction

Neural Noir

A procedural detective game with a real deductive core. The engine generates a mystery from a seed — suspects, a hidden culprit, and clues — and proves the clues uniquely identify the culprit before handing you the case. Pure Python; the LLM is optional flavour. Play a real generated case below.

Constraint solverProcedural generation Unique-solution guarantee855 testsLLM optional

Play a real case

The deduction, in your browser

These cases were generated by the Python engine (python demo.py 7) and committed verbatim — suspects, clues and the exact per-clue elimination sets. The buttons below run the same constraint logic the Python solver uses: a suspect survives only if every clue implicates them. Interrogate to see who each clue clears, then accuse.

This page is static (GitHub Pages) and runs no LLM — it replays committed, engine-generated cases. The real generator, constraint solver and uniqueness guarantee live in the Python package in this repo; the optional LLM hook only restyles text and never touches the deduction.

The engine

From a seed to a provably solvable case

generator

Seeded cast

Suspects share overlapping attributes so no single clue gives anyone away.

clues

Culprit-true constraints

Clues are drawn from the culprit's own attributes, so a true clue never clears the culprit.

solver

Constraint propagation

Keep a suspect only if every clue implicates them; the survivors are the answer.

guarantee

Verify, then accept

The generator runs the solver and only keeps a case when exactly one survivor remains — the culprit.

herrings

Harmless red herrings

True facts phrased to match everyone — flavour that can never break uniqueness.

optional

LLM flavour hook

If a key is set, an LLM restyles the prose. It never decides clues or the verdict.

Why it's real

The uniqueness guarantee is tested, not asserted

Run it yourself: pip install -r requirements.txt then python -m pytest -q (855 passing) and python demo.py.