Designed and built a production-grade multi-agent LLM system that functions as a Battle Management Assistant (BMA) for real-time wargaming. The architecture implements a true C3 (Command, Control, Communication) hierarchy - a Strategic Commander (C3-Agent) orchestrating role-specialized Tactical Executors that mimic real-world military command structure (global strategic view → per-unit tactical decisions).
Building an AI agent that plays a real-time wargame is fundamentally a system design challenge, rather than a prompting problem:
| Layer | Role | Key Design |
|---|---|---|
| Perception Layer | Raw game state → LLM-optimized tokens | Pre-computes bearings, threat tiers, hit-probabilities, enemy intent |
| Strategic Commander | Global battlefield analysis, per-role directives | Chain-of-thought + cloze-style prompting, momentum-aware, memory-augmented |
| Tactical Executors | Per-role action decisions | 4 role agents (AWACS, SAM, Aircraft, Decoy) with sequential execution + skip logic |
| Coordination State | Multi-unit and role deconfliction | Pythonic shared memory - prevents double-targeting, friendly-fire, collision |
| Memory Layer | Strategic persistence | Rolling outcomes, narrative history, missing-enemy tracking, momentum scores |
| Observability | Full production tracing | Logfire spans per turn + Pydantic validation on all LLM outputs |
Grounding LLMs in Spatial Reasoning
Language models have no inherent sense of a grid. All spatial data - distance, bearing, threat classification, hit probability - is pre-computed in Python before any LLM call and encoded in token-efficient natural-language format.
Hierarchical > Monolithic Prompting
Splitting into a single strategic call + per-role tactical calls yields better coordination, easier debugging, and clear scalability - each role agent sees only what it needs.
Cloze-Style Prompting for Hallucination Control
Prompt templates use a JSON skeleton with <PLACEHOLDER> tokens. The LLM fills in the blanks within a constrained structure - dramatically reducing illegal output formats and out-of-bounds moves.
Cost Optimization via Skip Logic
SAM agents are skipped entirely if no enemies are in radar range (~25% token reduction per turn). Smart routing means LLM cost scales with battlefield density, not turn count.
Adaptive Memory + Momentum
The strategic agent receives momentum score, recent narrative history, and missing-enemy intelligence - enabling consistent multi-turn strategy without a long context window.
Orchestration
LLMs & Routing
Observability
Infrastructure
If you are building real-time autonomous decision systems, memory-augmented agents, or complex AI workflows, let's talk about how I can bring this expertise to your project to build it.
✉ Get in Touch