A Scalable Communication Protocol for Networks of Large Language Models

## Abstract

Abstract Communication is a prerequisite for collaboration.
When scaling networks of AI-powered agents, communication must be versatile, efficient, and portable.
These requisites, which we refer to as the Agent Communication Trilemma , are hard to achieve in large networks of agents.
We introduce Agora, a meta protocol that leverages existing communication standards to make LLM-powered agents solve complex problems efficiently.
In Agora, agents typically use standardised routines for frequent communications, natural language for rare communications, and LLM-written routines for everything in between.
Agora sidesteps the Agent Communication Trilemma and robustly handles changes in interfaces and members, allowing unprecedented scalability with full decentralisation and minimal involvement of human beings.
On large Agora networks, we observe the emergence of self-organising, fully automated protocols that achieve complex goals without human intervention.

## 1 Introduction

Human language evolved primarily for communication purposes (Fedorenko et al., ).
Despite its inherent ambiguity, natural language provides great versatility and allows humans and machines to collaborate and achieve complex goals that they otherwise could not (Russell & Norvig, ).

Decades of literature in computer science explored how to foster collaboration between agents modelled as programs (Wooldridge & Jennings, ; Gilbert, ).
Several research papers design networks of agents to solve complex problems by leveraging each model’s specialisation, the so-called rule-based agents paradigm (Wooldridge, ).
Despite its influence, such a paradigm faces two major limitations: agents hardly adapt to environmental changes and require structured data that limits their versatility (Gilbert & Terna, ).

With the advent of Large Language Models (LLM) (Vaswani et al., ; Brown et al., ), there has been a resurgent interest in networks of collaborative agents.
LLMs can solve a variety of problems (Achiam et al., ; Dubey et al., ) expressed in natural language as they excel at following instructions (Schulman et al., ; Rafailov et al., ).
LLMs also showed remarkable improvements at handling structured data such as graphs and formatted languages (Kassner et al., ; Collins et al., ; Jin et al., ; Lin et al., ).

In terms of performance (e.g., accuracy on classification), the literature suggests that specialised LLMs outperform general purpose models (Hu et al., ; Zhang et al., ), as well as mitigating the difficulties of handling gargantuan models and the drawbacks of data and model centralisation (Song et al., ).

Thus, we hypothesise that:

However, networks of LLM-powered agents face three key challenges that make communication at scale significantly more difficult:

- •
LLMs are heterogeneous: different LLMs have different architectures, makers, capabilities and usage policies.(^1^11Heterogeneity is not unique to agents of LLMs, yet, compared to classic MAS agents, LLMs come with deeper representations of the surrounding environment and are thus more challenging to standardise.)
- •
LLMs are (mostly) general-purpose tools: enumerating and standardising each task they can perform is infeasible.
- •
LLMs are expensive: the computational footprint and inference time of “small” LLMs dwarfs that of comparable, specialised APIs.

Scalable communication between heterogeneous LLMs must be versatile, i.e., capable of handling a variety of use cases, efficient, i.e., requiring the least computational effort, and portable, i.e., supporting the protocol should require the least human effort possible.
The above-mentioned issues constitute the Agent Communication Trilemma, which we expand in Section 3.

In light of this, the aim of this paper is the following:

We sidestep the Trilemma with Agora, a meta protocol that relies on the dual use of structured data for frequent communications and natural language for infrequent ones. With Agora, we instantiate large networks of LLM-powered agents that solve complex tasks autonomously by leveraging efficient communications schemas.
In such networks, we observe agents develop an emergent fully automated protocol to solve a complex task starting from an instruction expressed in natural language.
We believe that this observation can serve as a basis to renew interest in emergent protocols/languages in large networks of LLMs (Lazaridou et al., ; Chaabouni et al., ; Lazaridou & Baroni, ; Chaabouni et al., ).

