Multi-agent-based instant retail optimization method and device and storage medium
By employing a multi-agent collaborative decision-making method, the problems of poor architectural coordination and low level of decision-making intelligence in the instant retail system are solved, achieving efficient forecasting and replenishment accuracy and integrated optimization of operations and activities, thereby improving the system's scalability and security.
Patent Information
- Application Number
- CN202511614234.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-11-06
AI Technical Summary
Existing instant retail systems suffer from poor architectural coordination, low levels of decision-making intelligence, and difficulties in system integration and expansion. This leads to conflicts between replenishment, promotion, and operational strategies, making it impossible to form unified and optimized decisions. Furthermore, the predictive accuracy is limited, making it difficult to flexibly respond to minute-level market fluctuations.
By employing a multi-agent collaborative decision-making method, real-time data is collected from sales, inventory, activities, and external data interfaces. This data is preprocessed using a stream processing platform, dynamically routed and weighted using an adaptive MOA layer, and then used to generate joint coordinated decision-making results. Finally, the decision-making results are executed by calling external systems through a unified gateway server, enabling real-time joint decision-making across modules by intelligent agents.
It significantly improved forecasting and replenishment accuracy, enabled integrated optimization of operations and activities, enhanced system scalability and security auditing capabilities, and reduced development and maintenance costs.
Smart Images

