akinator
An high-performance, open source Akinator like Engine and probabilistic guessing engine written in Go.
An open-source 20-questions guessing engine written in Go that uses probability and information theory to identify what you're thinking of, similar to Akinator.
This is the engine behind a 20-questions guessing game, similar to Akinator. You think of a character, answer yes/no/maybe questions, and the engine tries to identify who you are thinking of. The creators built it originally to power an Anime Akinator game and have released the engine as an open-source project so others can use it with any dataset they choose.
The engine is written in Go and runs as a web server. The key design choice is that it uses probability rather than a strict yes/no decision tree. When you answer a question, the engine does not eliminate characters absolutely; instead, it adjusts each character's probability score up or down. A contradictory answer or an "I don't know" response applies a small penalty rather than removing a candidate entirely. This means the game can recover from mistakes and handle uncertain answers gracefully.
To decide which question to ask next, the engine calculates which question would most efficiently split the remaining candidates based on their current probability distribution. It also tracks which questions it has asked less often and gives those a small bonus to avoid repeating the same sequence every game. After each completed game, the engine updates its internal knowledge base based on who the correct answer was, so it gradually improves its question strategy over time.
The engine is dataset-agnostic, meaning you can replace the anime character dataset with any other set of entities, such as movies, historical figures, or programming languages, and it will work the same way. The README provides installation instructions and documents the structure of the dataset format.
The license is AGPL 3.0, which is a copyleft license. If you build something with this engine and distribute it, you are required to release your source code under the same terms. For personal or internal use, this restriction does not apply.
Where it fits
- Build a 20-questions guessing game for any category by swapping in your own dataset of characters or items.
- Use the engine as a backend service for a web-based guessing game by calling its HTTP endpoints from a frontend.
- Study how a probabilistic 20-questions algorithm works by reading the architecture documentation and source code.