Using mistral model to play monopoly
We wanted to do something fun using an agentic workflow.
Playing monopoly using mistral api. We use agents for the interface and to play the actual game. There are agents that follow different stragies, like short-term, long-term or the Trump real-estate mogul strategy.
We use 4 agents in an agentic workflow. (all using the mistral large model api)
- An agent to create a general strategy to play monopoly
- An agent to retrieve possible actions given the game state (in the form of html)
- An agent to generate an an action (which maps to a prompt)
- An agent that generates javascript code to make an action given HTML and an action to take
We built it in python using Selenium for interface interaction and mistral API (mistral-large)
Communicating with the interface. Having a global strategy. outputing a single action took some time as well.
It works !
- Add more features like trading property.
- Make multiple agents competing against each other.
- Using reinforcement learning.
- Making it generic for any javascript application.
- Add the ability to trade and take 'management' actions
Video description On the right side, we can see the monopoly.js interface playing in a Selenium Firefox instance.On the the left side, we can see some logs.
- Decide action to make
- Possible actions : It is retrieve from the html
- Action decided by the playing agent
- Javascript code to exectute the selected action