The paper is structured as follows.
We first outline the key challenges that constitute the Agent Communication Trilemma (Section 3); we then detail how Agora addresses the Trilemma and serves as a communication protocol for networks of LLMs (Section 4).
Finally, in Section 5, we provide two fully functional demos(^2^22Our code is available at [github.com/agora-protocol/paper-demo](https://github.com/agora-protocol/paper-demo).): the former, with two agents, to clarify Agora’s operating principles; the latter, with 100, to prove Agora’s scalability and show the emergence of self-organising behaviours.

## 2 Related Work

#### Multi-agent LLMs and communication.

At the time of writing, Multi-Agent-Systems of Large Language Models (MAS-LLM) have become an active area of research (Guo et al., ) after the upsurge of LLMs as general purpose problem solvers (Brown et al., ; Achiam et al., ; Dubey et al., ).
Many fields have adapted techniques from the MAS-LLM paradigm to solve problems single models fail at, including reasoning and math (Li et al., ), Theory of Mind (Cross et al., ; Li et al., ), planning (Singh et al., ), alignment to human values (Pang et al., ), and simulation of games, economics, and political scenarios
(Bakhtin et al., ; Hua et al., ; Wu et al., ).
The common intuition of these works is that by breaking a task into sub-components (Hong et al., ) and allocating a large number of specialised models (Li et al., ) to each of them (Li et al., ), one can achieve higher performance and observe emergent behaviours that otherwise would not occur.

On the other hand, a key requisite for solving complex tasks in large networks of MAS-LLMs is effective and efficient communication.
In large networks, LLMs must agree on the actions to take (Chen et al., ): works such as Agashe et al. () and Liang et al. () studied how LLMs debate to foster collaboration on high-order tasks (Du et al., ).
Another recent line of research explores the topology of the MAS-LLM network as a facilitator to reach consensus (Chen et al., ).

#### LLMs for simulations and emergence of protocols.

A few seminal works studied how emergent communication and protocols arise between neural networks that manipulate symbols (Havrylov & Titov, ; Lazaridou et al., ; Lazaridou & Baroni, ).
Written before the rise of LLMs, these works inspired researchers to explore how spontaneous collaboration emerges in MAS-LLMs (Wu et al., ), with application to simulation of *societies* (Gao et al., ).
Of particular interest for this paper are the works by Chaabouni et al. () and Chaabouni et al. (). Chaabouni et al. () describes how emergent communication systems between neural networks privilege longer messages. Chaabouni et al. () posits the existence of “scaling laws” (Kaplan et al., ) for large networks of MAS-LLMs in which the dataset, task complexity, and population size are the key to observe emergent behaviours.

## 3 The Agent Communication Trilemma

Figure: Figure 1: The Trilemma and how our solution (Agora) balances efficiency, portability and versatility.
Refer to caption: img/triangle-trilemma.png

An agent is a computer system that, in an environment, is capable of autonomous actions (the so-called ‘agency’ (Horty, )) to meet its design objective (Wooldridge & Jennings, ; Wooldridge, , p. 15). Just as humans must negotiate and cooperate to achieve shared goals, so too must agents within multi-agent systems (Wooldridge, , p. 24-25).
However, when designing communication protocols for heterogeneous networks (i.e., networks where agents have different architectures, capabilities and design constraints), we run into difficulties when attempting to optimise for three properties at the same time:

- •
Versatility: communication between agents should support a wide variety of messages, both in terms of content and format;
- •
Efficiency: the computational cost of running an agent and networking cost of communication should be minimal;
- •
Portability: supporting the communication protocol should require the least implementation effort by the largest number of agents involved.

We name the trade-off between such properties the Agent Communication Trilemma, which is illustrated in Figure 1.
In the next sections, we will discuss how an LLM-powered communication protocol can trade off versatility, efficiency, and portability.

### 3.1 Versatile vs. Portable Communication

In networks of agents, versatility and portability are at tension for two fundamental reasons (Olivé, ).
A prerequisite for two agents who communicate is (1) a shared conceptual understanding of the topic on which they communicate.
For instance, two agents can communicate about the weather if they both ‘know’ what it means to be sunny, rainy and overcast.
For example, they should share a similar notion of describing and measuring temperature (e.g., in degrees Celsius).
In addition, (2) agents must encode and decode messages in a way that is intelligible for both.
Continuing the weather example, if two agents exchange data using JSON objects, both the sender and the receiver must know the syntax (e.g., the keys of a JSON object, such as temperature) and the semantics (e.g. temperature is a $32$-bit floating point value representing the temperature, in central London, as measured in degrees Celsius) of the exchanged messages.

In complex scenarios, defining routines whose syntax and semantics satisfy requisites (1) and (2) may be difficult.
For example, a programmer has to manually implement a method to decode (or decode) messages to (or from) other agents.
Additionally, the programmer must explicitly instruct the agent about how to manipulate and reason about the message content, often by interpreting API documentation describing the semantics of the message.
Therefore, there is a trade-off between the breadth of messages (versatility) and the implementation cost (portability).

An example of high-portability, low-versatility is the Open Banking Platform (OBP), which uses a well-defined Open API schema for data transfer (OBL, ). OBP is highly portable because it uses a fixed range of well-known concepts which developers can implement; however, it is restricted to discussing a narrow domain of banking data and is thus not versatile.
On the other end of the spectrum, rules-based Semantic Web agents (Berners-Lee et al., ) that exchange RDF (Beckett et al., ) encoded documents are highly versatile since ontologies (Wooldridge, , p. 180) enable the description of structured relations between essentially any concept. Still, they require developers to program agents to implement the specific ontologies used by the network (e.g., if a set of RDF triples states that the temperature is 38°C, an agent must be able to interpret the concepts of “temperature” and “Celsius”).

### 3.2 Efficient vs. Versatile and Portable Communication

As previously mentioned, rule-based agents excel at the tasks they are designed to solve but hardly adapt to new environments.
Decades of research in reinforcement learning (Sutton, ) and then in deep reinforcement learning (Arulkumaran et al., ; Henderson et al., ), introduced a paradigm where agents learn to optimise their reward as proxy of the task we want them to solve.
Agentic-LLMs, i.e., multi-agent systems powered by language models, is a recent paradigm for machine-to-machine communication that relies mostly on their proficiency at handling natural language and following instructions (Li et al., ).

Natural language is highly expressive, making it a suitable choice for versatile communication (Russell & Norvig, ).
Additionally, LLMs trained on massive corpora seem to develop an implicit understanding of various concepts that abstracts and makes communication independent from their internal architecture.
Moreover, LLMs can integrate external tools, write code and invoke APIs with relatively little or no training (Schick et al., ), since the only requirement is a natural-language description of the tool and its parameters.

Conversely, natural language as a communication medium has two major drawbacks.
While engineering and hardware improvements (Dubey et al., ) mitigate costs over time, the computational requirements of invoking an LLM dwarf those of comparable APIs, representing a major bottleneck for scaling networks of LLMs. On the other hand, using closed-source pay-per-usage LLMs hosted by third parties is expensive and raises concerns in terms of replicability of the results (La Malfa et al., ).
Additionally, natural language is inherently ambiguous: while LLMs have a certain degree of “common sense” to fulfil requests, non-determinism and natural language specifics leave space for errors that routines minimise (for instance, if someone asks for the temperature in Fahrenheit and the agent has a tool that returns the temperature in Celsius, the model must know that Celsius and Fahrenheit are both units of measure for temperature).
These factors make LLMs and natural language more prone to errors than other alternatives like handwritten APIs.

In conclusion, RESTful APIs (efficient), RDF tuples (portable) and natural language (versatile) are all trade-offs in the Trilemma.
While some approaches are more useful in practice than others, the fact that no communication format achieves all three properties simultaneously suggests that we need a hybrid communication protocol that leverages all of them. The next section outlines our solution.

## 4 Agora: a Communication Protocol Layer for LLMs

Figure: (a) An illustration of Agora and how it abstracts the underlying implementation, communication, and physical layers.
Refer to caption: img/evil.png

The key to solving the Communication Trilemma involves accepting that no single protocol can achieve optimal efficiency, portability and versatility at the same time.
In this section we introduce Agora, a meta protocol that takes advantage of the unique capabilities of LLMs to *sidestep* the Trilemma by adapting different communications methods for different scenarios.

The most powerful LLMs share three key properties:

- •
They can understand, manipulate, and reply to other agents using natural language;
- •
They excel at following instructions, including writing code to implement routines (Schick et al., ; Hou et al., ; Liu et al., );
- •
They can autonomously negotiate protocols and reach consensus on strategies and behaviours to adopt in complex scenarios (Chen et al., ; Fu et al., ).

At its core, Agora uses different communication formats depending on the circumstances; an agent can support a wide breadth of communications (high versatility) while handling the majority of the total volume of requests with efficient routines (high efficiency). Moreover, the entire negotiation and implementation workflow is handled by the LLMs and requires no human supervision (high portability).
The concept of protocol documents (PD), which we sketch in Figure 3 and discuss in the next section, lies at the core of Agora’s functionalities.

In the next sections, we illustrate the hierarchy of communication methods Agora supports natively and the concept of PD; we then provide an example of how Agora works and how it enables versatile, efficient, and portable communication. We conclude by emphasising how one can integrate and build upon Agora with further technological layers independently from its underlying technologies.

### 4.1 Communication in (an) Agora

Agora introduces a machine-readable way to transfer and refer to protocols, namely the protocol documents (PDs).
A PD is a plain-text description of a communication protocol.(^3^33Throughout this paper, we use the word “protocol” to refer to any standardised description of structured communication.)
PDs are self-contained, implementation-agnostic, and contain everything an agent needs to support a protocol: this means that most descriptions of existing protocols, such as RFCs, are also suitable PDs. However, instead of relying on a central body to assign identifiers, a PD is uniquely identified by its hash (for multiplexing).

In Agora, the most frequent communications have dedicated efficient routines, and the least frequent ones use inefficient but flexible LLMs and natural language. In particular:

- •
When possible, frequent communications are handled through traditional protocols, for which there are standard, human-written implementations (e.g., OBP);
- •
For communications that happen less frequently (or for which there are no standard protocols), agents can use structured data as an exchange medium (which can be handled by LLM-written routines);
- •
For communications that might be frequent for one side but not the other, the agents still use structured data, but one side can choose to use an LLM, while the other uses a routine;
- •
For rare communications or when a routine fails unexpectedly, the agents can resort to natural language.

It is entirely up to the agent to handle a query using a human-written routine, an LLM-written routine, or an LLM (or a combination of these three).
This gives the agent maximum flexibility over how to process queries.(^4^44Forcing or *nudging* a model to use a specific communication style can improve efficiency, yet its discussion is out of the scope of this paper. One can, for example, specify in the system prompt of an LLM to negotiate a protocol whenever possible.)
In the Demo (Section 5.3), we will illustrate the trade-off between the versatility of a communication protocol and its expected usage.

Hierarchical communications support any form of communication (maximum versatility)
, although in practice an LLM is invoked in very rare cases (maximum efficiency). Moreover, since LLMs can implement routines on their own (since PDs fully describe the syntax and semantics of a protocol), human programmers only need to provide an overview of the tools the agent has access to, which means that the implementation effort required on the human side is minimal (maximum portability).
In other words, Agora sidesteps the Communication Trilemma by employing routines for frequent requests and resorting to natural language when agents need to negotiate efficient ways to solve a problem or errors occur.

### 4.2 An Example of Communication over Agora

Figure: Figure 3: How a protocol document is negotiated between LLM-powered agents (left) and used for future efficient communications.
Refer to caption: img/pd-negotiation.png

We now describe how two agents, Alice and Bob, can efficiently communicate over Agora using a PD routine, as illustrated in Figure 3.
Alice initially sends a query with the hash of its corresponding PD.
Bob uses the hash to determine if he has a corresponding routine. If so, he calls it and handles the communication without invoking the LLM.
Otherwise, Bob handles the response with the LLM itself.

If Bob uses an LLM to reply several times to queries that follow a given protocol over time, to the point where using an LLM every time becomes expensive, he can use the LLM to write a routine that handles future communications.

If the routine fails or the communication is a one-off instance that does not require a protocol, Alice and Bob use natural language, which is again handled by the LLM. Natural language is also available to bootstrap communication between nodes that have never interacted before, as well as to negotiate new protocols. That said, the lower cost of routines and the lack of ambiguity are strong incentives for agents to prefer structured data.

Note that PDs can be shared with other nodes in the network, which means that two agents that have never interacted before can use protocols developed by other agents.

In the Appendix A, we provide details of five use cases of Agora to further show its versatility as a personal assistant and data analysis tool, and how it leverages compositionality and scalability to reduce costs.

### 4.3 Agora as a Layer Zero Protocol

Figure 2 illustrates that Agora is implementation and technology agnostic.
The implementation of the agents themselves (e.g., LLMs), the database used to store data (e.g., VectorDB, SQL, MongoDB, etc.), the language in which implementations are written (Python, Java, etc.) and the nature of tools are all abstracted.

At the same time, PDs can refer to other protocol documents, and since routines can call other routines, agents can build upon previous negotiations to solve more complex tasks.

Finally, the versatility and portability of Agora make it straightforward to handle the addition or removal of a node, a change in the capabilities of a node, or a change in the goals of the network, as illustrated in the demo, Section 5.3.

All these factors contribute to making Agora a natural *Layer Zero* protocol, i.e. a foundation layer, for higher-order communication and collaboration between LLMs. We hope our protocol can fuel theoretical and applied research on complex protocols, negotiation schemes, and consensus algorithms in large networks of LLMs.

## 5 Agora in Practice

We implement and showcase two scenarios where Agora can be applied.
The former, with two agents whose objective is to exchange some data; the latter, with $100$, to test Agora scalability and the capacity of LLM-powered agents to autonomously coordinate in complex scenarios.
For space reasons, the scenarios are further expanded in Appendices C and D; here, we instead focus on their functionalities and the key observations we drew in terms of efficiency/versatility/portability, reduction of costs, scalability and emergent behaviours of fully automated networks of LLMs.

### 5.1 Implementation Details

The design of Agora for our working demos follows three key principles:

- •
Minimality. Agora enforces the basic standards that allow for efficient negotiation and use of protocols, leaving everything else to PDs or other higher-order standards;
- •
Decentralisation. Agora does not rely on central authorities, with any collection of nodes being able to use Agora independently;
- •
Full backward compatibility. Agora supports existing communication protocols and schemas such as OpenAPI and JSON-Schema.

From a practical point of view, Agora uses HTTPS as base communication layer and JSON as format to exchange metadata.
When sending a message in a given protocol, an agent sends a JSON document with three keys: the protocol hash, the body of the request formatted according to the protocol, and a non-empty list of sources from which the protocol can be downloaded. The receiver downloads the PD from its preferred source and, upon checking that the hash matches, stores it for future uses. This hash-based identification system ensures that any node can reference any PD without relying on a central authority to assign identifiers.
Where PDs are stored is entirely up to the agents; aside from regular cloud storage, hash-based indexing makes decentralised storage options (such as IPFS Benet ()) viable. Additionally, since essentially all protocols can be stored as PDs, Agora has full backwards compatibility with existing protocols (although human programmers are encouraged to provide existing, standardised implementations instead of having the LLM re-implement them from scratch).

To simplify negotiation, an agent can expose an endpoint with a list of supported protocols: a potential sender can thus compare the list with its own to automatically determine if there is a common protocol. The sender can also use a potentially unsupported protocol, although the receiver can choose to reject it by returning a predefined error message.

Refer to LABEL:sec:\pname{}-specification for a more formal description of Agora.

### 5.2 Demo: Retrieving Weather Data

Consider two agents, Alice and Bob. Alice is a Llama-3-405B (Dubey et al., ) powered agent managing the bookings of a guided tour service in London.(^5^55While Llama-3 models can be hosted locally, for the sake of a proper comparison with GPT-4o and Gemini, we use a cloud provider, namely SambaNova ([https://sambanova.ai](https://sambanova.ai)).) Bob is a GPT-4o (Achiam et al., ) agent for weather service that provides weather forecasts for a given date and location.
As part of the user interaction loop, Alice notifies the user if heavy raining is expected on a booked date.

To check the weather, she initially uses her LLM to send a natural language query to Bob (phase A1):

Bob uses his Toolformer LLM (Schick et al., ) to query his database (phase B1) and returns a natural language reply (phase B2):

Over time, the cost of invoking an LLM for phases A1 and B2 dominate all the other costs; Alice and Bob thus decide to develop a protocol.
Alice checks if Bob already supports a suitable protocol but finds none.
Therefore, she decides to negotiate a protocol with Bob.
After a few rounds of negotiation, Alice and Bob agree on the following protocol: Alice sends a JSON document with two fields, location and date, and Bob replies with a JSON document containing three fields, namely temperature (in degrees Celsius), precipitation (in millimetres), and weatherCondition (one of “sunny”, “cloudy”, “rainy” and “snowy”).
From there on, Alice specifies the protocol hash when performing a query. An example of exchanged message (excluding Agora’s metadata) is:

Both Alice and Bob independently decide to write a routine to handle their side of the communication. From now on, Alice and Bob do not need to use the LLM to transmit traffic data: a routine now automates phases A1, B1 and B2 and leverages the costs of invoking the respective LLMs.

#### A cost analysis.

In our demo, negotiating the protocol and implementing the routines cost $0.043$ USD in API calls, compared to an average cost of $0.020$ USD for a natural-language exchange.
This means that, as long as Alice and Bob use the agreed-upon protocol more than twice, Agora reduces the overall cost. Please refer to Appendix C for a transcription of the negotiation process and the final protocol.

As a final note, we stress that the entire communication happened without human intervention. Additionally, should Bob become unavailable, Alice can simply reuse the PD with a new node that may use a different LLM/database/technology stack.

### 5.3 Demo: a Network of 100 Agents

Figure: Figure 4: Illustration of how in an Agora network with $100$ agents (left; for clarity, only the relevant sub-network is displayed), an emergent protocol for food delivery emerges (right).
Refer to caption: img/agora-100.png

We now show the scaling capabilities and emergent behaviours of Agora by considering a network of 100 LLM-powered agents. In particular, we scale the number of agents, which, as posited in Chaabouni et al. (), is a requisite for the emergence of complex behaviours in multi-agent networks.

We design a network of $85$ assistant agents interacting with $15$ server agents, all powered by LLMs.
The server agents offer various services, such as booking hotel rooms, calling taxis, ordering food, etc.
An example of a sub-network for food delivery is sketched in Figure 4, left.
Their specialisation is handled via prompting, as in Deshpande et al. (); Joshi et al. (); Li et al. ().
As part of their workflow, server agents must interact with several tools and databases; additionally, some servers need to interact with other servers to complete assistants’ requests (e.g., taxi services use the traffic data agent to adjust estimated fares for a run).
We bootstrap the network by leveraging the underlying communication layer (as described in Section 4 and Figure 2) and inform the nodes of which URLs correspond to which node, as well as manually creating the connection links between agents (e.g. the Taxi Service server knows that the server on port 5007 is a traffic server, but it does not know how to communicate with it and what information it requires);

To showcase the portability of Agora throughout the network, we use different database technologies (SQL and MongoDB) and different LLMs, both open- and closed-source (GPT-4o, Llama-3-405B, and Gemini 1.5 Pro (Reid et al., )).
We then generate $1000$ random queries, which range from simple ones, such as requesting today’s weather, to more complex ones, like booking rooms in ski resorts, buying tickets for movies, ordering one of each dish from a menu, and so on.
For each query, assistants receive a JSON document (which represents the task data) and are tasked with fulfilling the request and returning a parsed response that follows a given schema.
Queries are distributed among assistants following a Pareto distribution, to simulate some assistants sending significantly more requests than others. Each node can also read and share PDs to one of three protocol databases.
Overall, these design decisions result in a very heterogeneous network, testing the limits of Agora. Refer to Appendix D for further implementation details.

#### Emergent protocols in large networks.

Once the connections are established and the networks can send and receive messages, we observe several noteworthy behaviours.
As PDs are progressively shared between agents (see Figure 5(b)), we observe the emergence of a decentralised consensus on the appropriate protocols for a given task.
An example of this behaviour involves ordering food from restaurants: an agent queries another to request food to be delivered to a certain address. The restaurant agent requests a delivery driver from a food delivery service, who, in turn, checks with the traffic data agent to see if the traffic is smooth enough to fulfil the delivery.
None of the agents know each other’s roles and the protocols involved beyond their immediate communication. Still, the interaction of the various agents creates an automated workflow that takes care of everything. The emergence of such a protocol is illustrated in Figure 4 (right).
In contrast with some recent literature on the emergence of complex protocols (Chaabouni et al., ), we observe that with the proper incentives (i.e., efficiency), agents in Agora escape the inefficient *trap* of committing to longer messages in large scale communications.

#### A cost analysis.

We compare the cost of running our Agora network against one that uses natural language for all communications.
As shown in Figure 5(a), at the beginning Agora’s cost-efficiency marginally outperforms the network that relies only on natural language;
this gap increases over time, with progressively more Agora-powered nodes relying on LLM-written routines. The overall cost in API queries for running $1000$ queries in the natural language network is $36.23$ USD, compared to Agora’s $7.67$ USD: in other words, executing this demo with Agora is approximately five times cheaper than with regular natural language. Continuing the demo for more queries would have led to an even larger cost difference.

Figure: (a) Cost comparison of natural language vs Agora on a network of $100$ agents. Costs are averaged with a window size of $100$.
Refer to caption: x1.png

## 6 Conclusions

In this paper, we introduced Agora, a meta protocol that sidesteps the Agent Communication Trilemma by using a mix of natural language and structured protocols. We showed that Agora agents can negotiate, implement and use protocols, creating self-organising networks that solve complex tasks. Additionally, we demonstrated the scalability of Agora by testing a $100$-agent demo and achieving a five-fold reduction in costs compared to natural language-only communication. Our results showcase the power of negotiation as a basis for efficient, scalable, and decentralised agent networks.
As LLMs continue to improve and as interactions between them increase, LLM-powered agent networks have the potential to surpass the scale limitations of single LLMs. Developing frameworks and protocols that enable decentralised, flexible and efficient communication, either through Agora or other technologies, can lay the foundations for a future where complex activities are partially, if not fully, automated by LLMs.

## Acknowledgements

We thank the Alan Turing Institute for providing the computational power to run our agent network, as well as SambaNova for providing credits for our Llama 3 experiments.
Samuele Marro is funded by Microsoft Research Ltd. Emanuele La Malfa is funded by the Alan Turing Institute.
Jesse Wright is funded by the Department of Computer Science of the University of Oxford.

## Appendix A Agora: Use Cases

S1. Agora as a personal assistant.

S2. Security and scalability.

S3. Compositional tasks.

S4. Scalable consensus in large networks.

S5. Scaling complex NLP routines.

## Appendix B Agora Specification

In this section, we provide a more formal description of Agora.

### B.1 Transactions

An Agora transaction operates as follows. Suppose that an agent, Alice, is trying to communicate with another agent Bob:

- •
Alice sends to Bob over HTTPS a JSON document containing three fields:
–
protocolHash: The hash of the protocol document. If natural language is used, then the value of protocolHash is null;
–
protocolSources: A list of URIs where the protocol document can be found. Must be empty if protocolHash is null and non-empty otherwise;
–
body: A string containing the body of the request as specified by the given protocol.
- •
If Bob does not have the protocol document, he fetches it (either from the sources provided by Alice or from another repository);
- •
If Bob is unable to use the protocol, he returns a JSON document with one field, namely status, which is equal to “rejected”;
- •
Otherwise, Bob computes the response using the LLM, routines, or a combination of both;
- •
Bob sends as response a JSON document with the following fields:
–
status: a string indicating the status of the response (can be “success” or “failure”);
–
body: the response returned by the agent.
- •
Note that "status":"failure" must be used only for errors that are not covered by the protocol document (e.g., the agent failing to instantiate the LLM); when the protocol prescribes how to handle an error, the agent should return "status":"success" and the correct error message as body.

### B.2 Protocol Documents

A protocol document is identified by its SHA1 hash. Protocol documents can refer to other protocol documents by adding a preamble containing the protocol hash and at least one source for the protocol document. Further discussions concerning the optimal way to reference other protocol documents is left to future work.

### B.3 Preferred Protocols

In order to signal to other agents which protocols are supported by default, an agent can expose an endpoint /.wellknown. This endpoint returns a JSON object where each key is a supported protocol hash and each value is a non-empty list of protocol sources.

## Appendix C Example of Negotiation Process Between Two Agents

We report the negotiation process between Alice and Bob for a protocol to transmit weather forecast. Note that while the LLMs used Markdown-style formatting, for the sake of readability we replaced Markdown syntax with the corresponding typeset style.

## Appendix D 100 Agent Demo - Full Description

### D.1 Implementation Notes

We implemented our demo in Python, using Flask servers as basis for our agents. Each agent is either a *user* or a *server*:

- •
Users receive a random task, some randomly generated data and a description of the task data (including its schema). Their objective is to execute the requested action and return a reply according to a certain schema. This allows us to generate a large number of queries without needing to handcraft them. Note that all tasks are *single-round*, i.e. they can be fulfilled in one round of communication;
- •
Servers receive queries from other users and reply to them using a combination of three types of tools:
–
Database tools, which involve connecting to a personal SQL or MongoDB database (assigned at random). Depending on the server, some databases are initialised with dummy data;
–
Mock tools, which are simplifications of actual tools (e.g., for taxi service agents, the assignTaxi tool is a mock tool that, instead of actually sending a taxi to a location, mimics the request flow);
–
External tools, which are tools that enable the agent to start a Agora communication with a predefined server, although no information about the respective agents’ schema is provided. In other words, the skiLodge agent can open a channel with the weatherService agent

Moreover, we added three protocol databases, which are simple Flask servers that host protocol documents. The first protocol database is a *peer* with the second one, the latter of which is also a peer with the third protocol database (but the first protocol database is not a peer of the third one). Every 10 executed queries, one protocol databases shares its protocol documents with its peers. This simulates the propagation of protocol documents between different databases.

#### Picking a Protocol

Users track the number of communications with a given server about a certain type of task until it hits one of two thresholds: one for using a protocol instead of natural language and one for negotiating a protocol *ex novo*.

When the first threshold is hit, the user invokes the LLM to check if either the server or the reference protocol database (which is randomly assigned to the user at the start of the demo) already have a suitable protocol. If there are none, the user continues using natural language until the second threshold is hit: in that case, the user begins a negotiation with the server and submits the final protocol to the reference protocol database.

Similarly, each server has a counter that tracks the number of natural language communications with *any* user since the last negotiation. Once the counter hits a threshold, the server requests a negotiation with the user, regardless of how many of the tracked queries were sent by the current user. After negotiation, the counter is reset.

In our demo, we set the thresholds for the user to respectively 3 and 5 communications, and the threshold for the server to 10.

#### APIs

For GPT-4o and Gemini 1.5 Pro, we used respectively the OpenAI and Google API. For Llama 3 405b, we used the SambaNova API. Prices per million tokens are reported in Table 1.

**Table 1: Prices per million tokens at the time of writing.**
| MODEL | PRICE (USD / 1M TOKENS) |  |
| --- | --- | --- |
| Prompt | Completion |  |
| GPT-4o | 5.00 | 15.00 |
| Llama 3 405b | 5.00 | 10.00 |
| Gemini 1.5 Pro | 3.50 | 10.50 |

#### Bootstrapping Quality-of-Life Extensions

For the sake of bootstrapping the network, while
implementing the demo we added two features to our nodes:

- •
Providing each node with a simple protocol for multi-round communication in natural language;
- •
Allowing the protocol document to include machine-readable metadata, such as the name or a short description of the protocol. This helps an agent to determine quickly which protocols, among a list of potential protocols, can be suitable for a certain task.

We leave whether these features should be integrated with the Agora standard, or whether they should be handled using PDs only, to future work.

### D.2 Experimental Setup

#### Preliminary Tests

We first ran a series of qualitative tests to determine which among the considered LLMs (OpenAI GPT 4o, Llama 3 405b, Gemini 1.5 Pro) were the most suitable for negotiation and programming. We found that while all three LLMs were capable of negotiating and implementing protocols, GPT 4o was the most robust, followed by the Llama 3 405b and finally Gemini 1.5 Pro. Surprisingly, the main factor behind the brittleness of Gemini 1.5 Pro was not the model’s inherent performance, but rather the lack of robustness of the API itself: even with tailored retry systems, the API sometimes failed to respond in a nondeterministic manner (i.e. the same query would at times succeed and at times fail). We believe that our experience was due to temporary server issues, rather than fundamental problems with the model.

#### LLM Distribution

In light of our preliminary results, we manually assigned a model to each server node, following a power law consistent with our findings (9 nodes with GPT-4o, 4 nodes with Llama 3 405b, 2 nodes with Gemini 1.5 Pro). User agents were instead randomly assigned one of the three LLMs with uniform distribution. Overall, the breakdown of nodes by model is:

- •
GPT-4o: 38 nodes (9 server nodes, 29 user nodes)
- •
Llama 3 405b: 32 nodes (4 server nodes, 28 user nodes)
- •
Gemini 1.5 Pro: 30 nodes (2 server nodes, 28 user nodes)

Out of 1000 queries, 8 (representing thus 0.8% of the total query volume) failed due to Google’s Gemini API not responding. This phenomenon was unrelated to the use of Agora, with 500 Internal Server errors appearing both in the Agora demo and the natural language counterfactual with roughly the same frequency.

#### Task Distribution

To simulate the heterogeneity in communication frequency (i.e. how some nodes tend to be more active than others), we assigned to each user a “query budget” (which represents how many queries are sent by a given user) following a Pareto distribution with shape parameter equal to $0.5$, adapted so that each user has at least 1 query. The query budget is then split between three randomly chosen types of queries using a Pareto law with a shape parameter of 1 and a minimum of 1 query per type (unless the budget is less than 3 queries). See Figure 6 for a visualisation of the distribution.

Figure: Figure 6: Distribution of query budgets for users. The y axis is logarithmic.
Refer to caption: x3.png

### D.3 Additional Observations

#### Cost Breakdown

The breakdown of cost by activity is as follows:

- •
Natural language communication: 54%;
- •
Negotiation: 6%;
- •
Checking the suitability of existing protocols 22%;
- •
Implementing the protocols: 17%;

Note that negotiation, despite being the most expensive activity (since it involves several rounds of communication), actually represented the smallest contribution to the total cost, with cheaper but more frequent operations (i.e. sending natural language messages and checking the suitability of protocols) making up the largest portion.

#### Similar Protocols

Due to the (intentional) partial insulation of nodes in the network, sometimes similar protocols emerged independently. Nevertheless, agents using different default protocols were still able to communicate by picking one of the available protocols; for the sake of simplicity, the preferred protocol is chosen by the sender.

## Peer Reviews

confidence: 4
contribution: 1
initial_rating: 3
presentation: 3
questions: Please refer to the weaknesses above.
soundness: 2
strengths: 1.Designing efficient communication protocol is an important research problem to scale up multi-agent systems powered by LLMs.

2.The motivation is well-articulated, aligning with current trends in agentic AI and the need for scalable solutions.

3.Research of communication protocol could have broad implications for multi-agent systems.
summary: The present work introduces Agora, a meta protocol designed to facilitate communication among heterogeneous LLM agents. It addresses the Agent Communication Trilemma, which posits that scalable communication must be versatile, efficient, and portable. The authors argue that traditional communication paradigms struggle to meet these demands, particularly in networks of LLMs due to their inherent diversity, general-purpose nature, and high computational costs. The proposed Agora aims to integrate standardized routines for frequent communication and natural language for rare interactions.
weaknesses: 1.The empirical experiments are insufficient. Only Figure 5 has some empirical results.

2.The proposed method is not compared against any baseline methods.

3.No theoretical analysis is provided for the communication cost and performance.

Based on the above observations, the present work does not contain enough technical contribution to be published as a research paper. The author may consider to submit as a position paper.

---

confidence: 2
contribution: 3
initial_rating: 5
presentation: 4
questions: See weakness 1, 2, 3
soundness: 4
strengths: 1. The identification of the LLM-powered agent communication trilemma.

2. The proposed protocal is novel, which employs a hybrid approach, using standardized routines for frequent communications, natural language for rare communications, and LLM-written routines for everything in between.

3. The paper is well organized and easy to follow.

4. The empirical validation presented is robust, showcasing Agora's scalability and cost-effectiveness through extensive testing involving a network of 100 agents, thereby providing strong evidence for the protocol's practical applicability.
summary: In this paper, the authors first identify the agent communication trilemma, which refers to the difficulty of achieving versatility, efficiency, and portability in communication. Then the authors propose a communication protocol Agora, which combines standardized routines, natural language, and LLM-written routines to enable efficient problem-solving and self-organization within decentralized networks.
weaknesses: 1. A primary concern regarding the paper is its alignment with the focus of the conference. The content appears to be more closely aligned with themes typically found in communication-focused conferences, which may limit its relevance to the current audience.


2. Some details are missing: 
	a. what's the system prompt to guide the negotiation of the protocol in the demo mentioned in section 5.2?

	b. The paper does not provide a thorough analysis of the errors encountered during the demos and how these errors were resolved.


3. In this paper, the models includes are Llama-3-405B which is powerful and has a high-level of instruction-following cability. 

	a. How about the models with smaller sizes? How about the agents with varying instruction-following ability?  It is critical to assess the robustness of the Agora protocol across a wider spectrum of model complexities.

	b. Following this inquiry, it remains unclear how the protocol addresses instances where certain LLM models fail to adhere to instructions. Furthermore, the potential for error propagation during communication remains unexamined, which is an important consideration for the protocol’s reliability and efficacy.

---

confidence: 4
contribution: 2
initial_rating: 3
presentation: 3
questions: See weaknesses
soundness: 2
strengths: Good motivation of the trilemma problem, and timely submission given the interest in agent networks and LLMs. The authors present the trilemma problem in detail (maybe almost too much detail, because other important things then don't have enough space), thus giving a framework to analyse various solutions.

Agora works pragmatically by using efficient protocols for frequent information while using natural language for infrequent requests

Agora does not rely on a single provider for any of the necessary elements 

Empirical evaluation of the model in a network with two agents and 100 agents: Showing a significant reduction in the cost of solving the problem 

The paper is overall well-written
summary: The paper introduces Agora, a novel communication protocol designed for networks of Large Language Models (LLMs). The authors identify a fundamental "Agent Communication Trilemma" where communication protocols must balance three competing properties: versatility (supporting diverse message types), efficiency (minimal computational cost), and portability (ease of implementation).

This is done by using natural language for infrequent communications while establishing protocols for more frequent communication. These protocols are established through negotiations between agents. 

The authors then evaluate Agora in two examples, a network with 2 agents and with 100 agents, and highlight the cost savings of Agora with the 100 agents when compared to only using natural language.
weaknesses: No theoretical consideration of the problem: What is the expected cost of various solutions?

Lacking more experimental evaluations:
- Under various network sizes and configurations
- Under various communication distributions. 
- Everyone talks frequently to everyone uniformly
- Everyone talks frequently to a few agents
- Only a few agents communicate frequently with a few agents
- Private protocol databases for each agent
- What is the impact of changing the order of the queries?

How large can the networks become? Is it still stable with 1’000 or 10’000 agents?

What is the long-term cost of Agora vs. other methods?
- Generally, missing a comparison to baseline solutions. For instance, a network where the agents can only use protocols, and the other methods the authors mention. 
- What is the cost when starting with a partially filled-out database of protocols? Does this save time or only cost?

The paper does not discuss how to handle failures. Natural language can lead to misunderstandings, and the models can make errors when creating the protocols. What happens if there are malicious agents in the system? Can they contaminate the protocol databases? 

Missing a measurement of the time complexity of these networks

Unclear of the cost of establishing the protocols is part of the costs

Unclear if the cost only measures the LLM calls. Other APIs

Unclear how/when the agents decide to create a protocol

A lot of the paper is used on the trilemma (and in general text), while the paper is lacking some results in the main paper

I'm generally still quite puzzled how Agora actually works. There must be tons of cases where the agents don't agree on the short hand, or misunderstand each other, etc. All this needs to be discussed in my opinion

I'm willing to raise my grade if I understand better what is actually going on, and what the weaknesses are

---

confidence: 4
contribution: 1
initial_rating: 3
presentation: 2
questions: I think a more detailed explanation/description on how a decentralized consensus on the adequate communication protocol emerge.

Additionally, in which settings and how many times there are inefficiencies or failures in the communication protocols?
soundness: 2
strengths: The domain tackled in the paper is for sure of interest: indeed the emergence of communication modalities and protocols between a group of LLM-based agents is a very valuable topic in the domain of cooperative AI and cooperative LLMs.
summary: The authors introduce a communication protocol, called Agora, that use three types of communication for making LLM-powered agents solve complex problems in an efficient way. Specifically, LLM-powered agents use (i) standardized routines for frequent communications, (ii) natural language for rare communications, and (iii) LLM-written routines for communication neither too frequent or too rare. The authors also observe the emergence of self-organizing and fully automated protocols.
weaknesses: - The main contribution of the paper is the implementation of a communication protocol between heterogenous LLM-based agents. So, for sure an interesting engineering contribution but not a good fit for a machine learning conference;

- The hypothesis is that a network of heterogeneous LLMs can automate a variety of complex tasks. However, this hypothesis does not seem neither so central and neither evaluated seriously and quantitatively in the current version of the paper.