Figure CN121073530A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of instant retail, and particularly relates to an instant retail optimization method and device based on multiple agents and a storage medium. BACKGROUND
[0002] In the current instant retail field, enterprises generally adopt a modular system architecture, the core of which is composed of independent modules such as inventory management, sales forecasting and operation analysis. These modules are fragmented in function and lack effective coordination mechanisms, resulting in frequent conflicts between replenishment, promotion and operation strategies, and the inability to form unified optimization decisions.
[0003] In terms of decision-making intelligence, existing systems rely on pre-set static rules or single prediction models. Such methods are slow to respond and cannot flexibly respond to market minute-level fluctuations, and because they fail to integrate multi-modal real-time data such as weather, activities, etc., the prediction accuracy is limited and it is difficult to support fine operation.
[0004] In addition, the integration of the system with external services such as OMS (Order Management System), WMS (Warehouse Management System) and CRM (Customer Relationship Management) is highly customized. Each new system requires the development of a dedicated interface, which not only brings high development and maintenance costs, but also results in poor system scalability, non-uniform interfaces, and a lack of unified security audits and call traceability capabilities, thus constituting the main technical bottleneck for the overall intelligence of instant retail.
[0005] Therefore, there is an urgent need for an instant retail optimization method in the existing instant retail field due to poor architecture coordination, low decision-making intelligence, and difficulties in system integration and expansion. SUMMARY
[0006] To improve the coordination of the architecture, in a first aspect, the present application proposes an instant retail optimization method based on multiple agents, which comprises: Collecting real-time data through a sales data interface, an inventory data interface, an activity data interface, an operation data interface and an external data interface; the sales data interface is used to obtain sales stream information of each commodity, the inventory data interface is used to obtain commodity inventory information of each store, the activity data interface is used to obtain promotion activity information, the operation data interface is used to obtain out-of-stock rate, order delivery time and commodity conversion rate, and the external data interface is used to obtain weather date information; Real-time transmission and preprocessing of the collected data through a stream processing platform; Through an adaptive MOA layer, a predicted agent, a replenishment agent, an operation agent and an activity agent are dynamically routed and weighted based on a store dimension, a minimum inventory unit dimension, a time window dimension and a task dimension, wherein the adaptive MOA layer can temporarily combine multiple agents into a super agent to handle collaborative decision-making in complex scenarios; The super agent is used to make joint coordinated decisions on preprocessed data to generate decision results, which can realize inventory replenishment, sales forecasting, operation monitoring and adjustment of activity strategies; An external system is called through a unified gateway server based on the MCP protocol to execute the decision results, wherein the unified gateway server provides tool registration, authentication, flow limiting, idempotency and audit functions. In a possible implementation, the collected data is transmitted and preprocessed in real time through a stream processing platform, including: Publishing the data to a specific topic of a Kafka message queue; Consuming the data through a Flink stream engine and performing data cleaning, standardization and association processing; The preprocessed data is input in real time to the adaptive MOA layer to drive the dynamic routing and weighting of the agents.
[0007] In a possible implementation, the predicted agent uses a quantile prediction and causal correction method to predict the input data to generate a sales forecast distribution and its confidence space; the replenishment agent generates a replenishment plan based on the sales forecast distribution and its confidence space and the inventory state; the operation agent generates alarm information and operation optimization schemes by monitoring the out-of-stock rate, order delivery time, and product conversion rate; and the activity agent uses causal inference and uplift models to analyze the impact of promotional activities on sales and dynamically adjust the activity strategy.
[0008] In a possible implementation, the predicted agent, the replenishment agent, the operation agent and the activity agent are dynamically routed and weighted based on the store dimension, the minimum inventory unit dimension, the time window dimension and the task dimension, including: At least one of the predicted agent, the replenishment agent, the operation agent and the activity agent is combined based on the store dimension, the minimum inventory unit dimension, the time window dimension and the task dimension; For high-end stores, the weight of the operation agent is increased, and for warehouse-type stores, the weight of the replenishment agent is increased; For high-value, long-cycle goods, the weight of the predicted agent is increased, and for high-loss, short-cycle goods, the weight of the replenishment agent is increased; For the promotion period, the weight of the activity agent is increased, for the inventory check period, the weight of the operation agent is increased, and for the daily operation period, the weights of the prediction agent and the replenishment agent are balanced; For the replenishment task, the weight of the replenishment agent is the highest, and for the adjustment promotion task, the weights of the prediction agent and the activity agent are the highest.
[0009] In a possible implementation, the external system includes an order management system, a warehouse management system, and a customer relationship management, and the method further includes: registering an interface of each external system to a unified gateway server based on the MCP protocol; the calling of the external system by the unified gateway server based on the MCP protocol to execute the decision result, including: authenticating, limiting flow, and processing idempotency of the decision result; recording all requests and responses passing through the unified gateway server based on the MCP protocol to form an audit log.
[0010] In a possible implementation, the method further includes: real-time display of the prediction result, the replenishment plan, the alarm information, and the activity analysis on a front-end user interface; setting a playback option to enable a user to view the audit log by clicking the playback option.
[0011] In a second aspect, the application provides an instant retail optimization device based on multiple agents, and the device includes: a data acquisition module, configured to acquire real-time data through a sales data interface, an inventory data interface, an activity data interface, an operation data interface, and an external data interface; the sales data interface is configured to acquire sales flow information of each commodity, the inventory data interface is configured to acquire commodity inventory information of each store, the activity data interface is configured to acquire promotion activity information, the operation data interface is configured to acquire an out-of-stock rate, an order delivery time limit, and a commodity conversion rate, and the external data interface is configured to acquire weather date information; a data processing module, configured to perform real-time transmission and preprocessing of the acquired data through a stream processing platform; a coordination module, configured to perform dynamic routing and weighting of a prediction agent, a replenishment agent, an operation agent, and an activity agent based on a store dimension, a minimum inventory unit dimension, a time window dimension, and a task dimension through an adaptive MOA layer, wherein the adaptive MOA layer can temporarily combine multiple agents into a super agent to process a coordinated decision in a complex scenario; A decision module is configured to utilize the super-agent to make a joint coordination decision on the preprocessed data, and generate a decision result, which can realize inventory replenishment, sales forecast, operation monitoring, and adjustment of activity strategy. An execution module is configured to invoke an external system to execute the decision result through a unified gateway server based on the MCP protocol, wherein the unified gateway server provides tool registration, authentication, flow limiting, idempotent, and audit functions. In a possible implementation, the data processing module is specifically configured to: publish data into a specific topic of a Kafka message queue; consume data through a Flink stream engine, and perform data cleaning, standardization, and association processing; The preprocessed data is input into the adaptive MOA layer in real time, to drive dynamic routing and weighting of the agent.
[0012] In a possible implementation, the prediction agent uses a quantile prediction and causal correction method to predict the input data, and generates a sales forecast distribution and a confidence space thereof; the replenishment agent generates a replenishment plan based on the sales forecast distribution and the confidence space thereof and an inventory state; the operation agent generates alarm information and an operation optimization scheme by monitoring an out-of-stock rate, an order delivery time, and a commodity conversion rate; and the activity agent uses a causal inference and an uplift model to analyze an impact of a promotion activity on sales, and dynamically adjusts an activity strategy.
[0013] In a third aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement any of the instant retail optimization methods.
[0014] The real-time retail optimization method based on multi-agent provided in this application collects real-time data through sales data interfaces, inventory data interfaces, activity data interfaces, and external data interfaces. The sales data interface is used to obtain sales flow information for each product; the inventory data interface is used to obtain product inventory information for each store; the activity data interface is used to obtain promotional activity information; and the external data interface is used to obtain weather and date information. The collected data is transmitted and preprocessed in real time through a stream processing platform. An adaptive MOA layer dynamically routes and weights the prediction agent, replenishment agent, operation agent, and activity agent based on store dimensions, minimum inventory unit dimensions, time window dimensions, and task dimensions. The adaptive MOA layer can temporarily combine multiple agents into a super agent to handle collaborative decision-making in complex scenarios. The super agent performs joint coordination and decision-making on the preprocessed data to generate decision results. These decision results enable inventory replenishment, sales forecasting, operational monitoring, and adjustment of activity strategies. The decision results are executed by calling an external system through a unified gateway server based on the MCP protocol. The unified gateway server provides tool registration, authentication, rate limiting, idempotency, and auditing functions. It enables real-time joint decision-making across modules of intelligent agents; in instant retail scenarios, it significantly improves the accuracy of forecasting and replenishment, and achieves integrated optimization of operations and activities. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the first process of the real-time retail optimization method based on multi-agent provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the system structure for implementing the multi-agent-based real-time retail optimization method provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a second process for a multi-agent-based real-time retail optimization method provided in an embodiment of the present invention. Detailed Implementation
[0016] The present invention will be described in detail below through embodiments.
[0017] In the current instant retail sector, companies generally adopt a modular system architecture, whose core consists of independent modules such as inventory management, sales forecasting, and operational analysis. These modules are functionally fragmented and lack effective coordination mechanisms, leading to frequent conflicts between replenishment, promotion, and operational strategies, making it impossible to form unified and optimized decisions.
[0018] At the level of intelligent decision-making, existing systems mostly rely on preset static rules or single predictive models. Such methods are slow to respond and cannot flexibly cope with minute-level market fluctuations. Furthermore, because they fail to integrate multimodal real-time data such as weather and events, their predictive accuracy is limited, making it difficult to support refined operations.
[0019] In addition, the integration mode of the system with external services such as OMS (Order Management System), WMS (Warehouse Management System), and CRM (Customer Relationship Management) is highly customized. A special interface needs to be developed for each new system accessed, which not only brings high development and maintenance costs, but also leads to poor system scalability, non-uniform interfaces, and lack of unified security audit and call traceability capabilities, thereby constituting the main technical bottleneck for the comprehensive intelligentization of instant retail.
[0020] It can be seen that there are problems such as poor architecture coordination, low decision-making intelligence, and difficulty in system integration and expansion in the existing instant retail field, and therefore, there is an urgent need for an instant retail optimization method.
[0021] To improve the coordination of the architecture, in a first aspect, referring to Figure 1 The application provides an instant retail optimization method based on multiple agents, which comprises the following steps: S101, collecting real-time data through a sales data interface, an inventory data interface, an activity data interface, an operation data interface, and an external data interface.
[0022] During data collection, data can be collected from store terminals, inventory monitoring systems, marketing activity platforms, and external data sources (weather, holidays, etc.).
[0023] The sales data interface is used to obtain sales stream information of each commodity, the inventory data interface is used to obtain commodity inventory information of each store, the activity data interface is used to obtain promotion activity information, the operation data interface is used to obtain out-of-stock rate, order delivery time efficiency, and commodity conversion rate, and the external data interface is used to obtain weather date information.
[0024] S102, transmitting and preprocessing the collected data in real time through a stream processing platform.
[0025] The stream processing platform is used to realize the convergence and transmission of real-time data streams, forming a unified high-concurrency data stream.
[0026] Specifically, the following steps can be implemented: Step one, publish the data to a specific topic of the Kafka message queue; Step two, consume the data through the Flink stream engine, and perform data cleaning, standardization, and association processing; wherein the preprocessed data is input into the adaptive MOA layer in real time, for driving the dynamic routing and weighting of the agents.
[0027] Each data source publishes data into a specific topic of the Kafka message queue in real time, solving the problem of non-uniform data interface and realizing the standardization of data access. The association processing can associate a sales record with the promotion activity at that time and the weather condition to form a complete context event. Instead of simply directly throwing the original data to the intelligent agent, the sales, inventory, activity and external factors are associated in real time by Flink, which enables the subsequent intelligent agent to know whether it is in promotion or holiday tomorrow when processing data, thereby greatly improving the intelligent level.
[0028] In S103, the prediction intelligent agent, the replenishment intelligent agent, the operation intelligent agent and the activity intelligent agent are dynamically routed and weighted based on the store dimension, the minimum inventory unit dimension, the time window dimension and the task dimension through the adaptive MOA layer, wherein the adaptive MOA layer can temporarily combine multiple intelligent agents into a super intelligent agent to process collaborative decision-making in a complex scenario.
[0029] The workflow of the adaptive MOA (Mixture-of-Agents) layer is carried out around the four dimensions of the store dimension, the minimum inventory unit dimension, the time window dimension and the task dimension. First, according to the current four dimensions, it is judged which intelligent agents are needed to solve the problem. When multiple intelligent agents are combined, they may give different or even contradictory suggestions. The weighting mechanism determines whose suggestion is more important.
[0030] The above minimum inventory unit dimension refers to starting from the SKU (Stock Keeping Unit), which represents not a type of goods but a specific product. A SKU is a unique product item combined by multiple attribute dimensions. Any change in an attribute will result in a new SKU. For example, for the water sold in a store, it includes brand, category (mineral water, pure water or others), specification (500ml, 550ml or others), packaging (bottled, barrel or others), and source (Beijing warehouse, Fujian warehouse or others). Any change in any attribute will result in a different SKU.
[0031] The workflow of the adaptive MOA layer is illustrated below. If the store = Beijing Chaoyang Store, SKU = whitening toothpaste, time window = ordinary day, task = regular replenishment, the adaptive MOA layer dynamically routes to the prediction agent and the replenishment agent; if the store = Beijing Chaoyang Store, SKU = ice cream, time window = rainy weather, task = joint decision, the adaptive MOA layer dynamically routes to all agents. Take the store = Beijing Chaoyang Store, SKU = ice cream, time window = rainy weather, task = joint decision as an example to illustrate the subsequent weighting mechanism. In this abnormal weather, the weights of the prediction agent and the operation agent are adjusted to the highest because they master the most important context information. The replenishment agent must adopt the adjusted prediction, and the promotion suggestion of the activity agent may be temporarily rejected.
[0032] The prediction agent uses quantile prediction and causal correction methods to predict the input data, generates a sales prediction distribution and its confidence space; the replenishment agent generates a replenishment plan based on the sales prediction distribution and its confidence space and the inventory state; the operation agent generates alarm information and operation optimization scheme by monitoring the out-of-stock rate, order delivery time, and product conversion rate; the activity agent uses causal inference and uplift model to analyze the impact of promotion activities on sales and dynamically adjusts the activity strategy.
[0033] The prediction agent uses historical sales data, ongoing promotion activities, weather forecasts, holiday arrangements, and other multi-modal data to perform real-time modeling. It not only predicts a single value, but also generates a probability distribution, such as P10 prediction, P50 prediction, and P90 prediction, which provides a data basis for subsequent risk decision-making. In addition, the causal correction method can distinguish between natural sales and incremental sales brought by promotion, making the prediction more accurate. For example, one output of the prediction agent may be that according to historical data and weather forecasts, Beijing Chaoyang Store's ice cream has a 90% chance (P90) of selling 500 units and a 50% chance (P50) of selling 400 units in tomorrow's 35-degree high-temperature weather.
[0034] The replenishment agent receives the results of the prediction agent and combines various constraints such as current real-time inventory level, safety stock strategy, warehouse capacity, minimum order quantity, and procurement budget to generate a replenishment plan for "store × SKU × quantity". For example, after receiving the prediction, the replenishment agent combines the current inventory of 100 units and the warehouse capacity limit to make a decision: replenish 300 units of ice cream for Beijing Chaoyang Store and deliver them before 8 am tomorrow.
[0035] The operation agent will monitor the out-of-stock rate, order fulfillment time, product conversion rate, customer satisfaction, etc. in real time. When any indicator appears abnormal, such as a sudden surge in out-of-stock rate, it will immediately trigger an alarm. At the same time, it will also diagnose the problem and generate a preliminary optimization plan. For example, if it finds that the delivery time is extended, it may suggest temporarily activating a backup delivery site or adjusting the delivery route. For example: the operation agent monitors the out-of-stock rate of mineral water in Shanghai Jing'an store, which rises from 1% to 10% within 1 hour, immediately alarms in the system cockpit, and notifies the replenishment agent and relevant operation personnel.
[0036] The activity agent uses advanced analysis methods such as causal inference and Uplift model to quantify the net incremental effect of a one-time promotional activity. That is, it distinguishes which sales are caused by the activity and which are natural sales. It evaluates the return on investment of the activity and dynamically adjusts the allocation of promotional resources based on the effect. For example, if it finds that the promotional effect in region A is much better than in region B, it will suggest transferring the budget in region B to region A. For example: the activity agent analyzes the "second item half price" activity and finds that it brings 30% real sales growth to SKU-B, but has cannibalization effect on high-profit SKU-A. Therefore, it suggests that next time the promotion should bundle SKU-B and SKU-A for sale, rather than discounting them separately.
[0037] The Uplift model usually also classifies users into the following four categories: natural conversion users, who will buy regardless of whether they receive a coupon; apathetic users, who will not buy regardless of whether they receive a coupon; marketing-sensitive users, who will only buy if they receive a coupon; and counteractive users, who will buy without a coupon but will not buy if they receive a coupon. For natural conversion users, avoid disturbing them, as sending them a coupon is a waste of resources and pure profit loss. For apathetic users, there is no need to invest and send coupons, saving marketing costs. For marketing-sensitive users, this is the core target of marketing and needs to be focused on, with marketing resources concentrated on this group, resulting in the highest return on investment. For counteractive users, avoid them at all costs, as marketing them will have a negative effect. The goal of the Uplift model is to accurately identify marketing-sensitive users through machine learning algorithms, which is a causal inference problem.
[0038] These four agents will temporarily combine to form a super Agent intelligence under the scheduling of the adaptive MOA layer in response to complex scenarios.
[0039] In one example, at least one of the prediction agent, replenishment agent, operation agent, and activity agent is combined based on store dimension, minimum inventory unit dimension, time window dimension, and task dimension; For high-end stores, increase the weight of the operation agent, and for warehouse-type stores, increase the weight of the replenishment agent; For high-value and long-cycle goods, increase the weight of the prediction agent; for high-loss and short-cycle goods, increase the weight of the replenishment agent; For the promotion period, increase the weight of the activity agent; for the inventory check period, increase the weight of the operation agent; for the daily operation period, keep the weights of the prediction agent and the replenishment agent balanced; For the replenishment task, the weight of the replenishment agent is the highest, and for the adjustment promotion task, the weights of the prediction agent and the activity agent are the highest.
[0040] S104, using the super intelligent agent to jointly coordinate the decision of the preprocessed data, and generating a decision result.
[0041] The decision result can realize inventory replenishment, sales prediction, operation monitoring and activity strategy adjustment. It is a series of executable, quantifiable and traceable automatic instructions or optimization schemes. It is the final output of the intelligent analysis of the whole system, which directly drives business actions.
[0042] When the decision result is a replenishment decision, 100 pieces of SKU-B can be purchased for store A, and it is recommended to arrive before 12:00 on December 25, 2025. Or, cancel the pre-replenishment plan of SKU-D for store C due to the decrease in predicted sales. Finally, the external WMS warehouse management system or OMS order management system is called through the unified gateway server based on the MCP protocol. When the decision result is an operation decision, it can be detected that the out-of-stock rate of store E increases from 2% to 15% within 1 hour, please handle immediately. Or, to improve the delivery time efficiency of region F, it is recommended to use standby distribution site G during the evening peak period. Finally, it is highlighted in the front-end user interface and may be sent to the mobile office software of the person in charge through the interface. When the decision result is an activity decision, it can be that the "buy one get one free" coupon for SKU-I is immediately stopped from being sent to users around store H due to insufficient inventory. Or, 30% of the promotion budget for SKU-J is transferred from channel K to channel L with high return on investment. Finally, the external CRM customer relationship management or marketing platform is called through the unified gateway server based on the MCP protocol. When the decision result is a prediction decision, it can be that the predicted sales of SKU-M in the next 24 hours is P50: 500 pieces, P10: 400 pieces, and P90: 650 pieces. Finally, it is used as the input basis for other intelligent agents (mainly replenishment agents and activity agents), and is displayed in the form of a chart in the front-end user interface.
[0043] S105, calling external systems to execute the decision result through a unified gateway server based on the MCP protocol, wherein the unified gateway server provides tool registration, authentication, flow limiting, idempotent and audit functions. The external system includes an order management system, a warehouse management system, and a customer relationship management, and an interface of each external system is registered to a unified gateway server based on the MCP protocol; The decision result is subjected to authentication processing, flow limiting processing, and idempotent processing. All requests and responses passing through the unified gateway server based on the MCP protocol are recorded to form an audit log.
[0044] The idempotent processing refers to checking whether the decision result has been processed before the decision result is executed. For example, the adaptive MOA layer sends two requests, but a replenishment order is only created once in the WMS system. The idempotent processing avoids repeated execution and business loss caused by network problems.
[0045] In one example, the prediction result, the replenishment plan, the alarm information, and the activity analysis are also displayed in real time on a front-end user interface; a playback option is set so that a user can view the audit log by clicking the playback option.
[0046] The method provided in the embodiments of the present application collects real-time data through a sales data interface, an inventory data interface, an activity data interface, and an external data interface; the sales data interface is used to obtain sales flow information of each commodity, the inventory data interface is used to obtain commodity inventory information of each store, the activity data interface is used to obtain promotion activity information, and the external data interface is used to obtain weather date information; the collected data is transmitted and preprocessed in real time through a stream processing platform; through an adaptive MOA layer, a prediction agent, a replenishment agent, an operation agent, and an activity agent are subjected to dynamic routing and weighting based on a store dimension, a minimum inventory unit dimension, a time window dimension, and a task dimension, wherein the adaptive MOA layer can temporarily combine multiple agents into a super agent to process collaborative decision-making in a complex scenario; the super agent is used to make joint and coordinated decisions on the preprocessed data to generate a decision result, and the decision result can realize inventory replenishment, sales prediction, operation monitoring, and adjustment of activity strategies; the decision result is executed by calling an external system through a unified gateway server based on the MCP protocol, wherein the unified gateway server provides functions of tool registration, authentication, flow limiting, idempotency, and auditing. The method realizes real-time joint decision-making of agents across modules; in the instant retail scenario, the prediction and replenishment accuracy are significantly improved, and integrated optimization of operation and activities is realized.
[0047] Further, a scenario of delivering a fresh product within a fixed time period is used to illustrate the technical solution of the present application in detail. In this example, the store is Beijing Chaoyang Store, the SKU is salmon sashimi, the time window is a dinner peak period from 6 pm to 8 pm, and the task is to complete delivery within 1 hour.
[0048] Salmon sashimi has a short shelf life, high value, and high risk of loss, so it is necessary to ensure that there is enough inventory to meet orders during this period and to achieve fast delivery while minimizing inventory loss after meal time.
[0049] Phase 1: Pre-meal preparation, accurate prediction and replenishment (before 16:00) First, data collection, the system receives data in real time through Kafka / Flink: historical sales data, such as salmon sales during dinner time in the past month. Activity data, such as whether there is a Japanese food zone promotion activity tonight. External data, such as today is Friday, dinner demand is usually 20% higher than weekdays; the weather forecast is good, which does not affect delivery. Real-time inventory, such as the current store inventory is 10.
[0050] Then the intelligent agent makes a decision: the prediction intelligent agent analyzes all the data comprehensively and outputs a probabilistic prediction, such as during 18:00-20:00, salmon sales P50=50, P90=70. The replenishment intelligent agent takes into account the high loss characteristics of salmon, and it adopts a conservative strategy. It receives the prediction results, and combines the current inventory (10), the minimum packaging quantity (10 per box) and the loss cost to calculate the optimal replenishment quantity: replenish 5 boxes, a total of 50, and require delivery to the store before 17:00. This not only meets the P50 demand, but also avoids excessive loss that may occur under the P90 target.
[0051] Finally, the instruction calls the WMS system through the unified gateway server based on the MCP protocol to generate a replenishment order. The gateway server ensures the idempotency of the replenishment instruction to prevent duplicate order creation.
[0052] Phase 2: In-meal monitoring, real-time response and dynamic adjustment (18:00-20:00) The operation intelligent agent monitors key indicators in real time: sales speed, such as at 18:30, it is found that 35 have been sold, far exceeding expectations. Inventory level, such as the remaining inventory is rapidly decreasing to 15. Delivery timeliness, such as all orders are delivered within 1 hour.
[0053] When the operation intelligent agent triggers the "rapid inventory consumption alarm", the adaptive MOA layer immediately intervenes, dynamically combines prediction, replenishment, operation, and activity intelligent agents according to the dimensions of store=Beijing Chaoyang store, SKU=salmon, time window=18:30, and task=emergency inventory optimization, to form a temporary super intelligent agent.
[0054] The process of joint coordination decision-making of the super-agent is: the prediction agent re-predicts immediately based on real-time sales data, and the predicted sales of the remaining period are increased to 30. The replenishment agent evaluates and believes that physical replenishment cannot be performed (time is insufficient). The activity agent is awakened, and through the built-in causal inference model, a dynamic marketing strategy is generated, suggesting that a late-night discount clearance sale of salmon be started near the end of the peak period (for example, after 19:30) to accelerate inventory clearance and balance the risk of post-meal loss.
[0055] Finally, the promotion instruction is called through the unified gateway server based on the MCP protocol to call the CRM / marketing platform, and a coupon is pushed to users around the store at 19:30.
[0056] Referring to Figure 2 The system architecture diagram of the instant retail optimization method provided in the present application. The data acquisition and transmission layer includes a sales / stock interface, an activity / marketing interface, an external data interface, a Kafka / Flink data bus; the agent layer includes a prediction agent, a replenishment agent, an operation agent, and an activity agent; the adaptive MOA layer is used for dynamic routing and weighting according to store × SKU × time window × task, and temporarily forms a super-agent unified decision; the unified gateway server based on the MCP protocol (i.e., the center server in the figure) provides registration and directory, authentication / flow limiting / idempotency, audit and playback, version / gray / routing functions; the storage and audit module includes Redis and ClickHouse, which are used for caching / idempotency and audit logs, respectively; the external business system includes OMS, WMS, and CRM; the front-end user interface supports playback.
[0057] Referring to Figure 3 The flowchart of the instant retail optimization method provided in the present application. First, data acquisition, including collecting sales, inventory, activities, weather / holidays, etc., is performed, and real-time data is entered into the Kafka / Flink data stream. Then, the prediction agent is used for sales prediction, and the replenishment agent generates a replenishment plan for “store × SKU × quantity” based on the prediction results, and intelligent replenishment is performed.
[0058] Through real-time monitoring by the operation agent, if an exception occurs, an exception alarm and optimization are performed, and the activity agent performs activity analysis and adjustment based on the results of the operation agent. Through an adaptive MOA layer, at least one of the prediction agent, the replenishment agent, the operation agent, and the activity agent is combined based on the store dimension, the minimum inventory unit dimension, the time window dimension, and the task dimension to perform joint coordination decision-making, obtain a decision result, and call external systems through the unified gateway server based on the MCP protocol to execute the decision result; the results of the entire execution process are landed and audited, and are also published to the front-end user interface. The front-end user interface supports playback and gray release.
[0059] In a second aspect, the application provides a multi-agent based instant retail optimization device, which comprises: a data collection module, configured to collect real-time data through a sales data interface, an inventory data interface, an activity data interface, an operation data interface and an external data interface; the sales data interface is configured to obtain sales flow information of each commodity, the inventory data interface is configured to obtain commodity inventory information of each store, the activity data interface is configured to obtain promotion activity information, the operation data interface is configured to obtain out-of-stock rate, order delivery time and commodity conversion rate, and the external data interface is configured to obtain weather date information; a data processing module, configured to perform real-time transmission and preprocessing of the collected data through a stream processing platform; a coordination module, configured to perform dynamic routing and weighting of a prediction agent, a replenishment agent, an operation agent and an activity agent based on a store dimension, a minimum inventory unit dimension, a time window dimension and a task dimension through an adaptive MOA layer, wherein the adaptive MOA layer can temporarily combine multiple agents into a super agent to process collaborative decision-making in complex scenarios; a decision module, configured to perform joint coordination decision-making on the preprocessed data using the super agent to generate a decision result, wherein the decision result can realize inventory replenishment, sales prediction, operation monitoring and adjustment of activity strategy; an execution module, configured to call external systems to execute the decision result through a unified gateway server based on an MCP protocol, wherein the unified gateway server provides tool registration, authentication, flow limiting, idempotent and audit functions. In a possible implementation, the data processing module is specifically configured to: publish data to a specific topic of a Kafka message queue; consume data through a Flink stream engine and perform data cleaning, standardization and association processing; wherein the preprocessed data is input into the adaptive MOA layer in real time to drive dynamic routing and weighting of the agents.
[0060] In a possible implementation, the prediction agent uses a quantile prediction and causal correction method to predict the input data, generates a sales prediction distribution and its confidence space; the replenishment agent generates a replenishment plan based on the sales prediction distribution and its confidence space and the inventory state; the operation agent generates alarm information and operation optimization scheme by monitoring the out-of-stock rate, order delivery time, commodity conversion rate; the activity agent uses causal inference and uplift model to analyze the impact of promotion activities on sales and dynamically adjusts the activity strategy.
[0061] In a possible implementation, the coordination module is specifically configured to: combine at least one of the prediction agent, the replenishment agent, the operation agent and the activity agent based on the store dimension, the minimum inventory unit dimension, the time window dimension and the task dimension; for high-end stores, increase the weight of the operation agent, and for warehouse stores, increase the weight of the replenishment agent; for high-value and long-cycle goods, increase the weight of the prediction agent, and for high-loss and short-cycle goods, increase the weight of the replenishment agent; for the promotion period, increase the weight of the activity agent, for the inventory period, increase the weight of the operation agent, and for the daily operation period, keep the weights of the prediction agent and the replenishment agent balanced; for the replenishment task, the weight of the replenishment agent is the highest, and for the adjustment promotion task, the weights of the prediction agent and the activity agent are the highest.
[0062] In a possible implementation, the external system includes an order management system, a warehouse management system and a customer relationship management, and the apparatus further includes: a registration module configured to register an interface of each external system to a unified gateway server based on the MCP protocol; The execution module is specifically configured to: perform authentication processing, flow limiting processing and idempotent processing on the decision result; record all requests and responses through the unified gateway server based on the MCP protocol to form an audit log.
[0063] In a possible implementation, the apparatus further includes: a display module configured to display the prediction result, the replenishment plan, the alarm information and the activity analysis on a front-end user interface in real time; a playback module configured to set a playback option, so that a user can view the audit log by clicking the playback option.
[0064] In a third aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement any of the instant retail optimization methods.
[0065] In the embodiments described above, all or some of the steps can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, all or some of the steps can be implemented in the form of one or more computer programs or program elements. The computer programs reside (at least temporarily) in a memory of a computer during execution. The memory can be a RAM memory, a flash memory, a ROM memory, an EPROM memory, or any other suitable device. The memory can exist within a computer as a stand-alone device, or it can be provided in association with a computer as a system memory, or it can be provided in association with one or more computer processors as a processor memory. The computer programs can be written in any suitable programming language, or languages, and can be compiled or interpreted. The computer programs can be distributed over network coupled computer systems so that the computer programs are stored and executed in a distributed fashion. The computer programs can also be embodied in the form of computer readable data, which can be stored in a computer readable storage medium. The storage medium can be magnetic (e.g., a floppy disk or a hard drive), optical (e.g., a compact disc or a DVD), magneto-optical (e.g., a floptical disk), semiconductor (e.g., a solid state hard drive like a SSD), or any other suitable device. The computer readable storage medium can be a computer readable storage device or a computer readable storage medium that is integrated in a computer or computer system (e.g., system memory or a processor memory).
[0066] It should be noted that, in the present document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. In other words, it is contemplated that the process, method, article, or apparatus that comprises one or more elements possesses those one or more elements, but is not limited to possessing only those one or more elements.
[0067] Each of the embodiments described in the present specification is described in an associated manner, and the same or similar parts of each of the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the description of the method embodiments.
[0068] Although the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are exemplary and are not to be construed as limiting the present application, and that modifications can be made by those skilled in the art without departing from the spirit and scope of the present application.
Claims
1. A multi-agent based instant retail optimization method, characterized in that, The method comprises: Collecting real-time data through a sales data interface, an inventory data interface, an activity data interface, an operation data interface, and an external data interface; the sales data interface is used to obtain sales flow information of each commodity, the inventory data interface is used to obtain commodity inventory information of each store, the activity data interface is used to obtain promotion activity information, the operation data interface is used to obtain an out-of-stock rate, order delivery timeliness, and a commodity conversion rate, and the external data interface is used to obtain weather date information; Real-time transmission and preprocessing of the collected data through a stream processing platform; Dynamic routing and weighting of a prediction agent, a replenishment agent, an operation agent, and an activity agent based on a store dimension, a minimum inventory unit dimension, a time window dimension, and a task dimension through an adaptive MOA layer, wherein the adaptive MOA layer can temporarily combine multiple agents into a super agent to process collaborative decision-making in complex scenarios; Joint coordination decision-making of the super agent on the preprocessed data to generate a decision result, which can realize inventory replenishment, sales prediction, operation monitoring, and adjustment of activity strategies; Calling external systems to execute the decision result through a unified gateway server based on an MCP protocol, wherein the unified gateway server provides tool registration, authentication, flow limiting, idempotency, and audit functions.
2. The method of claim 1, wherein, The real-time transmission and preprocessing of the collected data through the stream processing platform comprises: Publishing data to a specific topic of a Kafka message queue; Consuming data through a Flink stream engine and performing data cleaning, standardization, and association processing; The preprocessed data is input into the adaptive MOA layer in real time to drive dynamic routing and weighting of the agents.
3. The method of claim 1, wherein, The prediction agent uses quantile prediction and causal correction methods to predict input data to generate a sales prediction distribution and its confidence space; the replenishment agent generates a replenishment plan based on the sales prediction distribution and its confidence space and inventory status; the operation agent generates alarm information and operation optimization schemes by monitoring the out-of-stock rate, order delivery timeliness, and commodity conversion rate; and the activity agent uses causal inference and uplift models to analyze the impact of promotion activities on sales and dynamically adjusts activity strategies.
4. The method of claim 1, wherein, The dynamic routing and weighting of the prediction agent, the replenishment agent, the operation agent, and the activity agent based on the store dimension, the minimum inventory unit dimension, the time window dimension, and the task dimension comprises: Combining at least one of the prediction agent, the replenishment agent, the operation agent, and the activity agent based on the store dimension, the minimum inventory unit dimension, the time window dimension, and the task dimension; Increasing the weight of the operation agent for high-end stores and increasing the weight of the replenishment agent for warehouse-type stores; Increasing the weight of the prediction agent for high-value, long-cycle commodities and increasing the weight of the replenishment agent for high-loss, short-cycle commodities; Increasing the weight of the activity agent for the promotion period, increasing the weight of the operation agent for the inventory check period, and keeping the weights of the prediction agent and the replenishment agent balanced for the daily operation period; For the replenishment task, the replenishment agent has the highest weight, and for the adjustment promotion task, the prediction agent and the activity agent have the highest weight.
5. The method of claim 1, wherein, The external system includes an order management system, a warehouse management system, and a customer relationship management, and the method further includes: Registering an interface of each external system to a unified gateway server based on an MCP protocol; The decision result is executed by calling the external system through the unified gateway server based on the MCP protocol, including: The decision result is authenticated, limited in flow, and idempotent; All requests and responses through the unified gateway server based on the MCP protocol are recorded to form an audit log.
6. The method of claim 5, wherein, The method further includes: Real-time display of prediction results, replenishment plans, alarm information, and activity analysis on a front-end user interface; Setting a playback option to allow users to view the audit log by clicking the playback option.
7. A multi-agent based on-the-spot retail optimization apparatus, characterized by, The device includes: A data acquisition module for acquiring real-time data through a sales data interface, an inventory data interface, an activity data interface, an operation data interface, and an external data interface; the sales data interface is used to obtain sales stream information of each commodity, the inventory data interface is used to obtain commodity inventory information of each store, the activity data interface is used to obtain promotion activity information, the operation data interface is used to obtain out-of-stock rate, order delivery time, and commodity conversion rate, and the external data interface is used to obtain weather date information; A data processing module for real-time transmission and preprocessing of the collected data through a stream processing platform; A coordination module for dynamically routing and weighting the prediction agent, the replenishment agent, the operation agent, and the activity agent based on store dimension, minimum inventory unit dimension, time window dimension, and task dimension through an adaptive MOA layer, wherein the adaptive MOA layer can temporarily combine multiple agents into a super agent to handle collaborative decision-making in complex scenarios; A decision module for joint coordination decision-making on the preprocessed data using the super agent to generate a decision result, which can realize inventory replenishment, sales prediction, operation monitoring, and activity strategy adjustment; An execution module for executing the decision result by calling external systems through a unified gateway server based on an MCP protocol, wherein the unified gateway server provides tool registration, authentication, flow limiting, idempotency, and auditing functions.
8. The apparatus of claim 7, wherein, The data processing module is specifically configured to: Publish data to a specific topic in a Kafka message queue; Consume data through a Flink stream engine and perform data cleaning, standardization, and association processing; The preprocessed data is input into the adaptive MOA layer in real time to drive the dynamic routing and weighting of the agents.
9. The apparatus of claim 7, wherein, The prediction agent uses quantile prediction and causal correction methods to predict the input data, generates a sales forecast distribution and its confidence space; the replenishment agent generates a replenishment plan based on the sales forecast distribution and its confidence space and the inventory state; the operation agent generates alarm information and operation optimization scheme by monitoring the out-of-stock rate, order delivery time, and product conversion rate; the activity agent uses causal inference and uplift model to analyze the impact of promotional activities on sales and dynamically adjust the activity strategy.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method in any of claims 1-6.
Citation Information
Patent Citations
Tobacco enterprise composite scheduling method based on multi-agent collaborative optimization
CN119558611A
Transportation aging collaborative optimization method for fresh after-ripening characteristics and demand prediction
CN120525425A
Multi-agent collaborative decision-making method, system, equipment, medium and product
CN120706459A
Robot-assisted operation error detection method based on cooperative agent reasoning
CN120783270A
Collaborative task offloading and service caching method based on graph attention multi-agent reinforcement learning
WO2025050608A1