Play the 20 Questions Game Against an LLM | by Alejandra Vlerick | Dec, 2024

Editor
1 Min Read


And learn about LLM architecture techniques, parsed output, test design and performance measurement of your system

Photo by Carl Raw on Unsplash

The 20 Questions Game is a classic guessing game for two players. One player thinks of an object, person, or place, and the other player takes turns asking yes-or-no questions to figure out what it is. The goal is to guess correctly within 20 questions. If no one guesses by the 20th question, the thinker reveals the answer, and the round ends. The real game can be found here, I encourage you to play thinking of something easy like a car or an apple.

Build the best LLM agent possible to be the guesser in this game.

  1. Build the agent using LangGraph
  2. Test the agent using Pytest and create your own agent evals

A couple of things were clear to me from the beginning of starting this project. I wanted the guesser agent to receive a very clear list of all the previous questions asked and answer and then be prompted to come up with the next question to ask.

Share this Article
Please enter CoinGecko Free Api Key to get this plugin works.