Federation of Agents: A Semantics-Aware Communication Fabric for Large-Scale Agentic AI Lorenzo Giusti, Ole Anton Werner, Riccardo Taiello, Matilde Carvalho Costa, Emre Tosun, Andrea Protani, Marc Molina, Rodrigo Lopes de Almeida, Paolo Cacace, Diogo Reis Santos, Luigi Serio, CERN, Geneva, Switzerland Abstract We present Federation of Agents (FoA), a distributed orchestration framework that transforms static multi-agent coordination into dynamic, capability-driven collaboration. FoA introduces Versioned Capability Vectors (VCVs): machine-readable profiles that make agent capabilities searchable through semantic embeddings, enabling agents to advertise their capabilities, cost, and limitations. Our architecture combines three key innovations: (1) semantic routing that matches tasks to agents over sharded HNSW indices while enforcing operational constraints through cost-biased optimization, (2) dynamic task decomposition where compatible agents collaboratively break down complex tasks into DAGs of subtasks through consensus-based merging, and (3) smart clustering that groups agents working on similar subtasks into collaborative channels for k k -round refinement before synthesis. Built on top of MQTT’s publish-subscribe semantics for scalable message passing, FoA achieves sub-linear complexity through hierarchical capability matching and efficient index maintenance. Evaluation on HealthBench shows 13 × \times improvement over single-model baselines, with clustering-enhanced collaboration particularly effective for complex reasoning tasks requiring multiple perspectives. The system scales horizontally while maintaining consistent performance, demonstrating that semantic orchestration with structured collaboration can unlock the collective intelligence of heterogeneous federations of AI agents. Figure 1: Federation of Agents. Heterogeneous agents advertise Versioned Capability Vectors containing semantic embeddingsof agents’ profiles. The orchestrator ingests these capability updates, and when a complex task arrives, it performs semantic routing to the most compatible agents or clusters. Envelopes and dashed arrows depict MQTT publish/subscribe exchanges for assignments, capability updates, and intermediate artifacts. Agents collaborate and return TASK_COMPLETE signals with subtask outputs; the orchestrator merges them along the task DAG to synthesize the solution. 1 Introduction The landscape of artificial intelligence has evolved from single AI models to networks of specialized agents that plan, coordinate, and act over extended horizons sapkota2025ai ; schneider2025generative ; gridach2025agentic . This shift toward agentic AI systems represents a fundamental change in how we approach complex problem-solving with AI: rather than relying on a single model to handle all aspects of a task, we now orchestrate collections of specialized agents that can decompose tasks, maintain persistent context, and coordinate their efforts through structured communication towards a common goal. However, current agentic AI systems mainly rely on manually curated integrations and topic-based routing shen2023hugginggpt ; yue2025masrouter , posing constraints on scalability as the heterogeneity of agents grows, and coordination complexity increases, limiting scalability and not addressing the fundamental operational question: who can do what, at what cost, and under which policy constraints? ; preventing the realization of the "Internet of Agents" vision wang2025internet . To address this, we introduce Federation of Agents (FoA), a semantics-aware communication fabric that transforms agent coordination from static, topic-based routing to dynamic, capability-driven orchestration. At its core, FoA enables agents, tools, and data stores to advertise Versioned Capability Vectors (VCVs): machine-readable profiles that capture functional capabilities, performance characteristics, operational constraints, and security labels in a structured format. Problem Statement and Challenges. Despite rapid progress, agentic AI systems still lack principled, searchable capability profiles, making capability discovery and partner selection ad hoc even in prominent orchestration frameworks shen2023hugginggpt ; wu2024autogen ; wang2025internet . Dynamic orchestration remains partially solved: role-based systems improve structure yet often rely on manual wiring and do not couple decomposition with operational budgets hong2024metagpt ; li2023camel . Meeting resource constraints (latency, bandwidth, energy) alongside semantic fit is remarkable at the edge, where agents run on IoT devices curasma2024agents , motivating embedding-based semantic routing and efficient, reliable transports aws2025multillm ; mqttv5 ; emqx2024harnessing ; alotaibi2024secure . Heterogeneous security and regulatory regimes further raise policy compliance requirements, demanding auditable enforcement across agents and data boundaries neupane2025towards . At scale , coordination overhead and loss of coherence emerge as agent counts and workflow depth grow, calling for sublinear retrieval and structure-aware coordination xiong2025self ; piao2025agentsociety ; malkov2018efficient . Operational observability and reliability are also underdeveloped: real deployments report behavioural variability, drift, and governance gaps in agentic processes and ecosystems fournier2025agentic ; wong2025intelligent . Finally, there are no interoperable protocols and ontologies to standardize capabilities and interactions, limiting portability across stacks and domains kong2025survey ; yang2025survey ; hasan2025model ; hou2025model . Our Approach. FoA replaces static, topic-centric wiring with dynamic, capability-driven orchestration , aligning with calls for semantics-first coordination in agent ecosystems kong2025survey ; yang2025survey ; shen2023hugginggpt ; wu2024autogen . Agents publish (VCVs), structured, versioned profiles embedded in a high-dimensional space, so capabilities become searchable artifacts compatible with emerging interoperability efforts (e.g., Model Context Protocol (MCP)-based capability schemas) hasan2025model ; hou2025model . We index VCVs using a sharded Hierarchical navigable small world (HNSW) index to support sublinear matching at scale while preserving nuanced distinctions among related skills malkov2018efficient . At dispatch time, FoA applies semantic routing that couples profiles’ similarities with policy checks and resource budgets (i.e., latency, bandwidth, energy consumption), rather than relying on keywords or static registries aws2025multillm ; neupane2025towards . Operational feasibility is enforced with transport-aware choices for IoT settings, where the Message Queuing Telemetry Transport (MQTT) protocol provides efficient, reliable delivery under constrained networks mqttv5 ; emqx2024harnessing ; alotaibi2024secure . For dynamic task decomposition , FoA elicits candidate breakdowns from compatible agents and merges them into a consensual directed acyclic graph DAG, drawing on role-structured collaboration patterns from multi-agent systems hong2024metagpt ; li2023camel . Finally, intelligent orchestration optimizes assignments over semantic fit and operational cost, supporting centralized and decentralized modes xiong2025self ; piao2025agentsociety ; this aligns with distributed orchestration needs observed in infrastructures such as CAFEIN ® , CERN’s federated AI platform, where privacy-preserving data access and cross-institution coordination are central constraints cafein ; santos2024federated . Contributions. We make three technical contributions to enable capability-driven orchestration of heterogeneous agent federations: (1) Versioned Capability Vectors (VCVs) , a machine-readable representation that transforms agent capabilities, costs, and constraints into searchable semantic embeddings indexed via sharded HNSW for sub-linear retrieval at scale. (2) Dynamic collaborative decomposition , where compatible agents jointly propose subtask breakdowns that the orchestrator merges into a consensus DAG, coupling task structure with operational budgets rather than relying on static decomposition. (3) Smart clustering protocols that group agents working on identical subtasks into collaborative channels for k -round refinement, balancing diverse perspectives against communication overhead through hierarchical similarity-based partitioning. Unlike prior works, which rely on manual wiring or role-centric dispatch without a searchable capability registry, FoA’s VCVs enable policy and cost-aware semantic routing and consensus DAG execution; a registry and transport-level substrate for clustered collaboration with explicit policy labels. FoA achieves 13 \times improvement over single-model baselines on the HealthBench hard benchmark. 2 Background and Related Works Agentic AI Systems: Communication Protocols and Architectures. Agentic AI represents a paradigm shift from traditional AI systems that execute single tasks to systems that can plan, reason, and coordinate over extended horizons. Recent surveys differentiate AI agents , modular systems optimized for specific tasks, from agentic AI systems , which orchestrate collections of agents, decompose complex goals, and maintain persistent context across interactions sapkota2025ai ; schneider2025generative ; gridach2025agentic . The key insight is that while individual AI agents excel at specific tasks, complex problems often require the coordinated effort of multiple specialized agents belcak2025small . This motivates research on scalable coordination mechanisms, communication protocols, and orchestration strategies that can manage the complexity of multi-agent systems. A parallel research line examines communication protocols and architectures for LLM-driven agents. Both Yang et al. yang2025survey and Kong et al. kong2025survey provides a comprehensive analysis of agentic AI protocols, highlighting the lack of standardized communication methods between agents, tools, and data sources. Their classification distinguishes context-oriented protocols that support local tool invocation from inter-agent protocols that enable cooperative behaviour, and contrasts general-purpose versus domain-specific solutions. Comparative assessments reveal trade-offs between security, scalability, and latency across existing protocols and call for next-generation designs with adaptability, privacy preservation, and group-based interaction. Emerging work also demonstrates that successful agentic architectures require robust trust, risk, and security management frameworks raza2025trism , particularly as these systems increasingly operate in safety-critical domains. The theoretical foundations underlying agentic coordination suggest that these systems would benefit from established systems theory principles to manage their inherent complexity and emergent behaviours miehling2025agentic . Furthermore, practical implementations of agentic AI are showing promise across diverse application domains, from industrial automation piccialli2025agentai to healthcare compliance neupane2025towards , demonstrating the broad applicability of coordinated multi-agent approaches. Complementary work on MCP anthropic2024mcp ; hou2025model ; mcp2024transports ; hasan2025model proposes a standardized interface for connecting language models to external tools. However, most of the MCP implementations currently rely on HTTP and Server-Sent Events, introducing security concerns narajala2025securing and limiting their applicability to critical contexts or resource-constrained environments. Multi-Agent Orchestration and Coordination Researchers have explored various orchestration frameworks for coordinating agentic AI workflows across distributed systems. Multi-agent architectures leverage specialized agents with distinct capabilities: sensing, learning, reasoning, predicting, and executing that must be orchestrated to handle complex tasks through peer coordination belcak2025small . Recent frameworks like HuggingGPT shen2023hugginggpt , AutoGen wu2024autogen , and MetaGPT hong2024metagpt demonstrate sophisticated orchestration patterns where a central coordinator routes tasks to specialized agents based on their capabilities. Self-organizing agent networks xiong2025self enable dynamic workflow automation where agents autonomously form task-specific coalitions without centralized control. Communication protocols like CAMEL li2023camel promote structured inter-agent dialogue for collaborative problem-solving. Modern multi-LLM routing strategies employ various orchestration approaches, including static rule-based routing, dynamic model selection based on task complexity, and learned routing policies that optimize for performance and costs aws2025multillm ; li2025towards . Despite their strengths, these frameworks hinge on fixed roles and hand-wired coordination, lacking a searchable capability registry, cost-/policy-aware semantic routing, and standardized collaboration protocols needed for enterprise-scale deployment. MQTT as Transport Layer for Distributed Agent Systems To provide a message passing layer between AI agents, the MQTT protocol mqttv5 provides a stack of tools for large-scale distributed systems communication through its lightweight publish/subscribe semantics. Unified namespace (UNS) patterns leverage MQTT’s topic hierarchy to create a semantic addressing scheme that eliminates data silos and enables seamless agent interoperability peter2024impact . Unlike traditional request-response architectures, MQTT’s event-driven model naturally supports the asynchronous, many-to-many communication patterns required by multi-agent systems emqx2024harnessing ; wong2025intelligent . Recent developments extend MCP over MQTT, replacing HTTP’s synchronous constraints with MQTT’s scalable pub/sub architecture for distributed agent coordination emqx2025mcp-mqtt ; ji2025emqx-mcp-server ; emqx2025mcp-gateway ; espressif2025esp32mcp . This transport choice enables capability discovery across thousands of heterogeneous agents while maintaining sub-second latency and reliable message delivery under varying network conditions alotaibi2024secure ; curasma2024agents ; elewah2025agentic . The protocol’s inherent support for Quality of Service guarantees, retained messages, and wildcard subscriptions makes it particularly suited for orchestrating global-scale agent federations kong2025survey ; yang2025survey ; hasan2025model ; hou2025model . Figure 2: Orchestrator-driven Sub-task Decomposition and Semantic Routing. The orchestrator receives a complex task, proposes subtasks (1-5), embeds each subtask, and compares them to agent capability embeddings to form a similarity matrix. Using similarity, cost, and policy constraints, it assigns each subtask to the most compatible agent or cluster (right-hand mapping). 3 Federation of Agents System Architecture This section details the core artifacts and mechanisms that compose our semantics-aware orchestration. We first introduce the artifacts’ Specs that guide each agent’s behaviour, then describe how these are embedded into our searchable profiles’ representation. Furthermore, we characterise the orchestrator (Agent-0) and the worker agents (Agent-1) before discussing the formation of semantic clusters and the DAG that governs execution order (Fig. 1 ). In this work, federation of agents refers to runtime orchestration across heterogeneous agents and transports with policy-guarded data flow and capability discovery. This is distinct from federated learning (FL), which concerns privacy-preserving model training. FoA can optionally include an FL training phase by storing model-update and differential-privacy parameters in VCVs and scheduling training/aggregation as DAG nodes; our experiments in this paper focus on the inference-time orchestration setting. Artifacts. Each agent is associated with a model specification , or Spec , a document listing the agent’s goals, tools, resources, rules, and principles. Inspired by alignment frameworks emphasising that language assistants should be helpful , harmless and honest ouyang2022training ; askell2021general , a Spec typically combines high-level imperatives ("assist the user"; "do not break the policies") with detailed dos and don’ts (e.g., avoid certain words, report emergencies, respect privacy). Recent work on reinforcement learning from human feedback (RLHF) shows that language models can be fine-tuned to follow such instructions by leveraging human preference data and learning a reward model ouyang2022training ; the resulting models more often adhere to the helpful, honest, harmless (HHH) criteria than models trained purely on next-token prediction askell2021general . In our framework, each agent memorises its Spec through such alignment techniques and learns to reason over it to follow instructions, refuse harmful requests, and resist the temptation to hallucinate citations or fabricate task completion (honest) as emphasised in alignment studies ouyang2022training ; askell2021general ; yang2024alignment . Specifications become machine-readable by embedding them into our VCVs using a specialised tokenizer and passed through a sentence-embedding model nussbaum2024nomic ; choi2025embeddinggemma to obtain a dense vector summarising the agent’s profile. This spec embedding augments the agent’s skill and resource representations, ensuring that subsequent semantic routing takes account of both functional ability and behavioural constraints. Embedding Specs allows the orchestrator to query not only "who knows how?" but also "who aligns with what policies?" . Versioned Capability Vectors. A Versioned Capability Vector encodes the state of an agent in a searchable form. For agent a_{i} , we define \mathrm{VCV}_{a_{i}}=\bigl(\mathbf{c}_{a_{i}},\mathbf{s}_{a_{i}},\mathbf{r}_{a_{i}},\mathbf{p}_{a_{i}},\mathbf{e}_{a_{i}},v_{a_{i}}\bigr), (1) where \mathbf{c}_{a_{i}}\in\mathbb{R}^{d} is a dense capability embedding describing the agent’s core competencies, \mathbf{s}_{a_{i}}\in\{0,1\}^{\ell} is a Bloom filter over discrete skills, \mathbf{r}_{a_{i}}\in\mathbb{R}^{m} records resource requirements and quality-of-service guarantees (e.g., latency budget, energy consumption), \mathbf{p}_{a_{i}}\in\{0,1\}^{p} encodes policy compliance flags (e.g. regulatory and security labels), \mathbf{e}_{a_{i}}\in\mathbb{R}^{d^{\prime}} is the spec embedding described above, and v_{a_{i}}\in\mathbb{N} is a version counter. The capability embedding \mathbf{c}_{a_{i}} is produced by feeding a natural-language description of the agent’s abilities through a pre-trained language model \psi:\mathcal{G}\to\mathbb{R}^{d} . Each time an agent updates its capabilities or specification, its version number increments, and a new VCV is broadcast. Orchestrator (Agent-0). We call the orchestrator of the federation Agent-0 (A-0). When an external task arrives, the orchestrator consults the current VCV index to discover candidate agents, performs dynamic decomposition, forms clusters, and orchestrates their collaboration. It maintains a sharded HNSW index over VCV embeddings to support sub-linear retrieval at scale. It also runs a lightweight \Delta -gossip protocol to propagate VCV updates: rather than broadcasting full capability vectors, agents periodically exchange only the deltas between their local VCV sets. Task metadata and VCV updates are disseminated over MQTT foa/meta and foa/retain topics, respectively, allowing asynchronous, broadcast communications. During execution, the orchestrator subscribes to cluster channels (described in Sec. 4 ) and collects completion signals and intermediate artefacts. It merges partial results along a sub-task execution graph by traversing it in topological order, ensuring that dependencies are satisfied before downstream subtasks are synthesised. At completion, it publishes the final output on a foa/result topic, updates individual agents’ reputations based on grading feedback before disposing of them. Decomposition and scheduling. The orchestration process begins when Agent-0 receives a task t from the environment. Rather than attempting to solve complex tasks monolithically, our system employs a hierarchical decomposition strategy that leverages the collective intelligence of the agent pool. Agent-0 first embeds the task description into a semantic space, then initiates a cooperative planning routine where multiple specialized agents propose candidate decompositions based on their domain expertise. These perspectives are synthesized into a consensual directed acyclic graph G=(V,E) , where vertices represent atomic subtasks and edges encode execution dependencies. When the task structure is established, the orchestrator performs optimal agent assignment. To capture unique capabilities, resource constraints, and performance characteristics, we introduce a scoring function that evaluates agent-subtask pairs across four complementary dimensions: \alpha_{s_{i},a_{j}}=\operatorname{sim}\bigl(\mathbf{c}_{s_{i}},\mathbf{c}_{a_{j}}\bigr)\,\cdot\,\mathbb{I}\bigl[\mathbf{p}_{s_{i}}\subseteq\mathbf{p}_{a_{j}}\bigr]\,\cdot\,f\bigl(\mathbf{r}_{s_{i}},\mathbf{r}_{a_{j}}\bigr)\,\cdot\,g\bigl(\mathbf{e}_{s_{i}},\mathbf{e}_{a_{j}}\bigr), (2) where \operatorname{sim} measures semantic alignment between the subtask requirements and agent capabilities in the embedding space, the indicator \mathbb{I} ensures policy compliance (required permissions \mathbf{p}_{s_{i}} are within the agent’s authorization set \mathbf{p}_{a_{j}} ), f is instantiated as a monotone penalty over resource gaps (latency, bandwidth, memory), decreasing as \|\mathbf{r}_{s_{i}}-\mathbf{r}_{a_{j}}\| increases, and g is instantiated as cosine similarity between specification embeddings g(\mathbf{e}_{s_{i}},\mathbf{e}_{a_{j}})=\cos(\mathbf{e}_{s_{i}},\mathbf{e}_{a_{j}})\in[-1,1] after \ell_{2} -normalization. This makes the gate explicit: any failed policy check zeros the score; otherwise, the score is down-weighted by resource mismatches and boosted by spec alignment. The orchestrator then transforms these compatibility scores into a concrete execution plan through constrained optimization. Formally, given k=|\mathcal{S}| subtasks and n=|\mathcal{A}| available agents, Agent-0 computes an optimal binary assignment matrix \mathbf{X}\in\{0,1\}^{k\times n} that maximizes the expected utility: \max_{\mathbf{X}}\sum_{i=1}^{k}\sum_{j=1}^{n}x_{ij}\,\alpha_{s_{i},a_{j}}\,\mathrm{perf}_{a_{j}}, (3) subject to capacity constraints and at-most- r_{i} team size per subtask: \sum_{j}x_{ij}\in[1,r_{i}] for all i (single-agent when r_{i}{=}1 ). The resulting \mathbf{X} gives the candidate team for each s_{i} ; cluster formation (Sec. 4 ) then groups selected agents solving the same s_{i} for k -round collaborative refinement before synthesis. This resolves the earlier single-agent/cluster tension by making teams first-class and clusters a subsequent refinement stage. Agents (Agent-1). Agents form the workforce of the federation. Each Agent-1 (A-1) is wrapped around a pre-aligned language model using Group Relative Policy Optimization (GRPO) shao2024deepseekmath . The alignment leverages its Spec as a reward function and local domain data (documents, databases, and API outputs) to specialise the agent’s behaviour. Agents have access to a tool-use controller that automatically selects retrieval or computation tools (e.g., vector search, SQL query, web API) based on the current task; the available tools and corpora are reflected in the agent’s VCV resource vector \mathbf{r}_{a_{i}} . Internally, each agent maintains a scratchpad to store intermediate reasoning and implements the instructions in its Spec; for example, it declines unsafe requests and signals uncertainty when the Spec mandates honesty. When assigned a subtask, Agent-1 generates an initial draft solution by integrating its model output with the retrieved context. It then participates in cluster-based refinement rounds. To encourage diverse perspectives and reduce hallucinations, we group agents solving the same subtask into semantic clusters. Given a set of candidate agents \mathcal{A}_{s_{i}} for subtask s_{i} , we compute a similarity matrix combining (i) the cosine similarity between their capability embeddings \mathbf{c}_{a_{j}} , (ii) the similarity of their preliminary outputs (once available) and (iii) the overlap of their spec embeddings \mathbf{e}_{a_{j}} . Hierarchical clustering on this matrix yields clusters C_{1},\dots,C_{m} of A-1 agents. Within each cluster, agents exchange intermediate drafts and critiques for k rounds using the topic foa/clusters/{cluster_id}/channel . After each round, they vote on whether to stop; once consensus is reached, the cluster emits a TASK_COMPLETE signal and returns a refined subtask result. Clustering thus enables collaborative refinement akin to peer review while limiting communication overhead. 4 Federation of Agents Execution Flow In this section, we analyze the life cycle of a single task handled by FoA. The framework orchestrates the end-to-end execution of a complex problem through a six-phase pipeline that captures decomposition, drafting, collaboration, and synthesis. Formally, given an incoming task t provided by the environment and a set of agents \mathcal{A} equipped with VCV, the orchestrator A-0 establishes a DAG G=(\mathcal{S},E) of sub-task execution order whose vertices correspond to (sub-task, A-1) pairs and whose edges encode relational dependencies between sub-tasks. Each phase described below operates on G and updates its state until all nodes get detached from G by completing sub-tasks or by receiving a DISPATCH signal. Sub-task decomposition, consensus, and assignment. Upon receiving a task t from the environment, Agent-0 embeds its natural-language description into the semantic space and queries the VCV index for candidate agents. Each compatible agent a_{j} returns a proposal consisting of a set of subtasks \mathcal{S}_{a_{j}} and a set of dependencies E_{a_{j}} describing how those subtasks should be ordered. Agent-0 collects these proposals, merges them via a consensus mechanism, and validates acyclicity, thereby producing a global DAG G=(\mathcal{S},E) with \mathcal{S}=\bigcup_{j}\mathcal{S}_{a_{j}} and E=\bigcup_{j}E_{a_{j}} . The orchestrator then solves the assignment problem introduced in Sec. 1 : it computes scores \alpha_{s_{i},a_{j}} for each subtask-agent pair based on semantic alignment, policy compliance, resource fit, and specification similarity. Solving the resulting integer program yields an assignment matrix \mathbf{X}\in\{0,1\}^{|\mathcal{S}|\times|\mathcal{A}|} that maps each subtask s_{i} to A-1 agents while respecting capacity constraints. FoA organises execution around G : leaves (subtasks with no incoming edges) can begin immediately, whereas internal nodes s_{i} wait until all predecessors s_{j} with (s_{j}\to s_{i})\in E have reported completion. A SYNTH tool combines results from predecessors when triggering a downstream subtask, enabling partial results to propagate forward without blocking unrelated branches and facilitating fine-grained concurrency in large workflows. First draft with resource access. Once assigned to a subtask s_{i} , each A-1 retrieves relevant context from its local resources, such as databases or external tools, via tool-use controllers embedded in A-1. Conditioning on this context and its specification embedding \mathbf{e}_{a_{j}} , the agent produces a first-draft answer d_{i}^{(j)} for the subtask. This draft anchors subsequent refinement, which is posted to a cluster-specific MQTT channel associated with s_{i} . The retrieval step could implement an additional resource-aware step: the agent consults its resource vector \mathbf{r}_{a_{j}} to adjust re-spawn parameters, ensuring that within clusters, A-1 size (in GB of GPU vRAM), throughput velocity (in tok/sec), context window of the channel, and maximum budget of available tokens to produce solutions do not exceed latency or energy constraints. As shown later in Sec. 5 , we found it practical to set-up A-1 as a pre-aligned small language model ( \leq 20B params) for fast-feedback execution of multiple refinement rounds over long-term horizons ouyang2022training ; ji2023ai ; belcak2025small . Cluster formation via semantic similarity. Agent-0 groups the agents assigned to the same subtask into collaborative clusters based on their capability vectors and preliminary outputs. Concretely, for subtask s_{i} with assigned agents \mathcal{A}_{s_{i}} , we compute a similarity matrix combining (i) the cosine similarity of their capability embeddings \mathbf{c}_{a_{j}} , (ii) the cosine similarity of their draft embeddings and (iii) the overlap of their spec embeddings \mathbf{e}_{a_{j}} . Hierarchical clustering on this matrix yields clusters C_{1},\dots,C_{m} of size chosen to balance diversity against coordination overhead. A dedicated cluster channel foa/clusters/{cluster_id}/channel is created on the MQTT broker for each cluster, allowing members to share messages without interfering with other topics. Fig. 3 illustrates the refinement process inside a high-similarity cluster. Figure 3: Collaborative refinement inside a high-similarity cluster. Agents with closely aligned capabilities on the same subtask are grouped into a cluster, exchange drafts and critiques for k refinement rounds, and upon consensus emit TASK_COMPLETE to return a final subtask result to the orchestrator for synthesis. Intra-cluster execution Within each cluster C_{j} , agents iteratively refine their drafts. At round r , every A-1 agent posts its current draft to the cluster channel and receives the drafts of its peers (Fig. 2 ). Agents critique and update their own answers by integrating insights from others, using simple majority voting or reputation-weighted aggregation to decide which components to adopt. Formally, let \mathcal{M}_{s_{i},C_{j}}^{(r)} denote the multiset of messages exchanged at round r ; refinement continues for k rounds or until a consensus signal is triggered. Throughout this process, agents adhere to their Specs: they refuse to produce unsafe content, annotate uncertainties when appropriate, and propagate provenance metadata with each message. This collaborative refinement functions as a peer-review cycle that aims to improve factuality and reduce hallucinations. Reporting to the orchestrator. When the agents in cluster C_{j} reach consensus on a refined answer \hat{d}_{i}^{(j)} for subtask s_{i} , they emit a TASK_COMPLETE message on their cluster channel. This message contains the final answer along with evaluation metrics (e.g., confidence scores) computed by the cluster. Agent-0 subscribes to all cluster channels and listens for these completion signals. Upon receiving TASK_COMPLETE for s_{i} , it marks the node as finished in the DAG G and stores the result for use by downstream subtasks. If no consensus is reached within a predefined timeout, A-0 either reassigns the subtask to another agent or accepts the highest-scoring draft according to its evaluation function, thereby preventing deadlock. Result synthesis. After all clusters have reported completion, A-0 traverses G in topological order. For each subtask s_{i} , it invokes the SYNTH operator to combine the results of its predecessor subtasks with the refined answer for s_{i} : \mathbf{sol}_{s_{i}}=\texttt{SYNTH}\bigl(\{\mathbf{sol}_{s_{j}}:(s_{j}\to s_{i})\in E\}\cup\{\hat{d}_{i}^{(j)}\}\bigr). (4) This operator may concatenate texts (default solution), resolve conflicting assertions across cluster outputs (i.e., rebase ), or summarise divergent perspectives into a unified answer (i.e., merge ). We implement SYNTH via meta-prompting suzgun2024meta by steering the internal chain-of-thought of A-0 wei2022chain . Once all leaves in the DAG are executed and their results propagated forward, the final answer for the original task t is obtained at the root of G . A-0 then publishes the final solution on foa/result MQTT topic, updates the reputations of participating agents based on the quality of their contributions, and archives their updated VCVs for future routing decisions. Many phases are parallelized and cluster sizes are capped (3-5), supporting horizontal scalability before large-scale deployment. We quantify end-to-end complexity in Appendix ( A ). 5 Evaluation and Experimental Results We evaluate the FoA framework on OpenAI’s HealthBench Hard arora2025healthbench , a comprehensive benchmark for assessing language models in healthcare contexts. HealthBench Hard comprises 1,000 multi-turn conversations between models and users (both healthcare professionals and patients), with responses evaluated against physician-written rubrics spanning 48,562 unique criteria. The rubrics assign positive or negative points depending on whether a response satisfies desirable or undesirable criteria; scores range between -10 and 10 and are combined into a per-example score by a model-based grader that has been validated against physician judgments. The overall HealthBench score is obtained by averaging per-example scores and clipping the mean to the range [0,1] . Unlike traditional multiple-choice medical benchmarks, HealthBench contains an open-ended nature of real healthcare interactions through conversation-specific evaluation across seven themes (emergency referrals, context seeking, global health, health data tasks, expertise-tailored communication, responding under uncertainty, and response depth) and five behavioural axes (accuracy, completeness, context awareness, communication quality, and instruction following). In Sec. C , we provide additional details on specific configuration parameters and implementation decisions. Main Results. Fig. 4 summarises the performance of FoA and the baselines on HealthBench Hard. FoA achieves an overall score of 0.13 , a 13x relative improvement over the best single agent baseline (Medgemma sellergren2025medgemma ) and a 6.5x improvement over the uncoordinated ensemble. Random assignment performs markedly worse, underscoring the importance of capability-aware routing. FoA consistently outperforms baselines across all seven themes. The collaborative cluster protocol particularly benefits high-stakes questions where multiple perspectives improve accuracy and context awareness. Figure 4: HealthBench Hard results. We report the overall score (mean \pm bootstrap s.d.) and per-axis scores for FoA and baselines. Individual example scores can be negative, but average scores are clipped to zero. 6 Conclusion & Discussion We presented Federation of Agents (FoA), a semantics-aware communication fabric that enables dynamic, capability-driven orchestration of large-scale multi-agent AI systems. Through machine-readable Versioned Capability Vectors (VCVs) and cost-aware semantic routing, FoA transforms static topic-based coordination into a scalable infrastructure for efficient reasoning over extended horizons, solving a coordination problem in agentic AI regarding who can do what, at what cost, and with what reputation? Limitations and Open Research Questions. Several challenges limit our current approach and represent important directions for the community. The effectiveness of semantic routing is bounded by embedding quality, creating a cold-start problem where agents with novel capabilities may remain underutilized until sufficient interaction data is collected. Our clustering algorithm may form sub-optimal groups when task similarity metrics fail to capture true collaboration potential, triggering a fallback mechanism that often leads to reduced effectiveness in heterogeneous domains. The VCV representation, while expressive, may not capture complex compositional capabilities or dynamic skill emergence during agent execution. Communication overhead scales quadratically within clusters, limiting the practical cluster size to 3-5 agents. Additionally, while our reputation and policy enforcement mechanisms provide robust security against honest-but-curious adversaries, sophisticated attacks such as coordinated Sybil networks or adversarial capability misrepresentation remain open challenges that can be mitigated by using sandbox executions santos2024federated . Future Research Directions. Our immediate research focuses on four critical frontiers. First, we will develop reinforcement learning-based adaptive routing controllers that can dynamically optimize cost-biasing, matching thresholds, and clustering parameters based on real-time network performance and evolving task priorities. Second, we plan to explore cross-cluster communication protocols to enable knowledge sharing between related clusters while maintaining scalability. Third, we will integrate zero-knowledge proof systems and trusted execution environments to enable verifiable capability attestations, directly addressing the trust assumptions in our current design, integrating the security and safety measures of santos2024federated in FoA. Broader Impact and Societal Considerations. Large-scale federations of AI agents present both transformative opportunities and significant risks. On the positive side, democratizing access to specialized AI capabilities could accelerate scientific discovery, improve resource allocation efficiency, and enable more responsive technological infrastructures. However, the concentration of autonomous decision-making capabilities raises concerns about algorithmic bias amplification, privacy preservation across agent boundaries, and the increasing opacity of accountability structures. The governance mechanisms embedded in FoA, including auditable provenance trails and policy-as-code enforcement, represent necessary but insufficient steps toward responsible deployment. The broader AI community must engage in continued dialogue about appropriate legal frameworks, ethical guidelines, and oversight mechanisms for autonomous agentic ecosystems. In conclusion, the Federation of Agents provides a theoretically grounded and practically scalable approach to multi-agent coordination that transforms capabilities and constraints into a searchable, auditable substrate. Our smart clustering innovations demonstrate that collaborative refinement can significantly improve solution quality while maintaining computational tractability. Addressing core challenges in semantic routing, distributed orchestration, intra-agent collaboration, and trust management establishes a foundation for the next generation of collaborative AI systems. The 10x performance improvements on HealthBench with respect to the best single agent validate the practical benefits of capability-driven orchestration with smart clustering. We invite the research community to build upon these contributions as we collectively advance toward more capable, trustworthy, and socially beneficial agentic AI ecosystems. Appendix A Detailed Algorithm Analysis In this section, we formalise each stage of the FoA execution pipeline from an algorithmic perspective. Our analysis clarifies the internal mechanics and quantifies the computational complexity to link the design to prior literature. We follow the six phases outlined in Section 4 : (1) dynamic task decomposition, (2) first draft generation, (3) cluster formation, (4) intra-cluster consensus, (5) reporting, and (6) synthesis. Phase 1: Dynamic task decomposition and consensus. Given an input task t , the orchestrator searches for compatible agents and constructs a directed acyclic graph (DAG) of subtasks. The procedure, formalised in Algorithm 1 , embeds the task into the capability space, evaluates each agent’s compatibility score against semantic, policy, and resource criteria, and queries a sharded HNSW index to retrieve the most promising candidates. Selected agents propose candidate subtask sets and dependency structures; these proposals are merged via a consensus mechanism into a single DAG and validated for acyclicity and consistency. Our design draws inspiration from recent multi-agent frameworks that dynamically decompose complex tasks into manageable subtasks and tailor subagents for each subproblem. With this dynamic decomposition based on intermediate results and dedicated subagents assignments, FoA avoids the error propagation and static limitations of preliminary decomposition schemes. Algorithm 1 Dynamic Task Decomposition Protocol 1: Task \texttt{t}\in\mathcal{T} , Set of A-1 Agents \mathcal{A} , threshold \tau , policy constraints \mathbf{P} 2: Task DAG G=(V,E) with subtasks V=\mathcal{S} and dependencies E 3: Phase 1a: Task embedding and agent scoring 4: \mathbf{c}_{\texttt{t}}\leftarrow\psi(\texttt{t}) \triangleright embed task description into capability space 5: \mathcal{A}_{comp}\leftarrow\emptyset \triangleright candidate agent set 6: for each a_{i}\in\mathcal{A} do 7: \alpha_{t,a_{i}}\leftarrow\operatorname{sim}(\mathbf{c}_{t},\mathbf{c}_{a_{i}})\cdot\mu(\mathbf{P},\mathbf{p}_{a_{i}})\cdot\text{cost}(\mathbf{r}_{t},\mathbf{r}_{a_{i}}) 8: if \alpha_{t,a_{i}}>\tau then 9: \mathcal{A}_{comp}\leftarrow\mathcal{A}_{comp}\cup\{a_{i}\} \triangleright retain compatible agents 10: end if 11: end for 12: if |\mathcal{A}_{comp}|=0 then 13: \mathcal{A}_{comp}\leftarrow\text{TopK}(\mathcal{A},\operatorname{sim}(\mathbf{c}_{t},\mathbf{c}_{a_{j}}),k) \triangleright fallback retrieval 14: end if 15: Phase 1b: Collaborative proposal and merge 16: \mathcal{S}_{prop}\leftarrow\emptyset , E_{prop}\leftarrow\emptyset 17: for each a_{i}\in\mathcal{A}_{comp} do 18: \text{subtasks}_{a_{i}}\leftarrow\text{DECOMPOSE}(t,\mathbf{c}_{a_{i}}) \triangleright agent-specific decomposition 19: \text{deps}_{a_{i}}\leftarrow\text{ANALYZE\_DEPS}(\text{subtasks}_{a_{i}}) \triangleright local dependency analysis 20: \mathcal{S}_{prop}\leftarrow\mathcal{S}_{prop}\cup\text{subtasks}_{a_{i}} 21: E_{prop}\leftarrow E_{prop}\cup\text{deps}_{a_{i}} 22: end for 23: G\leftarrow\text{SYNTH\_PROPOSALS}(\mathcal{S}_{prop},E_{prop}) \triangleright consensus on subtask set and edges 24: G\leftarrow\text{VALIDATE\_DAG}(G) \triangleright remove cycles and inconsistencies 25: return G The time complexity of Phase 1 is dominated by evaluating compatibility scores and merging proposals. Let n=|\mathcal{A}| and m be the number of candidate agents retrieved; computing similarities for all agents requires O(n\,d) operations where d is the embedding dimension. Each agent proposes O(|\mathcal{S}|) subtasks; merging proposals requires at most O(m\,|\mathcal{S}|\log|\mathcal{S}|) time to reconcile duplicates and validate the DAG. Dynamic decomposition improves robustness by allowing later phases to adjust subtasks based on intermediate outputs, a key advantage over static splitting. Phase 2: First draft generation with resource access. Once the DAG is established and subtasks are assigned to agents, each agent retrieves context and produces an initial answer. The process resembles iterative reasoning methods such as ReAct [ 52 ] , Reflexion [ 53 ] , or Graph of Thoughts [ 54 ] , where intermediate thoughts guide subsequent actions. However, in FoA, the first draft is produced individually by each assigned agent before collaborative refinement. Algorithm 2 formalises this stage. Algorithm 2 First Draft Generation 1: Subtask s\in\mathcal{S} , assigned agent set \mathcal{A}_{s} 2: Draft set \mathcal{D}_{s} containing one draft per agent 3: \mathcal{D}_{s}\leftarrow\emptyset 4: for each agent a_{i}\in\mathcal{A}_{s} do 5: \text{context}\leftarrow\text{RETRIEVE\_RESOURCES}(s,a_{i}) \triangleright query local resources, use tools 6: \text{draft}\leftarrow\text{GENERATE\_ANSWER}(s,\text{context},\text{Spec}_{a_{i}}) \triangleright LLM inference conditioned on Spec 7: \mathcal{D}_{s}\leftarrow\mathcal{D}_{s}\cup\{(a_{i},\text{draft})\} 8: end for 9: return \mathcal{D}_{s} Each agent’s retrieval call and model inference contributes to the complexity of this phase. If r_{i} denotes the retrieval cost and t_{i} denotes the model run time for agent a_{i} , then the total complexity is O(\sum_{a_{i}\in\mathcal{A}_{s}}(r_{i}+t_{i})) . Because draft generation is parallel across agents, it scales horizontally with the number of assigned agents. Phase 3: Cluster formation via semantic similarity. To encourage team flow while controlling communication overhead, FoA groups agents working on the same subtask into clusters based on similarity across multiple dimensions (capability, resource cost, initial draft quality, and specification) [ 55 ] . The orchestrator builds a similarity matrix for \mathcal{A}_{s} and performs hierarchical clustering to partition agents into clusters. Algorithm 3 formalises this procedure. Algorithm 3 Semantic Cluster Formation 1: Subtask s , agents \mathcal{A}_{s} , draft set \mathcal{D}_{s} , weight vector (w_{1},w_{2},w_{3},w_{4}) 2: Cluster partition \mathcal{C}_{s}=\{C_{1},\dots,C_{m}\} 3: n\leftarrow|\mathcal{A}_{s}| 4: Initialize S\in\mathbb{R}^{n\times n} \triangleright similarity matrix 5: for each pair i