# Exploring Decentralized Warehouse Management Using Large Language Models: A Proof of Concept
## 3 System Architecture
### Protocol Layer
#### Decision Process
In its provider role, the agent evaluates direct offers from package agents and decides whether to accept or reject them based on available capacity and potential revenue. In its trader role, the agent forwards unaccepted offers to the capacity pool, allowing other warehouse agents to accept the offers and earn a forwarding fee in return. These two roles are reflected in the warehouse agent's objective function, which aims to maximize both the revenue from accepted storage services and the additional income from trading offers in the capacity pool. The objective function is defined as shown in Equation (37):  
\[\text{Objective}_{\text{warehouse}}=\sum_{i=1}^{n}\frac{p_{i}}{d_{i}}+\sum_{k=1} ^{m}f_{k} \tag{37}\]  
where \(p_{i}\) is the price accepted for the \(i\)-th service, \(d_{i}\) is the duration of the \(i\)-th service, \(\frac{p_{i}}{d_{i}}\) represents the profit per unit time for each service, emphasizing high price and short duration, and \(f_{k}\) is the fee added to the \(k\)-th forwarded pool offer. The agent's objective function reflects its goal of maximizing profit by accepting a large number of profitable offers while also minimizing the impact on capacity. Therefore, the objective function prioritizes offers with high prices and short durations. Additionally, by offloading offers to other warehouses via the capacity pool, the warehouse can reduce its occupancy burden while generating additional income through fees. Decision Process for Direct Offer  
The warehouse agent's direct offer decision process is illustrated in Figure 4.  
Figure 4: Warehouse agent direct offer decision process. The process begins with the agent observing new direct offers from package agents. If no new direct offer is available, the process terminates. However, if a new direct offer is detected, the agent proceeds to evaluate the offer based on its internal criteria, such as available capacity and the revenue potential of the offer. After evaluating the offer, the agent checks whether the direct offer is to be accepted or not. If the offer is acceptable, the agent accepts the offer, schedules the service, and the process completes. If the offer is not accepted, the agent checks whether the direct offer is to be forwarded to the capacity pool. If forwarding is chosen, the agent creates a pool offer by adding a fee and forwards it to the capacity pool, then completes the process. If the offer is neither accepted nor forwarded, the agent rejects the direct offer and the process terminates. The warehouse agent's direct offer decision process, depicted in Figure 4, relies on inputs including new direct offers from package agents with parameters such as start time, end time, price, and expiry time, and the agent's internal state, encompassing available capacity and revenue goals. The outputs consist of a decision to terminate if no new offer exists, acceptance of the direct offer with a scheduled service if it is deemed acceptable, a pool offer with an added fee sent to the capacity pool if it is forwarded, or rejection of the direct offer if it is neither accepted nor forwarded. This decision process allows the warehouse agent to make decisions regarding direct offers in a structured manner, balancing its storage capacity and revenue goals. Decision Process for Pool Offer  
The warehouse agent's pool offer decision process is illustrated in Figure 5.  
Figure 5: Warehouse agent pool offer decision process. The process begins with the agent observing the pool of offers forwarded by other warehouse agents or their own previously forwarded offers. If no new pool offer is available, the agent checks if any of the previously forwarded direct offers have been accepted from the pool. If a pool offer has been accepted, the agent processes the acceptance and completes the process. If no new pool offer has been observed or accepted, the process terminates.