Agent Orchestration
Once the video is mathematically converted into a BEV JSON file, the system transitions into the reasoning phase. This phase is governed by the Agent Orchestration Layer, which is responsible for managing the execution of multiple analytical agents and ensuring a structured flow of data between them.

The Shared Global State
A central design element of the K-RAID system is the use of a shared global state. This serves as a unified data repository that stores all intermediate representations and agent outputs.
The global state contains the BEV trajectories of all players across time, player role information (raider vs defenders), and metadata related to the raid. Crucially, all specialized agents read from and write to this global state rather than communicating directly with each other. This loose coupling prevents cascading failures and drastically improves system scalability.
Why Global State?
In early iterations, if the Analysis Agent needed data from the Simulation Agent, they would pass JSON payloads directly. If one agent failed, the entire chain broke. By abstracting communication to a central database, agents can operate asynchronously, and the Synthesizer can pull whatever data successfully processed without hanging the system.
Llama-3 Integration
We leverage Llama-3 specifically for semantic reasoning, not mathematical calculation. The Router doesn't attempt to answer "Why did the tackle fail?" by hallucinating over coordinates. It simply understands that the user is asking a "defensive compactness" question, and correctly triggers the Python STGCN network to do the actual math.
Query-Based Routing
The routing mechanism, powered by a LangGraph node, determines exactly which agents should be activated based on the user's natural language query.
The router analyzes the query and classifies it into one or more categories: it activates the Analysis Agent for defensive evaluation, the Retrieval Agent for similarity-based historical queries, and the Simulation Agent for hypothetical "What-If" scenarios. (The Description Agent is always activated by default to provide text context).