Step into the world of 'Sell to AI,' where you and your friends become top-notch salespeople in a thrilling game of persuasion. Compete to pitch and sell everyday items to an AI in a variety of imaginative scenarios. Whether it's convincing Alice to buy sun protection for her beach vacation or persuading her to stock up on camping essentials, your creativity and sales skills will be put to the test. Join the fun, strategize your pitches, and see who can outsmart the AI to become the ultimate sales champion!

Inspiration

Today’s AI language models display remarkable capabilities, and it’s easy to see this from strong reasoning and writing skills. However, we wanted to display these capabilities from a creative and humorous perspective. “Sell to AI” is a twist on more traditional board games, but the human players must both convince an AI and outcompete other AI players. While other games and LLM evals have used LLMs as judges, competing against a well-prompted LLM is indeed quite challenging and entertaining for a human player.

What it does

The project, "Sell to AI," is an interactive game where players compete to pitch and sell items to an AI in various imaginative scenarios. Each player is given a unique item and must convince the AI why it should purchase their item based on the scenario provided. The game involves both human and AI players, with the AI evaluating the pitches and selecting winners based on the most convincing arguments. The game is designed to test creativity, persuasion skills, and strategic thinking.

How we built it

The project is constructed using a blend of cutting-edge web technologies and AI services to deliver a seamless and engaging user experience:

  • Backend: The backend is developed using FastAPI, a modern web framework for building APIs with Python. FastAPI is chosen for its high performance and ease of use, which is crucial for handling game logic and player interactions efficiently. The backend communicates with the OpenAI API, utilizing GPT-4 to evaluate player pitches and determine the most convincing arguments. This integration allows the game to leverage advanced AI capabilities for realistic and dynamic evaluations.
  • Frontend: The frontend is built with React and TypeScript, providing a robust and type-safe environment for developing interactive user interfaces. React's component-based architecture allows for modular and reusable UI elements, while TypeScript ensures type safety and reduces runtime errors. The frontend uses WebSockets to maintain real-time communication with the backend, enabling instant updates and interactions as players submit their pitches and receive feedback. By combining these technologies, "Sell to AI" offers a compelling platform for players to engage in creative and strategic gameplay, testing their salesmanship against both human and AI opponents.

Challenges we ran into

  • State syncing: to keep the server and client in sync, we initially sent differential updates to the client (e.g. “player joined” or “player disconnected”), but this proved difficult to implement in the React frontend. We also had difficulty ensuring that the server and clients stay synced with regards to what stage the game was on. To solve this, we sent the entirety of the game state to every client on state changes. This may have been inefficient, but proved to be the most robust solution.
  • Time zones: we needed a way to tell clients when each round would end, but of course this brought about time zone issues because one party would work in local time while the other used UTC.

Accomplishments that we're proud of

  • AI agents, which provide an additional challenge and humor for human players
  • Clean, responsive UI with effective loading states
  • Creative scenarios with out-of-the-ordinary objects that force players to come up with original responses
  • Using https://robohash.org to generate unique profile pictures
  • Creating a realtime game that syncs between many players

What we learned

  • Prompting LLMs can be hard!
  • Time zones are hard
  • How to use WebSockets with FastAPI and Next.js

What's next for Sell to AI

We’re looking into different game modes, e.g. with player-written scenarios and items. Instead of directly pitching the AI, we could turn the game into one of prompt engineering: what if you could prompt the AI itself to pitch for you!

  • Customization: allow players to change the following settings:
  • the number of AI players
  • time to write prompts
  • style and character of the judging AI

Built With

Share this project:

Updates