A multi-agent-based instant retail optimization method and device and a storage medium
By employing a multi-agent collaborative decision-making method, real-time data is collected and processed, and dynamic routing and weighted agents are used to generate joint decision results. This solves the problems of poor architectural collaboration and low decision-making intelligence in existing instant retail systems, and achieves efficient inventory replenishment and operational optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-04-17
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 and stream-processed. The adaptive MOA layer dynamically routes and weights multiple agents to generate joint decision results. Combined with a unified gateway server, external systems are invoked to achieve inventory replenishment, sales forecasting, and operational monitoring.
It enables real-time joint decision-making across modules of intelligent agents, significantly improving the accuracy of forecasting and replenishment, and achieving integrated optimization of operations and activities, thereby enhancing the scalability and security of the system.
Smart Images

Figure CN121073530B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of instant retail technology, specifically relating to an instant retail optimization method, device, and storage medium based on multi-agent systems. Background Technology
[0002] 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.
[0003] 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.
[0004] Furthermore, 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 incurs high development and maintenance costs but also results in poor system scalability, inconsistent interfaces, and a lack of unified security auditing and call traceability capabilities. These constitute the main technical bottleneck for achieving comprehensive intelligentization of instant retail.
[0005] It is evident that the existing instant retail sector suffers from problems such as poor architectural synergy, low level of decision-making intelligence, and difficulties in system integration and expansion. Therefore, there is an urgent need for an optimization method for instant retail. Summary of the Invention
[0006] To improve the synergy of the architecture, firstly, this invention proposes a multi-agent-based real-time retail optimization method, the method comprising:
[0007] Real-time data is collected through sales data interface, inventory data interface, activity data interface, operation data interface and external data interface; the sales data interface is used to obtain sales flow information of each product, the inventory data interface is used to obtain product inventory information of each store, the activity data interface is used to obtain promotional activity information, the operation data interface is used to obtain out-of-stock rate, order delivery time and product conversion rate, and the external data interface is used to obtain weather and date information.
[0008] The collected data is transmitted and preprocessed in real time through a stream processing platform;
[0009] Through the adaptive MOA layer, based on the store dimension, minimum inventory unit dimension, time window dimension, and task dimension, the predictive agent, replenishment agent, operation agent, and activity agent are dynamically routed and weighted. The adaptive MOA layer can temporarily combine multiple agents into a super agent to handle collaborative decision-making in complex scenarios.
[0010] The super intelligent agent is used to jointly coordinate and make decisions on the preprocessed data to generate decision results, which can realize inventory replenishment, sales forecasting, operation monitoring and adjustment of activity strategies;
[0011] 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 tool registration, authentication, rate limiting, idempotency and auditing functions.
[0012] In one possible implementation, the real-time transmission and preprocessing of the collected data via a stream processing platform includes:
[0013] Publish data to a specific topic in a Kafka message queue;
[0014] Consume data through the Flink streaming engine and perform data cleaning, standardization, and correlation processing;
[0015] The preprocessed data is input into the adaptive MOA layer in real time to drive the dynamic routing and weighting of the agent.
[0016] In one possible implementation, the predictive agent uses quantile prediction and causal correction methods to predict the input data, generating a sales forecast distribution and its confidence space; the replenishment agent generates a replenishment plan based on the sales forecast distribution, its confidence space, and inventory status; the operations agent generates alarm information and operations optimization plans by monitoring stockout rates, order delivery timeliness, and product conversion rates; and the activity agent uses causal inference and an Uplift model to analyze the impact of promotional activities on sales and dynamically adjust activity strategies.
[0017] In one possible implementation, the dynamic routing and weighting of the predictive agent, replenishment agent, operational agent, and activity agent based on store dimension, minimum inventory unit dimension, time window dimension, and task dimension includes:
[0018] Based on the store dimension, minimum inventory unit dimension, time window dimension, and task dimension, combine at least one of the following intelligent agents: prediction intelligent agent, replenishment intelligent agent, operation intelligent agent, and activity intelligent agent;
[0019] For high-end stores, increase the weight of the operational intelligence agent; for warehouse-type stores, increase the weight of the replenishment intelligence agent.
[0020] For high-value, long-cycle goods, increase the weight of the prediction agent; for high-loss, short-cycle goods, increase the weight of the replenishment agent.
[0021] For promotional periods, increase the weight of the activity agent; for inventory counting periods, increase the weight of the operation agent; for daily operations, maintain a balance between the weights of the forecasting agent and the replenishment agent.
[0022] For replenishment tasks, the replenishment agent has the highest weight; for promotion adjustment tasks, the prediction agent and the activity agent have the highest weight.
[0023] In one possible implementation, the external system includes an order management system, a warehouse management system, and a customer relationship management system; the method further includes:
[0024] Register the interface of each external system to a unified gateway server based on the MCP protocol;
[0025] The step of calling an external system to execute the decision result through a unified gateway server based on the MCP protocol includes:
[0026] The decision results are then subjected to authentication, rate limiting, and idempotency processing.
[0027] All requests and responses passing through the unified gateway server based on the MCP protocol are recorded to form an audit log.
[0028] In one possible implementation, the method further includes:
[0029] The front-end user interface displays forecast results, replenishment plans, alarm information, and activity analysis in real time.
[0030] Configure a replay option so that users can view the audit logs by clicking the replay option.
[0031] Secondly, this application provides a multi-agent-based instant retail optimization device, the device comprising:
[0032] The data acquisition module is used to collect real-time data through sales data interface, inventory data interface, activity data interface, operation data interface and external data interface; the sales data interface is used to obtain sales flow information of each product, the inventory data interface is used to obtain product inventory information of each store, the activity data interface is used to obtain promotional activity information, the operation data interface is used to obtain out-of-stock rate, order delivery time and product conversion rate, and the external data interface is used to obtain weather and date information.
[0033] The data processing module is used to transmit and preprocess the collected data in real time through the stream processing platform;
[0034] The collaboration module is used to dynamically route and weight the predictive agent, replenishment agent, operation agent and activity agent through the adaptive MOA layer based on the store dimension, minimum inventory unit dimension, time window dimension and task dimension. The adaptive MOA layer can temporarily combine multiple agents into a super agent to handle collaborative decision-making in complex scenarios.
[0035] The decision-making module is used to make joint and coordinated decisions on the preprocessed data using the super intelligent agent, and generate decision results. The decision results can realize inventory replenishment, sales forecasting, operation monitoring and adjustment of activity strategies.
[0036] The execution module is used to call 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, rate limiting, idempotency and auditing functions.
[0037] In one possible implementation, the data processing module is specifically used for:
[0038] Publish data to a specific topic in a Kafka message queue;
[0039] Consume data through the Flink streaming engine and perform data cleaning, standardization, and correlation processing;
[0040] The preprocessed data is input into the adaptive MOA layer in real time to drive the dynamic routing and weighting of the agent.
[0041] In one possible implementation, the predictive agent uses quantile prediction and causal correction methods to predict the input data, generating a sales forecast distribution and its confidence space; the replenishment agent generates a replenishment plan based on the sales forecast distribution, its confidence space, and inventory status; the operations agent generates alarm information and operations optimization plans by monitoring stockout rates, order delivery timeliness, and product conversion rates; and the activity agent uses causal inference and an Uplift model to analyze the impact of promotional activities on sales and dynamically adjust activity strategies.
[0042] Thirdly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the above-described real-time retail optimization methods.
[0043] 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
[0044] Figure 1 A schematic diagram of the first process of the real-time retail optimization method based on multiple agents provided in an embodiment of the present invention;
[0045] 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;
[0046] 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
[0047] The present invention will be described in detail below through embodiments.
[0048] 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.
[0049] 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.
[0050] Furthermore, 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 incurs high development and maintenance costs but also results in poor system scalability, inconsistent interfaces, and a lack of unified security auditing and call traceability capabilities. These constitute the main technical bottleneck for achieving comprehensive intelligentization of instant retail.
[0051] It is evident that the existing instant retail sector suffers from problems such as poor architectural synergy, low level of decision-making intelligence, and difficulties in system integration and expansion. Therefore, there is an urgent need for an optimization method for instant retail.
[0052] To improve the interoperability of the architecture, firstly, see... Figure 1 This application provides a multi-agent-based real-time retail optimization method, the method comprising:
[0053] S101 collects real-time data through sales data interface, inventory data interface, activity data interface, operation data interface and external data interface.
[0054] Data can be collected from store terminals, inventory monitoring systems, marketing campaign platforms, and external data sources (weather, holidays, etc.).
[0055] 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, the operation data interface is used to obtain out-of-stock rate, order delivery timeliness and product conversion rate, and the external data interface is used to obtain weather and date information.
[0056] S102 transmits and preprocesses the collected data in real time through a stream processing platform.
[0057] Stream processing platforms are used to aggregate and transmit real-time data streams, forming a unified high-concurrency data stream.
[0058] Specifically, this can be achieved through the following steps:
[0059] Step 1: Publish the data to a specific topic in the Kafka message queue;
[0060] Step two involves consuming data through the Flink streaming engine and performing data cleaning, standardization, and correlation processing. The preprocessed data is then input into the adaptive MOA layer in real time to drive dynamic routing and weighting of the agents.
[0061] Data from various data sources is published in real time to specific topics in the Kafka message queue, resolving the issue of inconsistent data interfaces and standardizing data access. Association processing can link a sales record with current promotional activities and weather conditions, forming a complete contextual event. This application does not simply feed raw data directly to the agent; instead, it uses Flink to correlate sales, inventory, activities, and external factors in real time. This allows the agent to simultaneously know whether there is a promotion currently underway, whether tomorrow is a holiday, etc., significantly improving the level of intelligence when processing data.
[0062] S103, through an adaptive MOA layer, dynamically routes and weights the predictive agent, replenishment agent, operational agent, and activity agent based on the store dimension, minimum inventory unit dimension, time window dimension, and task dimension. The adaptive MOA layer can temporarily combine multiple agents into a super agent to handle collaborative decision-making in complex scenarios.
[0063] The workflow of the adaptive MOA (Mixture-of-Agents) layer revolves around four dimensions: store dimension, minimum inventory unit dimension, time window dimension, and task dimension. First, based on the current four dimensions, it determines which agents are needed to solve the problem. When multiple agents are combined, they may give different or even contradictory suggestions. The weighting mechanism determines whose suggestion is more important.
[0064] The aforementioned minimum inventory unit dimension refers to a specific product, not a category of goods, starting from the SKU (Stock Keeping Unit). An SKU is a unique product item composed of multiple attribute dimensions. Changing any one attribute will result in a new SKU. For example, for water sold in a store, there are multiple attributes such as brand, category (mineral water, purified water, or others), size (500ml, 550ml, or others), packaging (bottled, barrelled, or others), and source (Beijing warehouse, Fujian warehouse, or others). Changing any one of these attributes will lead to a different SKU.
[0065] The following example illustrates the workflow of the adaptive MOA layer. If the store is the Beijing Chaoyang store, the SKU is whitening toothpaste, the time window is a normal day, and the task is routine replenishment, the adaptive MOA layer dynamically routes to the prediction agent and the replenishment agent. If the store is the Beijing Chaoyang store, the SKU is ice cream, the time window is heavy rain, and the task is joint decision-making, the adaptive MOA layer dynamically routes to all agents. Taking the Beijing Chaoyang store, ice cream, heavy rain, and joint decision-making as an example, the subsequent weighting mechanism is explained. Under this abnormal weather, the prediction agent and the operational agent have the highest weights because they possess the most important contextual information. The replenishment agent must adopt the downgraded prediction, and the promotional suggestions of the activity agent may be temporarily rejected.
[0066] The predictive agent uses quantile prediction and causal correction methods to predict the input data, generating a sales forecast distribution and its confidence space. The replenishment agent generates a replenishment plan based on the sales forecast distribution, its confidence space, and inventory status. The operations agent generates alarm information and operations optimization plans by monitoring stockout rates, order delivery timeliness, and product conversion rates. The activities agent uses causal inference and the Uplift model to analyze the impact of promotional activities on sales and dynamically adjusts the activities strategy.
[0067] Predictive agents utilize multimodal data, including historical sales data, ongoing promotions, weather forecasts, and holiday schedules, to perform real-time modeling. Instead of predicting a single value, they generate probability distributions, such as P10, P50, and P90 predictions, providing a data foundation for subsequent risk decisions. Furthermore, by employing causal correction methods, they can distinguish between natural sales and incremental sales driven by promotions, making predictions more accurate. For example, one possible output from the predictive agent might be: based on historical data and weather forecasts, the ice cream shop in Chaoyang District, Beijing, has a 90% chance (P90) of selling 500 units and a 50% chance (P50) of selling 400 units on tomorrow's 35-degree Celsius day.
[0068] The replenishment agent receives the results from the forecasting agent and, combined with various constraints such as current real-time inventory levels, safety stock strategies, warehouse capacity, minimum order quantity, and procurement budget, generates a replenishment plan for "store × SKU × quantity". For example, after receiving the forecast, the replenishment agent, considering the current inventory of 100 units and warehouse capacity limitations, makes a decision: replenish 300 ice cream units for the Beijing Chaoyang store, to be delivered before 8:00 AM tomorrow.
[0069] The operations intelligence agent monitors out-of-stock rates, order fulfillment times, product conversion rates, and customer satisfaction in real time. When any metric shows an anomaly, such as a sudden spike in the out-of-stock rate, it immediately triggers an alert. It also diagnoses the problem and generates preliminary optimization plans. For example, if it detects extended delivery times, it might suggest temporarily activating alternative delivery stations or adjusting delivery routes. For instance, if the operations intelligence agent monitors that the out-of-stock rate of bottled water at the Jing'an store in Shanghai rises from 1% to 10% within one hour, it immediately highlights a red alert in the system dashboard and notifies the replenishment intelligence agent and relevant operations personnel.
[0070] The campaign agent uses advanced analytics methods such as causal inference and uplift models to quantify the net incremental effect of a promotional campaign. That is, it distinguishes between sales generated by the campaign and those generated organically. It assesses the return on investment (ROI) of the campaign and dynamically adjusts promotional resource allocation based on the results. For example, if it finds that a promotion in region A is significantly more effective than in region B, it will suggest shifting the budget from region B to region A. For instance, after analyzing a "buy one get one half price" promotion, the campaign agent finds that it brought a 30% increase in actual sales for SKU-B, but had a cannibalistic effect on the higher-margin SKU-A. Therefore, it recommends that the next promotion should bundle SKU-B and SKU-A together, rather than offering a separate discount.
[0071] The Uplift model typically categorizes users into four groups: naturally converting users (who will buy regardless of coupons), indifferent users (who won't buy regardless of coupons), marketing-sensitive users (who will only buy with coupons), and reactionary users (who will buy without coupons but become averse to them when coupons are offered). For naturally converting users, avoid disturbing them; offering coupons is a waste of resources and a pure loss of profit. For indifferent users, no investment is needed, and no coupons are required, saving marketing costs. For marketing-sensitive users, they are the core marketing target and require focused investment; marketing resources should be concentrated on this group for the highest ROI. For reactionary users, avoid them altogether, as marketing to 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 problem of causal inference.
[0072] Under the scheduling of the adaptive MOA layer, these four intelligent agents will temporarily combine to form a super agent intelligent agent for complex scenarios.
[0073] In one example, at least one of the following agents—predictive agent, replenishment agent, operational agent, and activity agent—is combined based on the store dimension, minimum inventory unit dimension, time window dimension, and task dimension.
[0074] For high-end stores, increase the weight of the operational intelligence agent; for warehouse-type stores, increase the weight of the replenishment intelligence agent.
[0075] For high-value, long-cycle goods, increase the weight of the prediction agent; for high-loss, short-cycle goods, increase the weight of the replenishment agent.
[0076] For promotional periods, increase the weight of the activity agent; for inventory counting periods, increase the weight of the operation agent; for daily operations, maintain a balance between the weights of the forecasting agent and the replenishment agent.
[0077] For replenishment tasks, the replenishment agent has the highest weight; for promotion adjustment tasks, the prediction agent and the activity agent have the highest weight.
[0078] S104, the super agent is used to perform joint coordination and decision-making on the preprocessed data to generate decision results.
[0079] The decision-making results enable inventory replenishment, sales forecasting, operational monitoring, and adjustments to campaign strategies. They constitute a series of executable, quantifiable, and traceable automated instructions or optimization solutions. It is the final output of the entire system's intelligent analysis, directly driving business actions.
[0080] When the decision is a replenishment decision, 100 units of SKU-B can be purchased for store A, with delivery recommended before 12:00 on December 31, 2025. Alternatively, the pre-replenishment plan for SKU-D at store C can be cancelled due to a downward revision in sales forecasts. This will ultimately be executed by calling an external WMS warehouse management system or OMS order management system through a unified gateway server based on the MCP protocol. When the decision is an operational decision, an immediate action can be taken if the out-of-stock rate at store E increases from 2% to 15% within one hour. Alternatively, to improve delivery efficiency in region F, it is recommended to activate the backup delivery station G during the evening peak hours. This will ultimately be highlighted on the front-end user interface and may be sent to the responsible person's mobile office software via an interface. When the decision is an event-related decision, an immediate halt to issuing "buy one get one free" coupons for SKU-I to users around store H due to insufficient inventory. Alternatively, 30% of the promotional budget for SKU-J can be transferred from channel K to channel L, which has a higher return on investment. Ultimately, the decision is executed by calling an external CRM (Customer Relationship Management) or marketing platform through a unified gateway server based on the MCP protocol. When the decision is predictive, it can predict the sales volume of SKU-M for the next 24 hours: 500 units for P50, 400 units for P10, and 650 units for P90. This data serves as input for other agents (mainly replenishment agents and activity agents) and is displayed in chart form on the front-end user interface.
[0081] S105, 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 tool registration, authentication, rate limiting, idempotency and auditing functions.
[0082] The external systems include an order management system, a warehouse management system, and a customer relationship management system. The interface of each external system is registered to a unified gateway server based on the MCP protocol.
[0083] The decision results are then subjected to authentication, rate limiting, and idempotency processing.
[0084] All requests and responses passing through the unified gateway server based on the MCP protocol are recorded to form an audit log.
[0085] Idempotent processing refers to checking whether a decision has already been processed before executing it. For example, the adaptive MOA layer sends two requests, but in the WMS system, the replenishment order is only created once. Idempotent processing avoids duplicate execution and business losses caused by network issues.
[0086] In one example, forecast results, replenishment plans, alarm information, and activity analysis will be displayed in real time on the front-end user interface; a replay option will be set so that users can view audit logs by clicking the replay option.
[0087] 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.
[0088] Furthermore, using a scenario where a fresh produce is delivered within a fixed timeframe, the technical solution of this application is explained in detail:
[0089] In this example, the store is the Chaoyang branch in Beijing, the SKU is salmon sashimi, the time window is the dinner peak period from 6 pm to 8 pm, and the task is to complete the delivery within 1 hour.
[0090] Salmon sashimi is characterized by a short shelf life, high value, and high risk of spoilage. Therefore, it is necessary to ensure sufficient inventory to meet orders during this period and to achieve fast delivery, while minimizing inventory loss after the meal period ends.
[0091] Phase 1: Pre-meal preparation, accurate forecasting and replenishment (before 16:00)
[0092] First, data is collected. The system receives data in real time via Kafka / Flink: historical sales data, such as daily salmon sales during dinner time over the past month; event data, such as whether there are any Japanese food promotions tonight; external data, such as that dinner demand is typically 20% higher than during the weekday due to Friday, and that the weather forecast is favorable and will not affect delivery; and real-time inventory, such as the current store inventory of 10 servings.
[0093] Next, the agent makes a decision: the predictive agent comprehensively analyzes all data and outputs a probabilistic prediction, such as that during the period from 18:00 to 20:00, salmon sales P50 = 50 units and P90 = 70 units. Considering the high spoilage rate of salmon, the replenishment agent adopts a conservative strategy. It receives the prediction result and, combined with the current inventory (10 units), the minimum packaging quantity (10 units / box), and spoilage costs, calculates the optimal replenishment quantity: replenish 5 boxes, totaling 50 units, and requires delivery to the store before 17:00. This satisfies the P50 requirement while avoiding excessive spoilage that might occur under the P90 target.
[0094] The final instruction calls the WMS system via a unified gateway server based on the MCP protocol to generate a replenishment order. The gateway server ensures the idempotency of this replenishment instruction to prevent duplicate order creation.
[0095] Phase Two: In-meal monitoring, real-time response and dynamic adjustment (18:00-20:00)
[0096] The operational intelligence agent monitors key metrics in real time: sales speed, such as finding that 35 units have been sold by 18:30, far exceeding expectations; inventory levels, such as remaining inventory rapidly decreasing to 15 units; and delivery timeliness, such as all orders being delivered within 1 hour.
[0097] When the operations agent triggers the "rapid inventory depletion alarm", the adaptive MOA layer immediately intervenes. Based on the dimensions of store = Beijing Chaoyang store, SKU = salmon, time window = 18:30, and task = emergency inventory optimization, it dynamically combines the prediction, replenishment, operations, and event agents to form a temporary super agent.
[0098] The process of joint coordination and decision-making by the super-agent is as follows: The prediction agent, based on real-time sales data, immediately re-predicts, increasing the predicted sales volume for the remaining period to 30 units. The replenishment agent, after evaluation, determines that physical replenishment is no longer possible (time is insufficient). The activity agent is activated, and after evaluation using its built-in causal inference model, it generates a dynamic marketing strategy, suggesting that a clearance sale of salmon be launched near the end of the peak period (e.g., after 7:30 PM) to accelerate inventory clearance and mitigate the risk of post-meal spoilage.
[0099] Finally, the promotional instruction calls the CRM / marketing platform through the unified gateway server based on the MCP protocol, and pushes coupons to users around the store at 19:30 sharp.
[0100] See Figure 2 This is a system architecture diagram of the real-time retail optimization method provided in this application. The data acquisition and transmission layer includes sales / inventory interfaces, activity / marketing interfaces, external data interfaces, and a Kafka / Flink data bus; the intelligent agent layer includes predictive intelligent agents, replenishment intelligent agents, operational intelligent agents, and activity intelligent agents; the adaptive MOA layer is used for dynamic routing and weighting according to store × SKU × time window × task, temporarily forming a super intelligent agent for unified decision-making; the unified gateway server based on the MCP protocol (i.e., the central server in the diagram) provides functions such as registration and directory, authentication / rate limiting / idempotency, auditing and playback, version / canary release / routing; the storage and auditing modules include Redis and ClickHouse, used for caching / idempotency and audit logs, respectively; external business systems include OMS, WMS, and CRM; the front-end user interface supports playback.
[0101] See Figure 3 The flowchart below illustrates the real-time retail optimization method provided in this application. The first step is data collection, including collecting information such as sales volume, inventory, activities, and weather / holidays, which is then fed into a Kafka / Flink data stream in real time. Next, a predictive agent is used to forecast sales. Based on the forecast results, a replenishment agent generates a replenishment plan for "store × SKU × quantity," enabling intelligent replenishment.
[0102] Real-time monitoring is achieved through an operational intelligence agent. If anomalies occur, alerts and optimizations are initiated. The activity intelligence agent analyzes and adjusts activities based on the operational intelligence agent's results. An adaptive MOA layer combines at least one intelligence agent from the prediction, replenishment, operational, and activity intelligence agents based on store, minimum inventory unit, time window, and task dimensions for joint coordinated decision-making. The resulting decision is then executed by an external system via a unified gateway server based on the MCP protocol. The entire execution process is recorded, audited, and published to the front-end user interface. The front-end user interface supports playback and canary releases.
[0103] Secondly, this application provides a multi-agent-based instant retail optimization device, the device comprising:
[0104] The data acquisition module is used to collect real-time data through sales data interface, inventory data interface, activity data interface, operation data interface and external data interface; the sales data interface is used to obtain sales flow information of each product, the inventory data interface is used to obtain product inventory information of each store, the activity data interface is used to obtain promotional activity information, the operation data interface is used to obtain out-of-stock rate, order delivery time and product conversion rate, and the external data interface is used to obtain weather and date information.
[0105] The data processing module is used to transmit and preprocess the collected data in real time through the stream processing platform;
[0106] The collaboration module is used to dynamically route and weight the predictive agent, replenishment agent, operation agent and activity agent through the adaptive MOA layer based on the store dimension, minimum inventory unit dimension, time window dimension and task dimension. The adaptive MOA layer can temporarily combine multiple agents into a super agent to handle collaborative decision-making in complex scenarios.
[0107] The decision-making module is used to make joint and coordinated decisions on the preprocessed data using the super intelligent agent, and generate decision results. The decision results can realize inventory replenishment, sales forecasting, operation monitoring and adjustment of activity strategies.
[0108] The execution module is used to call 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, rate limiting, idempotency and auditing functions.
[0109] In one possible implementation, the data processing module is specifically used for:
[0110] Publish data to a specific topic in a Kafka message queue;
[0111] Consume data through the Flink streaming engine and perform data cleaning, standardization, and correlation processing;
[0112] The preprocessed data is input into the adaptive MOA layer in real time to drive the dynamic routing and weighting of the agent.
[0113] In one possible implementation, the predictive agent uses quantile prediction and causal correction methods to predict the input data, generating a sales forecast distribution and its confidence space; the replenishment agent generates a replenishment plan based on the sales forecast distribution, its confidence space, and inventory status; the operations agent generates alarm information and operations optimization plans by monitoring stockout rates, order delivery timeliness, and product conversion rates; and the activity agent uses causal inference and an Uplift model to analyze the impact of promotional activities on sales and dynamically adjust activity strategies.
[0114] In one possible implementation, the collaboration module is specifically used for:
[0115] Based on the store dimension, minimum inventory unit dimension, time window dimension, and task dimension, combine at least one of the following intelligent agents: prediction intelligent agent, replenishment intelligent agent, operation intelligent agent, and activity intelligent agent;
[0116] For high-end stores, increase the weight of the operational intelligence agent; for warehouse-type stores, increase the weight of the replenishment intelligence agent.
[0117] For high-value, long-cycle goods, increase the weight of the prediction agent; for high-loss, short-cycle goods, increase the weight of the replenishment agent.
[0118] For promotional periods, increase the weight of the activity agent; for inventory counting periods, increase the weight of the operation agent; for daily operations, maintain a balance between the weights of the forecasting agent and the replenishment agent.
[0119] For replenishment tasks, the replenishment agent has the highest weight; for promotion adjustment tasks, the prediction agent and the activity agent have the highest weight.
[0120] In one possible implementation, the external system includes an order management system, a warehouse management system, and a customer relationship management system; the device further includes:
[0121] The registration module is used to register the interface of each external system to the unified gateway server based on the MCP protocol;
[0122] The execution module is specifically used for:
[0123] The decision results are then subjected to authentication, rate limiting, and idempotency processing.
[0124] All requests and responses passing through the unified gateway server based on the MCP protocol are recorded to form an audit log.
[0125] In one possible implementation, the device further includes:
[0126] The display module is used to display forecast results, replenishment plans, alarm information and activity analysis in real time on the front-end user interface;
[0127] The playback module is used to set playback options, allowing users to view audit logs by clicking the playback option.
[0128] Thirdly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the above-described real-time retail optimization methods.
[0129] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0130] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0131] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0132] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes to the above embodiments within the scope of the present invention without departing from the principles and spirit of the present invention.
Claims
1. A multi-agent based instant retail optimization method, characterized in that, The method includes: Real-time data is collected through sales data interface, inventory data interface, activity data interface, operation data interface and external data interface; the sales data interface is used to obtain sales flow information of each product, the inventory data interface is used to obtain product inventory information of each store, the activity data interface is used to obtain promotional activity information, the operation data interface is used to obtain out-of-stock rate, order delivery time and product conversion rate, 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; Through the adaptive MOA layer, based on the store dimension, minimum inventory unit dimension, time window dimension, and task dimension, the predictive agent, replenishment agent, operation agent, and activity agent are dynamically routed and weighted. The adaptive MOA layer can temporarily combine multiple agents into a super agent to handle collaborative decision-making in complex scenarios. MOA refers to a multi-agent collaborative system. The super intelligent agent is used to jointly coordinate and make decisions on the preprocessed data to generate decision results, which can realize inventory replenishment, sales forecasting, 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 tool registration, authentication, rate limiting, idempotency and auditing functions; The dynamic routing and weighting of the predictive agent, replenishment agent, operational agent, and activity agent based on store dimension, minimum inventory unit dimension, time window dimension, and task dimension includes: Based on the store dimension, minimum inventory unit dimension, time window dimension, and task dimension, combine at least one of the following intelligent agents: prediction intelligent agent, replenishment intelligent agent, operation intelligent agent, and activity intelligent agent; For high-end stores, increase the weight of the operational intelligence agent; for warehouse-type stores, increase the weight of the replenishment intelligence agent. For high-value, long-cycle goods, increase the weight of the prediction agent; for high-loss, short-cycle goods, increase the weight of the replenishment agent. For promotional periods, increase the weight of the activity agent; for inventory counting periods, increase the weight of the operation agent; for daily operations, maintain a balance between the weights of the forecasting agent and the replenishment agent. For replenishment tasks, the replenishment agent has the highest weight; for promotion adjustment tasks, the prediction agent and the activity agent have the highest weight.
2. The method of claim 1, wherein, The process of transmitting and preprocessing the collected data in real time via a stream processing platform includes: Publish data to a specific topic in a Kafka message queue; Consume data through the Flink streaming engine and perform data cleaning, standardization, and correlation processing; The preprocessed data is input into the adaptive MOA layer in real time to drive the dynamic routing and weighting of the agent.
3. The method of claim 1, wherein, The predictive agent uses quantile prediction and causal correction methods to predict the input data, generating a sales forecast distribution and its confidence space. The replenishment agent generates a replenishment plan based on the sales forecast distribution, its confidence space, and inventory status. The operations agent generates alarm information and operations optimization plans by monitoring stockout rates, order delivery timeliness, and product conversion rates. The activities agent uses causal inference and the Uplift model to analyze the impact of promotional activities on sales and dynamically adjusts the activities strategy.
4. The method of claim 1, wherein, The external systems include an order management system, a warehouse management system, and a customer relationship management system. The method further includes: Register the interface of each external system to a unified gateway server based on the MCP protocol; The step of calling an external system to execute the decision result through a unified gateway server based on the MCP protocol includes: The decision results are then subjected to authentication, rate limiting, and idempotency processing. All requests and responses passing through the unified gateway server based on the MCP protocol are recorded to form an audit log.
5. The method of claim 4, wherein, The method further includes: The front-end user interface displays forecast results, replenishment plans, alarm information, and activity analysis in real time. Configure a replay option so that users can view the audit logs by clicking the replay option.
6. A multi-agent based on-the-spot retail optimization apparatus, characterized by, The device includes: The data acquisition module is used to collect real-time data through sales data interface, inventory data interface, activity data interface, operation data interface and external data interface; the sales data interface is used to obtain sales flow information of each product, the inventory data interface is used to obtain product inventory information of each store, the activity data interface is used to obtain promotional activity information, the operation data interface is used to obtain out-of-stock rate, order delivery time and product conversion rate, and the external data interface is used to obtain weather and date information. The data processing module is used to transmit and preprocess the collected data in real time through the stream processing platform; The collaboration module is used to dynamically route and weight the predictive agent, replenishment agent, operational agent, and activity agent through the adaptive MOA layer based on the store dimension, minimum inventory unit dimension, time window dimension, and task dimension. The adaptive MOA layer can temporarily combine multiple agents into a super agent to handle collaborative decision-making in complex scenarios. MOA refers to a multi-agent collaborative system. The decision-making module is used to make joint and coordinated decisions on the preprocessed data using the super intelligent agent, and generate decision results. The decision results can realize inventory replenishment, sales forecasting, operation monitoring and adjustment of activity strategies. An execution module is used to call 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, rate limiting, idempotency and auditing functions; The collaboration module is specifically used for: Based on the store dimension, minimum inventory unit dimension, time window dimension, and task dimension, combine at least one of the following intelligent agents: prediction intelligent agent, replenishment intelligent agent, operation intelligent agent, and activity intelligent agent; For high-end stores, increase the weight of the operational intelligence agent; for warehouse-type stores, increase the weight of the replenishment intelligence agent. For high-value, long-cycle goods, increase the weight of the prediction agent; for high-loss, short-cycle goods, increase the weight of the replenishment agent. For promotional periods, increase the weight of the activity agent; for inventory counting periods, increase the weight of the operation agent; for daily operations, maintain a balance between the weights of the forecasting agent and the replenishment agent. For replenishment tasks, the replenishment agent has the highest weight; for promotion adjustment tasks, the prediction agent and the activity agent have the highest weight.
7. The apparatus of claim 6, wherein, The data processing module is specifically used for: Publish data to a specific topic in a Kafka message queue; Consume data through the Flink streaming engine and perform data cleaning, standardization, and correlation processing; The preprocessed data is input into the adaptive MOA layer in real time to drive the dynamic routing and weighting of the agent.
8. The apparatus according to claim 6, characterized in that, The predictive agent uses quantile prediction and causal correction methods to predict the input data, generating a sales forecast distribution and its confidence space. The replenishment agent generates a replenishment plan based on the sales forecast distribution, its confidence space, and inventory status. The operations agent generates alarm information and operations optimization plans by monitoring stockout rates, order delivery timeliness, and product conversion rates. The activities agent uses causal inference and the Uplift model to analyze the impact of promotional activities on sales and dynamically adjusts the activities strategy.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-5.
Citation Information
Patent Citations
Tobacco enterprise composite scheduling method based on multi-agent collaborative optimization
CN119558611A
Robot-assisted operation error detection method based on cooperative agent reasoning
CN120783270A