# Exploring Decentralized Warehouse Management Using Large Language Models: A Proof of Concept
## 3 System Architecture
### Protocol Layer  
The protocol layer plays a crucial role in facilitating the negotiation of services between agents in the organizational layer. While the agents are responsible for making autonomous decisions, the protocol layer provides the standardized frameworks and data structures that allow these agents to effectively communicate and negotiate service agreements, ensuring consistency across the system. A direct offer is a data structure which is initiated by the package agent and sent to the warehouse agent as a formal proposal for service. The direct offer \(\text{o}_{direct}\) defines the terms under which the package agent requests a service and includes several essential parameters, as shown in Equation (27):  
\[o_{\text{direct}}=(t_{start},t_{end},price,t_{expipy}) \tag{27}\]  
where \(t_{start}\) is the proposed start time for the service, \(t_{end}\) is the proposed end time of the service, \(price\) is the price proposed by the package agent for the service, and \(t_{expipy}\) represents the expiry time or deadline until which the offer is valid. Direct offers ensure that both the package and warehouse agents have a clear, standardized structure for negotiating the service terms. The warehouse agent can respond to a direct offer in three distinct ways: by accepting, rejecting, or forwarding the offer. If the warehouse agent agrees to the terms set forth in the offer, the service is scheduled, and the package agent is informed that the service will proceed as requested. No formal contract is signed, but the scheduling of the service solidifies the agreement between the two agents. If the warehouse agent cannot fulfill the offer or disagrees with the proposed terms, the offer is rejected, and no further action is taken. Alternatively, the warehouse agent may choose to forward the offer to the capacity pool, where other warehouses can review and potentially fulfill the request. The capacity pool is a shared resource where warehouse agents can place unfulfilled direct offers for other warehouses to pick up. This system enables capacity pooling concepts, enabling warehouses to balance resources across the network. When a direct offer is forwarded to the pool, it becomes a pool offer o\({}_{pool}\), which retains the original offer's start time and end time but allows the warehouse agent to modify the price and expiry time. The price in the pool offer can be expressed as the original price from the direct offer plus a fee charged by the forwarding warehouse agent, as shown in Equation (28):  
\[o_{pool}=(t_{start},t_{end},price+fe,t_{expiry_{get}}) \tag{28}\]  
where \(t_{start}\) and \(t_{end}\) are the start and end times inherited from the original direct offer, _price_ is the price proposed in the original direct offer, _fee_ represents the fee added by the forwarding warehouse agent, which can reflect their desired gain or added cost, and \(t_{expiry_{get}}\) is the new expiry time set by the forwarding warehouse agent. The capacity pool P\({}_{pool}\) functions as an aggregator of pool offers, centralizing unfulfilled service requests from individual warehouses into a shared resource, as shown in Equation (29):  
\[P_{\text{pool}}=\{o_{\text{pool}_{1}},o_{\text{pool}_{2}},\dots,o_{\text{pool }_{n}}\} \tag{29}\]  
Figure 2 shows a sequence diagram of the service negotiation process. \(PA_{1}\) (Package Agent 1) initiates the process by sending \(O_{direct~{}1}\) (directOffer1) to \(WA_{1}\) (Warehouse Agent 1). The offer includes the proposed start and end times, price, and expiry time, as shown in Equation (30):  
\[PA_{1}\to WA_{1}:o_{\text{direct1}}=(t_{\text{start}},t_{\text{end}},p,t_{\text {expiry}}) \tag{30}\]  
Upon receiving the offer, \(WA_{1}\) has three possible responses: to accept, reject, or forward the offer. If \(WA_{1}\) accepts, it sends an acceptance response back to \(PA_{1}\), finalizing  
Figure 2: Negotiation process between package agent and warehouse agent. the scheduling of the service \(WA_{1}\to PA_{1}:\text{Accept}(O_{\text{direct1}})\).