An automated solver for the logic puzzle game Clues by Sam.
Check out the project landing page here: Clues by Sam Solver
This project implements an autonomous agent that plays "Clues by Sam". It combines browser automation, natural language processing, and formal logic to solve the puzzle.
The system operates on a Observe -> Parse -> Deduce -> Act loop:
- Observe: Uses Playwright to scrape the game grid and visible clues.
- Parse: Uses an LLM (GPT-4o) to translate natural language clues into formal logic constraints.
- Deduce: Uses the Z3 Theorem Prover to determine which characters are definitely Innocent or Criminal based on the accumulated knowledge.
- Act: Automatically clicks the game board to mark the deduced statuses.
See Workflow Design.
-
Install dependencies: This project uses Poetry for dependency management.
poetry install poetry run playwright install
-
Configure Environment: Copy the example environment file and configure your API keys.
cp .env.example .env
Edit
.envwith your Azure OpenAI credentials.Note: You can change the model (e.g., to a different GPT version) by modifying the
ClueTranslatorclass insrc/translator/translator.pydepending on your preferences.
Run the main solver loop using the poe task runner:
poetry run poe start