Experimental distributed multi-agent reasoning framework for geopolitical crisis modeling.
An open-source system that orchestrates multiple AI agents to simulate complex international scenarios. Each country contains 2-4 faction agents that internally debate policy, then synthesize unified decisions. The system resolves conflicts deterministically and tracks cascading effects across military, economic, and political dimensions.
A research framework for studying emergent behavior in multi-agent systems under resource constraints and incomplete information. The system:
- Orchestrates 8 parallel agents (batched by strategic interest)
- Enforces narrative consistency through game master arbitration
- Applies cascading effects (oil prices โ war support, casualties โ morale)
- Tracks 66 countries with asymmetric capabilities and faction diversity
- Generates deterministic outcomes using combat formulas and public opinion gates
Primary test scenario: Suwalki Gap Crisis (Baltic escalation chain).
Country Agents (parallel)
โ
Faction Debates (3 rounds each)
โ
Game Master Resolution
โ
World State Updates (cascading effects)
โ
Checkpoint (JSON logs)
โ
Static Web Viewer (no backend)
For detailed architecture, see ARCHITECTURE.md
- Python 3.12+
- Ollama (local LLM) or DeepSeek API key
- 64GB RAM for deepseek-r1:32b
git clone https://github.com/RomanTsisyk/multi-agent-simulation-engine.git
cd multi-agent-simulation-engine
pip install -r requirements.txt
ollama pull deepseek-r1:32b # Or use DeepSeek API
python run.py preflight# Quick (4 countries, 3 rounds)
python run.py play --preset quick
# Medium (10 countries, 5 rounds)
python run.py play --preset medium
# Full (20 countries, 10 rounds)
python run.py play --preset fullLive Demo (5 pre-recorded games):
https://roman-tsisyk.com/viewer_static_demo/production.html
Local Analytics:
python run.py view logs/game_TIMESTAMP/No backend required. Static HTML/JS viewer with:
- Real-time charts (oil prices, nuclear posture, war support, military balance)
- Country decision logs with faction reasoning
- Combat results and cascading effects
- Full JSON state export
Runs on GitHub Pages via /viewer_static_demo/.
- Combat formula: Strength ร Readiness ร Force multipliers
- Nuclear escalation: peacetime โ elevated โ dispersal โ launch_ready
- Public opinion gates: War support determines military action legality
- Cascading effects: Oil price shocks, sanctions impact, refugee flows
See GAME_MECHANICS.md for full specifications.
- ARCHITECTURE.md - System design and component overview
- DESIGN.md - Architectural decision rationale
- TECHNICAL.md - Implementation details and API reference
- GAME_MECHANICS.md - Combat formulas, escalation ladder, cascading effects
- CLAUDE.md - Claude Code runner protocol
engine/
โโโ game.py # Round orchestration
โโโ world_state.py # State management
โโโ game_master.py # Combat resolution
โโโ checkpoint.py # Save/load
agents/
โโโ country.py # Country orchestration
โโโ faction.py # Faction debates
backends/
โโโ ollama_backend.py
โโโ deepseek_backend.py
scenarios/ # YAML scenario definitions
countries/ # YAML country configs (66)
viewer_static_demo/ # Web viewer + demo data
claude_runner/ # Claude Code integration
tests/ # Unit test suite
pip install pytest pytest-asyncio pytest-cov
pytest --cov=engine,agents,backendsruff check .
mypy engine/ agents/ backends/Edit config.yaml:
game:
scenario: "suwalki"
num_countries: 20
max_rounds: 10
backend:
type: "deepseek"
model: "deepseek-r1:32b"
max_concurrent: 10Each country contains independent faction agents that debate before deciding:
- Initial Position - Faction states opening argument
- Rebuttal - Respond to other factions
- Synthesis - Move toward consensus
Faction Types: Hawk, Dove, Diplomat, Military Realist, Pragmatist
Weight by phase (escalation vs negotiation). See countries/*.yaml for examples.
- Multi-agent reasoning over monolithic decisions
- Asymmetric capabilities (not all countries equal)
- Narrative consistency enforced by game master
- Deterministic resolution (reproducible outcomes)
- Cascading effects (not isolated decisions)
- Static deployment (no backend required)
| Scenario | Countries | Rounds | LLM Calls | Time |
|---|---|---|---|---|
| Quick | 4 | 3 | 60 | ~15 min |
| Medium | 10 | 5 | 150 | ~45 min |
| Full | 20 | 10 | 600 | ~3 hours |
Backend comparison:
- Ollama (local): Free, slow, privacy-preserving
- DeepSeek API: Fast, $0.50-3/game, parallel queries
Games are deterministic given same LLM and seed. All game logs saved as JSON:
logs/game_20260215_123456/
โโโ round_001.json
โโโ round_002.json
โโโ ...
Each round contains:
- World state before/after
- All country decisions
- Combat results
- Headlines & surprises
Fully analyzable post-hoc without re-running simulation.
If using this framework for research:
@software{wargame2026,
author = {Tsisyk, Roman},
title = {Multi-Agent Simulation Engine (WarGame)},
year = {2026},
url = {https://github.com/RomanTsisyk/multi-agent-simulation-engine}
}MIT License - see LICENSE file.
Priority areas:
- New scenarios (Taiwan Strait, Arctic sovereignty)
- Missing countries (Taiwan, Hungary, Romania configs)
- Test coverage expansion
- Backend optimization (inference batching)
Built with OpenAI/Anthropic APIs, Ollama, and community feedback.