I built a Mafia game where the players are AI agents that actually talk trash to each other

Reddit r/AI_Agents Tools

Summary

Built a Mafia/Werewolf game simulator using LLM-powered AI agents with a custom agent-to-agent communication protocol, featuring live streaming where a new game starts every hour.

TLDR: Full Mafia/Werewolf simulator with a custom A2A protocol, LLM-backed agents that broadcast, whisper, and huddle, and a live streaming frontend where a new game starts every hour. ​ Thought it'd be funny to watch AI agents lie to each other. Turns out it is. ​ Built a full Mafia/Werewolf simulator with a custom A2A (agent-to-agent) protocol at its core. The protocol supports three cast types: broadcast to the whole room, multicast to a subset, or unicast to one person privately. This matters because Mafia is fundamentally a communication game, and most agent frameworks just have agents pick targets silently like it's a chess engine. ​ The fun part: even a private unicast is visible to the rest of the table as a "shape" -- they see who spoke, what cast type was used, and who received it, just not the content. So two Mafia members whispering to each other at night is visible information the town can use during the day. The protocol enforces this at the bus level, so no agent can cheat it. ​ The engine has zero I/O anywhere, so the same rules drive a CLI, a test suite, or a live WebSocket stream. There's a FastAPI streaming server that fans out every game event (votes, whispers, deaths) to all connected viewers in real time. A new game starts every hour on the hour, mid-game joins catch you up instantly, and voting is streamed per-vote so you can watch the tally actually build rather than just seeing the result. ​ PS : Links in pinned comment
Original Article

Similar Articles

I built an autonomous civilization engine where the AI plays the game for you. You just drop a few LLM agents onto the grid and watch. They figure out how to farm, reproduce, build temples, and die of old age, inventing their own history entirely from scratch while you just sit back and observe.

Reddit r/singularity

A developer created a zero-player civilization game where LLM agents autonomously farm, reproduce, build, and wage wars, driven by Maslow's hierarchy of needs, with emergent religious conflicts and societal collapses.

AI agents still suck, so I built my own

Reddit r/AI_Agents

The author built a custom AI agent application wrapping Claude Code and upcoming Codex support, focusing on composable workflows and seeking community feedback.