I Gave 8 AI Agents An Island And Watched A Society Emerge
I grew up playing strategy games like Age of Empires. I loved systems where simple rules create complex worlds.
I wanted to see if AI agents could do the same. Not to win a game, but to live in a society. Would they hold grudges? Would they gossip? Would they make peace?
I built Tiny Civilization to find out.
Tiny Civilization is a simulation where 2 to 8 agents live on an island. They gather, build, trade, steal, and remember everything.
I solved the cost problem by splitting the agent brain into two layers:
- The LLM Mind: This layer decides long-term strategy and handles dialogue. It runs once every 15 days to keep costs low.
- The Utility Engine: This layer handles daily actions like eating, sleeping, or attacking. It runs every tick and costs nothing.
The agents have memory. When a simulation ends, their experiences turn into memory lines. These lines go into the next run. An agent might remember that you destroyed their home. They might pay you reparations to avoid a fight, or they might distrust you forever.
Testing this was a lesson in human nature. Every time I fixed one problem, the agents found a new way to cause conflict:
- First, they committed massacres. I added a rule that they need a reason to fight.
- Then, they fought endless wars. I added diplomacy and war-weariness to force peace.
- Next, they turned to theft. I added granaries to protect food.
The most interesting result came from memory. In one run, peace was easy because the agents were strangers. In the next run, agents remembered past peace. This lowered their guard. Betrayal became more profitable. Peace between strangers was easier than peace between old friends.
Every time I patched a conflict, the agents found the next cheapest way to fight. They act just like us.
You can try the demo or view the code below.
Live demo: https://multiagentciv.netlify.app/ Code: https://github.com/dhrupo/multi-agent-civilization
Optional learning community: https://t.me/GyaanSetuAi