Product recommendation method and related device based on large language model and multiple agents
Through the collaborative work of large language models and multiple agents, the problem of product recommendation in the dialogue scenario between users and large language models is solved, and product recommendations in the dialogue interface are realized, improving user experience and recommendation efficiency.
Patent Information
- Application Number
- CN202411614746.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2024-12-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology has a relatively single scenario when users recommend products, and cannot provide product recommendations in scenarios where users talk to large language models.
Using a product recommendation method based on large language models and multiple agents, through dialogue management, product selection agents and product sorting agents cooperate with each other, determine whether users have product recommendation needs, and filter and sort recommended products based on dialogue content. Generate product recommendation statements and output them in the large language model interface.
It realizes the recommendation of products to users in the scenario where users talk to large language models. Users do not need to leave the dialogue interface, which improves the convenience of recommendation and process participation, and avoids the cold start problem of traditional recommendation models.
Smart Images

Figure CN119128276A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a product recommendation method and related devices based on a large language model and multiple agents. Background Art
[0002] Users often have a need for product recommendations, and there are currently many technologies for recommending products to users.
[0003] The current technology for recommending products to users generally recommends products to users in scenarios such as browsing and shopping. For example, recommending products to users when users browse products on a shopping website or browse pages of a social application.
[0004] The current recommendation scenarios of the technology for recommending products to users are relatively simple. Summary of the invention
[0005] In view of the above problems, this application provides a product recommendation method and related devices based on a large language model and multi-agents to achieve the purpose of recommending products to users in the scenario where users have a dialogue with the large language model. The specific scheme is as follows: The first aspect of the present application provides a product recommendation method based on a large language model and multiple agents, which is applied to a product recommendation system based on a large language model and multiple agents. The product recommendation system based on a large language model and multiple agents includes: a dialogue management agent, a product selection agent, and a product sorting agent. The product recommendation method based on a large language model and multiple agents includes: The dialogue management agent determines whether the user has a product recommendation requirement based on the current dialogue content between the user and the large language model, and if the user has a product recommendation requirement, sends the current dialogue content to the product selection agent; The product selection agent selects a plurality of target products from a pre-built product library according to the current dialogue content, and forms a candidate product set to be sent to the dialogue management agent; The dialogue management agent sends the candidate product set and the current dialogue content to the product ranking agent; The product sorting agent sorts a plurality of target products in the candidate product set based on the current conversation content, and returns at least part of the sorted plurality of target products to the conversation management agent; The dialogue management agent generates a product recommendation sentence based on the received product and outputs the product recommendation sentence in the interface of the large language model.
[0006] In a possible implementation, the process of building the pre-built product library includes: Summarize the information of multiple products in the warehouse by using a large language model to obtain summary information of each product in the warehouse; The summary information is converted into a vector of a product, and a product library including vectors of multiple products is constructed.
[0007] In a possible implementation, the using of a large language model to summarize information of a plurality of stored products to obtain summary information of each stored product includes: Extract information of multiple incoming products from a preset database; If the extracted information of the multiple warehoused products contains reference information, then according to a preset mapping relationship, the reference information is replaced with the original information, so that the information of the multiple warehoused products does not contain the reference information; The information of multiple inventory products that do not contain the reference information is summarized using a large language model to obtain summary information of each of the inventory products.
[0008] In a possible implementation, the product selection agent selects multiple target products from a pre-built product library according to the current conversation content, including: The product selection agent constructs user preference prompt words for input into a large language model according to the current conversation content; The product selection agent generates a user preference summary based on the user preference prompt words using the large language model, wherein the user preference summary includes: information about the product preferred by the user; The product selection agent screens out a plurality of target products from a pre-built product library based on the user preference summary.
[0009] In a possible implementation, the product ranking agent ranks multiple target products in the candidate product set based on the current conversation content, including: The product ranking agent constructs product scoring prompt words for inputting into a large language model based on the user preference summary and the candidate product set, and scores multiple target products in the candidate product set based on the product scoring prompt words using the large language model to obtain a first score for each of the target products; The product ranking agent generates a product code for each of the target products in the candidate product set based on the candidate product set, generates a user code based on the user preference summary, inputs the product code and the user code into a re-ranking model, and obtains a second score for each of the target products output by the re-ranking model; The plurality of target products are ranked based on the first score and the second score.
[0010] The second aspect of the present application provides a product recommendation system based on a large language model and multiple agents, the product recommendation system based on a large language model and multiple agents comprising: a dialogue management agent, a product selection agent and a product sorting agent, The dialogue management agent determines whether the user has a product recommendation requirement based on the current dialogue content between the user and the large language model, and if the user has a product recommendation requirement, sends the current dialogue content to the product selection agent; The product selection agent selects a plurality of target products from a pre-built product library according to the current dialogue content, and forms a candidate product set to be sent to the dialogue management agent; The dialogue management agent sends the candidate product set and the current dialogue content to the product ranking agent; The product sorting agent sorts a plurality of target products in the candidate product set based on the current conversation content, and returns at least part of the sorted plurality of target products to the conversation management agent; The dialogue management agent generates a product recommendation sentence based on the received product and outputs the product recommendation sentence in the interface of the large language model.
[0011] In a possible implementation, the product selection agent selects multiple target products from a pre-built product library according to the current conversation content, and the specific configuration is: The product selection agent constructs user preference prompt words for input into a large language model according to the current conversation content; the product selection agent generates a user preference summary based on the user preference prompt words using the large language model, wherein the user preference summary includes: information about products preferred by the user; The product selection agent screens out a plurality of target products from a pre-built product library based on the user preference summary.
[0012] In a possible implementation, the product ranking agent ranks multiple target products in the candidate product set based on the current conversation content, and the specific configuration is: The product ranking agent constructs product scoring prompt words for input into a large language model based on the user preference summary and the candidate product set, and scores multiple target products in the candidate product set based on the product scoring prompt words using the large language model to obtain a first score for each of the target products; the product ranking agent generates a product code for each of the target products in the candidate product set based on the candidate product set, generates a user code based on the user preference summary, inputs the product code and the user code into a re-ranking model, and obtains a second score for each of the target products output by the re-ranking model; and ranks the multiple target products based on the first score and the second score.
[0013] In a possible implementation, the process of building the pre-built product library includes: Summarize the information of multiple products in the warehouse by using a large language model to obtain summary information of each product in the warehouse; The summary information is converted into a vector of a product, and a product library including vectors of multiple products is constructed.
[0014] In a possible implementation, the using of a large language model to summarize information of a plurality of stored products to obtain summary information of each stored product includes: Extract information of multiple incoming products from a preset database; If the extracted information of the multiple warehoused products contains reference information, then according to a preset mapping relationship, the reference information is replaced with the original information, so that the information of the multiple warehoused products does not contain the reference information; The information of multiple inventory products that do not contain the reference information is summarized using a large language model to obtain summary information of each of the inventory products.
[0015] The third aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the product recommendation method based on a large language model and multiple agents according to the first aspect or any implementation of the first aspect.
[0016] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the product recommendation method based on a large language model and multiple agents according to the first aspect or any implementation method of the first aspect.
[0017] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the product recommendation method based on a large language model and multiple agents according to the above-mentioned first aspect or any implementation of the first aspect.
[0018] Through the above-mentioned technical scheme, the product recommendation method and related devices based on a large language model and multiple agents provided by this application can complete the process of recommending products to users through the cooperation of the three agents of dialogue management agent, product selection agent, and product sorting agent. At the same time, this application can determine whether the user has a product recommendation demand based on the current dialogue content between the user and the large language model. If the user has a product recommendation demand, the product is recommended to the user. This application does not simply output the product to the user for recommendation, but generates a product recommendation sentence based on the received product, and outputs the product recommendation sentence in the interface of the large language model. It can be seen that this application achieves the purpose of recommending products to users in a scenario where the user is conversing with a large language model, and the user does not need to leave the dialogue interface with the large language model, which is very convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 A schematic diagram of a system architecture provided for this application; Figure 2 A schematic diagram of the structure of a terminal provided for this application; Figure 3 A schematic diagram of the structure of a server provided for this application; Figure 4 A schematic diagram of the structure of a product recommendation system based on a large language model and multi-agent provided for this application; Figure 5 A flowchart of a product recommendation method based on a large language model and multi-agent provided for this application; Figure 6 A flowchart of another product recommendation method based on a large language model and multi-agent provided for this application; Figure 7 A schematic diagram of the construction process of a pre-built product library provided in this application; Figure 8 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0021] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0022] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0023] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0024] The present application can be applied in the field of artificial intelligence. Taking the example of recommending products to users during the conversation between users and a large language model, multiple application scenarios of the products will be introduced below.
[0025] First, the application scenario of this application is introduced.
[0026] During the conversation between the user and the large language model, the user often enters some conversation content indicating that the user has a product recommendation need, or the user enters a picture of a piece of clothing. At this time, the application can identify whether the user has a product recommendation need based on the conversation content. If the user has a product recommendation need, the application can filter the products that the user may be interested in and output them to the user through the large language model during the conversation.
[0027] Of course, in addition to outputting the names of the above products, this application can also output the purchase address (such as product link) or purchase method (shopping website or shopping application recommendation) of the above products and other information that is convenient for users to shop.
[0028] In this way, the present application can recommend products to users in the scenario where the users are conversing with the large language model.
[0029] See also Figure 1 , Figure 1A schematic diagram of a system architecture is shown. The system may include a terminal 100 and a server 200. The server 200 may include one or more servers ( Figure 1 In the example, a server is included, and the server 200 can provide the method provided in the embodiment of the present application for one or more terminals.
[0030] Among them, an application for using a large language model can be installed on the terminal 100. The above application and web page can provide an interface (a dialogue interface of the large language model). The terminal 100 can receive relevant dialogue content input by the user on the interface and send the above dialogue content to the server 200. The server 200 can obtain processing results (such as product recommendation sentences) based on the received dialogue content and return the processing results to the terminal 100.
[0031] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received conversation content by itself without the cooperation of the server, and the embodiments of the present application are not limited thereto.
[0032] Next describe Figure 1 The product form of the mid-terminal 100; The terminal 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any limitation on this.
[0033] Figure 2 An optional hardware structure diagram of the terminal 100 is shown.
[0034] refer to Figure 2 As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), an earphone jack 163 (optional), a processor 170, an external interface 180, a power supply 190 and other components. Those skilled in the art will appreciate that Figure 2 These are merely examples of terminals or multi-function devices and do not constitute limitations on the terminals or multi-function devices, which may include more or fewer components than those shown in the figures, or combinations of certain components, or different components.
[0035] The input unit 130 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the portable multifunctional device. Specifically, the input unit 130 may include a touch screen 131 (optional) and / or other input devices 132. The touch screen 131 can collect the user's touch operations on or near it (such as the user's operation on or near the touch screen using any suitable object such as fingers, joints, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch screen can detect the user's touch action on the touch screen, convert the touch action into a touch signal and send it to the processor 170, and can receive and execute the command sent by the processor 170; the touch signal at least includes the touch point coordinate information. The touch screen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, the touch screen can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch screen 131, the input unit 130 can also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0036] Among them, the input device 132 can receive input data and the like.
[0037] The display unit 140 may be used to display information input by the user or provided to the user, various menus of the terminal 100, interactive interfaces, file display, and / or playback of any multimedia file. In an embodiment of the present application, the display unit 140 may be used to display an interface for conducting a dialogue with a large language model, etc.
[0038] The memory 120 can be used to store instructions and data. The memory 120 can mainly include an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files, texts, etc.; the instruction storage area can store software units such as operating systems, applications, instructions required for at least one function, or their subsets and extensions. It can also include a non-volatile random access memory; provide the processor 170 with hardware, software and data resources including management of computing and processing equipment, and support control software and applications. It is also used for the storage of multimedia files, and the storage of running programs and applications.
[0039] The processor 170 is the control center of the terminal 100. It uses various interfaces and lines to connect various parts of the entire terminal 100. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it executes various functions of the terminal 100 and processes data, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application program, and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 170. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips. The processor 170 may also be used to generate corresponding operation control signals, send them to corresponding components of the computing and processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that each functional module therein performs corresponding functions, thereby controlling the corresponding components to act according to the requirements of the instructions.
[0040] Among them, the memory 120 can be used to store software codes related to the product recommendation method based on a large language model and multi-agents, the processor 170 can execute the steps of the product recommendation method based on a large language model and multi-agents, and can also schedule other units (such as the above-mentioned input unit 130 and the display unit 140) to realize corresponding functions.
[0041] The radio frequency unit 110 (optional) can be used for receiving and sending information or receiving and sending signals during a call, for example, after receiving the downlink information of the base station, it is sent to the processor 170 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the radio frequency unit 110 can also communicate with network devices and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.
[0042] In this embodiment of the present application, the RF unit 110 can send data to the server 200 and receive processing results sent by the server 200.
[0043] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.
[0044] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.
[0045] The terminal 100 further includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to communicate with other devices, or to connect a charger to charge the terminal 100 .
[0046] Although not shown, the terminal 100 may also include a flashlight, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which are not described in detail here. Some or all of the methods described below may be applied in the following embodiments. Figure 2 In the terminal 100 shown.
[0047] Next describe Figure 1 The product form of the server 200; Figure 3 A structural diagram of a server 200 is provided, such as Figure 3 As shown, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.
[0048] The bus 201 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0049] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0050] The memory 204 may include a volatile memory, such as a random access memory (RAM). The memory 204 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0051] Among them, the memory 204 can be used to store software codes related to the product recommendation method based on a large language model and multiple agents, the processor 202 can execute the steps of the product recommendation method based on a large language model and multiple agents of the chip, and can also schedule other units to implement corresponding functions.
[0052] It should be understood that the above-mentioned terminal 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned terminal 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0053] In order to solve the problem of relatively single recommendation scenarios in the prior art, the present application embodiment provides a product recommendation method based on a large language model and multiple agents. The product recommendation method based on a large language model and multiple agents in the present application embodiment is described in detail below in conjunction with the accompanying drawings.
[0054] The embodiment of the present application provides a product recommendation method based on a large language model and multiple agents, which is applied to a product recommendation system based on a large language model and multiple agents. Figure 4 This is a structural diagram of a product recommendation system based on a large language model and multiple agents. Figure 4 As shown, the product recommendation system based on a large language model and multiple agents includes: a dialogue management agent 401, a product selection agent 402 and a product sorting agent 403.
[0055] In the field of computer science and artificial intelligence, the term agent is used to describe an entity that can perceive the environment, perform actions, and thereby affect the environment. Agents are usually designed to be autonomous and adaptive, and to make decisions in uncertain, complex, or dynamic environments to achieve specific goals. Agents can be software, hardware, or a system that has autonomy, adaptability, and interaction capabilities.
[0056] The dialogue management agent 401, product selection agent 402 and product sorting agent 403 of the present application are agents that can perform the corresponding processing in the product recommendation method based on a large language model and multiple agents of the present application. Optionally, one or more of the dialogue management agent 401, product selection agent 402 and product sorting agent 403 can be integrated with a machine learning model such as a large language model, or be associated with a machine learning model such as a large language model to use the functions of a machine learning model such as a large language model. Optionally, the dialogue management agent 401, product selection agent 402 and product sorting agent 403 can also perform part or all of the corresponding processing in the product recommendation method based on a large language model and multiple agents of the present application based on methods such as rule matching.
[0057] This application does not limit the specific implementation methods and structural characteristics of the dialogue management agent 401, the product selection agent 402 and the product sorting agent 403.
[0058] Reference Figure 5 , Figure 5 A flowchart of a product recommendation method based on a large language model and multi-agents provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, a data processing method provided in an embodiment of the present application may include steps 501 to 505, and these steps are described in detail below.
[0059] 501. The dialogue management agent determines whether the user has a product recommendation requirement based on the current dialogue content between the user and the large language model. If the user has a product recommendation requirement, the current dialogue content is sent to the product selection agent.
[0060] The product mentioned in this application is an object that can be used and / or consumed by people and can meet certain needs of people. The product mentioned in this application can be a tangible item, such as a commodity, or an intangible service, organization, etc.
[0061] The above-mentioned current conversation content may be the conversation content most recently input by the user, or the conversation content input by the user in the most recent few times, or the conversation content input by the user in the most recent period of time, or the conversation content related to the conversation object recently mentioned by the user.
[0062] Of course, there are many other ways to determine the content of the current conversation, which are not limited in this application.
[0063] If it is determined that the user does not have a need for product recommendations, the subsequent steps of this application do not need to be executed, and the large language model can continue to communicate with the user.
[0064] The current conversation content mentioned in step 501 may be the conversation content input by the user into the large language model, for example, in a user interface of a large language model, the user inputs the conversation content through an input box or other input tool of the user interface.
[0065] Large Language Model (LLM) is a deep learning model trained with a large amount of text data, which can generate natural language text or understand the meaning of language text. This application does not limit the specific type, name, manufacturer, etc. of the large language model mentioned in this application.
[0066] The user's conversation content will reflect the user's intention. The conversation management agent of this application can identify whether the user has a product recommendation demand through a large language model. Of course, the conversation management agent of this application can also identify whether the user has a product recommendation demand by itself.
[0067] Optionally, the dialogue management agent of the present application has an intention recognition unit. The intention recognition unit may be an intention recognition model, and the present application may train the intention recognition model to enable it to have the ability to recognize intentions.
[0068] Optionally, after determining that the user has a product recommendation requirement in step 501, it may be determined based on a preset judgment condition to which agent the current conversation content needs to be sent. The preset judgment condition may be: if there is no candidate product set or the candidate product set is empty, the current conversation content is sent to the product selection agent. If there is a candidate product set that is not empty, the current conversation content is sent to the product sorting agent.
[0069] Optionally, if during or after executing step 501, the user initiates a new conversation and it is determined based on the new conversation that the user has a need to modify the intelligent entity, the sending object of the current conversation content is adjusted based on the need to send it to the intelligent entity that meets the user's need.
[0070] 502. The product selection agent selects multiple target products from a pre-built product library according to the current dialogue content, and forms a candidate product set to send to the dialogue management agent.
[0071] In a possible implementation, the current conversation content may carry content that reflects the user's interests, and the current conversation content may also carry content that reflects the user's characteristics. This application can be based on user characteristics, and this application can build a user portrait. Furthermore, through the user portrait and the product recommendation needs identified from the current conversation content, the product features that meet the user's needs are determined, and then multiple target products are screened out from the pre-built product library through these product features.
[0072] The preset product library may carry information such as product identification, product features, product type, and product purchase links.
[0073] Optionally, the candidate product set may include information such as identification, features, type, purchase link, etc. of each target product.
[0074] In an optional implementation, the product selection agent may filter out multiple target products from a pre-built product library based on one or more information in the current conversation content, historical conversation content, user portrait, user-product interaction history, etc. For example, the product selection agent may also filter out multiple target products from a pre-built product library based on the current conversation content, historical conversation content, user portrait, user-product interaction history.
[0075] In an optional implementation, the present application may also update data such as user portraits, user-product interaction history, etc. based on the current conversation content and / or historical conversation content.
[0076] 503. The dialogue management agent sends the candidate product set and the current dialogue content to the product ranking agent.
[0077] Optionally, the dialogue management agent can also send historical dialogue content to the product ranking agent.
[0078] 504. The product sorting agent sorts the multiple target products in the candidate product set based on the current conversation content, and returns at least part of the sorted multiple target products to the conversation management agent.
[0079] Optionally, the product ranking agent may rank multiple target products based on the matching degree between the characteristics of each target product in the candidate product set and the product recommendation requirements. In another optional implementation, the product ranking agent may rank multiple target products based on the similarity between the characteristics of each target product in the candidate product set and the characteristics of products that meet the user's product recommendation requirements.
[0080] Optionally, the product ranking agent may return the top N products among the ranked multiple target products to the dialogue management agent.
[0081] It is understandable that step 504 returns at least part of the sorted multiple target products to the dialogue management agent, which does not mean returning the actual products to the dialogue management agent, but rather returns the product information (such as at least one of the identification, features, type, purchase link, etc.) to the dialogue management agent.
[0082] Optionally, the product ranking agent can rank multiple target products in the candidate product set based on one or more information in the current conversation content, historical conversation content, user portrait, user-product interaction history, etc. For example, the product ranking agent can rank multiple target products in the candidate product set based on the current conversation content, historical conversation content, user portrait, user-product interaction history.
[0083] 505. The dialogue management agent generates a product recommendation sentence based on the received product and outputs the product recommendation sentence in the interface of the large language model.
[0084] In addition to product recommendation statements, during or after the execution of one or more steps from step 501 to step 504 of the present application, the execution results or execution information of the steps can be output in the interface of the large language model. In this way, the user's participation in the process can be effectively improved. If the user finds that the information output in the interface of the large language model during or after the execution of the above steps does not meet his or her expectations or needs, the user can output relevant instructions in the large language model interface in a timely manner, and the present application can continue to modify the user's instructions or end the execution of subsequent steps. In an optional implementation method, the user's latest product recommendation needs can also be determined based on the instructions, and the execution of step 502 can be returned.
[0085] For example, during the execution of step 501, if it is determined that the user has a product recommendation requirement, the determined user's product recommendation requirement can be output in the interface of the large language model. Further, step 501 can also send the current conversation content to the product selection agent, and then output a statement that sends the current conversation content to the product selection agent and calls the product selection agent to filter out products.
[0086] Step 502 may output information of part or all of the products in the candidate product set in the interface of the large language model.
[0087] Step 504 may output the sorted plurality of target products in the interface of the large language model.
[0088] During the execution of steps 501 to 505 of the present application, the dialogue management agent of the present application can determine whether the user has the intention to make adjustments based on the latest dialogue content between the user and the large language model. If the user has the intention to make adjustments, one or more of the subsequent steps can be adjusted based on the intention.
[0089] In an optional implementation, the product recommendation statement may be generated based on a preset statement template, for example: the preset statement template is shown in Table 1.
[0090] Table 1
[0091] A in the preset sentence template is the category of the product. A1, A2, A3 are the names of the products. A11, A21, A31 are the types of the products. A111, A211, A311 are the features of the products. A1111, A2111, A3111 are the purchase links of the products.
[0092] The dialogue management agent can modify the above-mentioned preset sentence template according to the product information returned by the product sorting agent to obtain a product recommendation sentence.
[0093] In another optional implementation, the dialogue management agent can generate product recommendation sentences based on the large language model, for example: calling the large language model to generate product recommendation sentences.
[0094] The product recommendation method based on a large language model and multiple agents provided in this application can complete the process of recommending products to users through the cooperation of three agents: a dialogue management agent, a product selection agent, and a product sorting agent. At the same time, this application can determine whether the user has a product recommendation demand based on the current dialogue content between the user and the large language model. If the user has a product recommendation demand, the product is recommended to the user. This application does not simply output the product to the user for recommendation, but generates a product recommendation statement based on the received product, and outputs the product recommendation statement in the interface of the large language model. It can be seen that this application achieves the purpose of recommending products to users in a scenario where the user is conversing with a large language model, and the user does not need to leave the dialogue interface with the large language model, which is very convenient.
[0095] At the same time, the present application can screen products based only on the conversation content between the user and the large language model, that is, it can screen products without the existence of user portraits and / or user-product interaction history, thus avoiding the cold start problem of traditional recommendation models. Traditional recommendation models need to use user portraits and / or user-product interaction history when making product recommendations, but if there are no user portraits and / or user-product interaction history, the traditional recommendation model cannot accurately screen products that meet user needs, which is the cold start problem.
[0096] Furthermore, even if the user is using the large language model for the first time, the present application can also perform product screening based on the current conversation content between the user and the large language model without utilizing the historical conversation content between the user and the large language model.
[0097] Of course, in other embodiments, the present application may also perform product screening based on both the current conversation content and the historical conversation content.
[0098] Reference Figure 6 , Figure 6A process diagram of a product recommendation method based on a large language model and multi-agents provided in an embodiment of the present application is shown as follows: Figure 6 As shown, a data processing method provided in an embodiment of the present application may include steps 601 to 605, and these steps are described in detail below.
[0099] 601. The dialogue management agent determines whether the user has a product recommendation requirement based on the current dialogue content between the user and the large language model. If the user has a product recommendation requirement, the historical dialogue content and the current dialogue content are sent to the product selection agent.
[0100] The current conversation content and historical conversation content mentioned in step 601 may be the conversation content input by the user into the large language model. For example, in a user interface of a large language model, the user inputs the conversation content through an input box or other input tool of the user interface.
[0101] The historical conversation content may be the historical conversation content of the interaction between the user and the large language model, and the historical conversation content may be the conversation content generated before the current conversation content.
[0102] 602. The product selection agent selects multiple target products from a pre-built product library based on historical conversation content and current conversation content, and forms a candidate product set to send to the dialogue management agent. The historical conversation content is the historical conversation content between the large language model and the user.
[0103] In a possible implementation, both the historical conversation content and the current conversation content may carry content reflecting the user's interests, and both the historical conversation content and the current conversation content may also carry content reflecting the user's characteristics.
[0104] 603. The dialogue management agent sends the candidate product set, historical dialogue content and current dialogue content to the product ranking agent.
[0105] 604. The product sorting agent sorts multiple target products in the candidate product set based on the historical conversation content and the current conversation content, and returns at least part of the sorted multiple target products to the conversation management agent.
[0106] 605. The dialogue management agent generates a product recommendation sentence based on the received product and outputs the product recommendation sentence in the interface of the large language model.
[0107] Figure 6 The method shown can obtain information related to product screening from more conversation content by screening products based on both historical conversation content and current conversation content, which can effectively improve the accuracy and effectiveness of recommendations.
[0108] In an optional embodiment of the present application, if Figure 7 As shown, the process of building a pre-built product library may include: 701. Summarize the information of multiple products in the warehouse using a large language model to obtain summary information of each product in the warehouse; Since there may be a lot of information about a product, the large language model can be used to summarize the information of multiple products in the warehouse to obtain more refined summary information. Specifically, the large language model can be used to summarize the information of multiple products in the warehouse by adding prompt words.
[0109] 702. Convert the summary information into a vector of products, and build a product library including vectors of multiple products.
[0110] Specifically, the vector conversion can be performed using existing tools for converting text to vectors, such as bge-mge-zh-1.5, Word2Vec, etc. After obtaining the vector of the product in step 702, the product identifier and the product vector can be stored in correspondence, thereby building a product library including vectors of multiple products. Specifically, a product library including vectors of multiple products can be built based on Faiss.
[0111] In an alternative embodiment, Figure 7 The step 701 shown may specifically include: Extract information of multiple incoming products from a preset database; If the information of the extracted multiple warehoused products contains reference information, the reference information is replaced with the original meaning information according to the preset mapping relationship, so that the information of the multiple warehoused products does not contain the reference information; The large language model is used to summarize the information of multiple in-stock products that do not contain reference information, and the summary information of each in-stock product is obtained.
[0112] The information of the stored products may include: product identification, characteristics, type, purchase link and other information.
[0113] Referential information is a kind of alternative information, which is used to express the original meaning of the information.
[0114] Since the referential information does not have the textual semantic features carried by the original meaning information, the referential information causes information loss at the semantic level. If the information of the stored products contains referential information, this application cannot directly extract valid product information from the referential information, and may even extract wrong product information. In order to avoid this problem, this application can replace the referential information with the original meaning information according to the preset mapping relationship, so that the information of multiple stored products does not contain referential information, thus avoiding the influence of the referential information.
[0115] In an optional embodiment, Figure 5 Step 502 may specifically include: The product selection agent constructs user preference prompt words for input into the large language model based on the current conversation content; The product selection agent uses a large language model to generate a user preference summary based on the user preference prompt words. The user preference summary includes: information about the products preferred by the user; The product selection agent screens out multiple target products from a pre-built product library based on user preference summary.
[0116] In order to enable the large language model to obtain a summary of user preferences using the current conversation content, the product selection agent of the present application can construct user preference prompt words based on the current conversation content and input them into the large language model to guide the large language model to obtain a summary of user preferences.
[0117] The present application can fill part or all of the current conversation content into a preset user preference prompt word template to obtain a user preference prompt word for instructing the large language model to make a preference summary based on the current conversation content.
[0118] Optionally, the product ranking agent ranks multiple target products in the candidate product set based on the current conversation content, which may specifically include: The product ranking agent constructs product scoring prompts for input into the large language model based on the user preference summary and the candidate product set, and uses the large language model to score multiple target products in the candidate product set based on the product scoring prompts to obtain the first score of each target product; The product ranking agent generates a product code for each target product in the candidate product set based on the candidate product set, generates a user code based on the user preference summary, inputs the product code and the user code into the re-ranking model, and obtains a second score for each target product output by the re-ranking model; The plurality of target products are ranked based on the first score and the second score.
[0119] The above-mentioned product scoring prompt words are contents that prompt the large language model to score multiple target products in the candidate product set. In practical applications, the present application may add user preference summaries and information or features of products in the candidate product set to the product scoring prompt words.
[0120] In addition to using a large language model for scoring, the present application can also use a re-ranking model for scoring. The re-ranking model can obtain the score of each product through forward propagation. The present application can pre-construct a training data set to train the re-ranking model. Each data point in the training data set of the present application includes 10 candidate products, user portrait attributes, user-product interaction history attributes, and a pre-generated user preference summary. Each data point is also configured with a label, which is ten scores between 0 and 1, corresponding to the score of each product. A label and a data point constitute a set of training data. The present application can use multiple sets of training data to train the initial re-ranking model.
[0121] Furthermore, in order to make the re-ranking model more robust, the present application may also add noise to the training data, or randomly remove user preference summaries, user-product interaction data, etc., to correspond to data missing situations that may occur in reality.
[0122] After obtaining the scores of the large language model and the re-ranking model, the application can calculate the comprehensive ranking of each product. The application can select the N products with the highest comprehensive ranking among the scores obtained by the large language model and the re-ranking model as recommended products. The application can also perform weighted calculations on the scores obtained by the large language model and the re-ranking model, and determine the recommended products based on the calculation results.
[0123] The above introduces a product recommendation method based on a large language model and multiple agents provided in an embodiment of the present application. The following will introduce a system for executing the above-mentioned product recommendation method based on a large language model and multiple agents.
[0124] See also Figure 4 , Figure 4 A structural diagram of a product recommendation system based on a large language model and multiple agents provided in an embodiment of the present application. Figure 4 As shown, the product recommendation system based on a large language model and multiple agents includes: a dialogue management agent 401, a product selection agent 402 and a product sorting agent 403.
[0125] The dialogue management agent 401 determines whether the user has a product recommendation requirement based on the current dialogue content between the user and the large language model, and if the user has a product recommendation requirement, sends the current dialogue content to the product selection agent 402; The product selection agent 402 selects a plurality of target products from a pre-built product library according to the current dialogue content, and forms a candidate product set and sends it to the dialogue management agent 401; The dialogue management agent 401 sends the candidate product set and the current dialogue content to the product ranking agent 403; The product sorting agent 403 sorts the multiple target products in the candidate product set based on the current conversation content, and returns at least part of the sorted multiple target products to the conversation management agent 401; The dialogue management agent 401 generates a product recommendation sentence based on the received product, and outputs the product recommendation sentence in the interface of the large language model.
[0126] Optionally, the product selection agent 402 selects a plurality of target products from a pre-built product library according to the current conversation content, and the specific configuration is as follows: The product selection agent 402 constructs a user preference prompt word for inputting into a large language model according to the current conversation content; the product selection agent 402 generates a user preference summary based on the user preference prompt word using the large language model, wherein the user preference summary includes: information about the product preferred by the user; The product selection agent 402 selects a plurality of target products from a pre-built product library based on the user preference summary.
[0127] Optionally, the product sorting agent 403 sorts the multiple target products in the candidate product set based on the current conversation content, and the specific configuration is: The product sorting agent 403 constructs product scoring prompt words for input into a large language model based on the user preference summary and the candidate product set, and uses the large language model to score multiple target products in the candidate product set based on the product scoring prompt words to obtain a first score for each of the target products; the product sorting agent 403 generates a product code for each of the target products in the candidate product set based on the candidate product set, generates a user code based on the user preference summary, inputs the product code and the user code into a re-ranking model, and obtains a second score for each of the target products output by the re-ranking model; and sorts the multiple target products based on the first score and the second score.
[0128] Optionally, the process of building the pre-built product library includes: Summarize the information of multiple products in the warehouse by using a large language model to obtain summary information of each product in the warehouse; The summary information is converted into a vector of a product, and a product library including vectors of multiple products is constructed.
[0129] Optionally, the using of a large language model to summarize the information of a plurality of stored products to obtain summary information of each stored product includes: Extract information of multiple incoming products from a preset database; If the extracted information of the multiple warehoused products contains reference information, then according to a preset mapping relationship, the reference information is replaced with the original information, so that the information of the multiple warehoused products does not contain the reference information; The information of multiple inventory products that do not contain the reference information is summarized using a large language model to obtain summary information of each of the inventory products.
[0130] The present application also provides an electronic device in an embodiment. Figure 8 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0131] like Figure 8 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 to a random access memory (RAM) 803. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 803. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0132] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a memory card, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0133] Also provided in an embodiment of the present application is a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the product recommendation methods based on a large language model and multiple agents provided in the embodiments of the present application.
[0134] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any one of the product recommendation methods based on a large language model and multiple agents provided in the embodiments of the present application.
[0135] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0136] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0137] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0138] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A product recommendation method based on large language model and multi-agent, It is characterized in that Applied to a product recommendation system based on a large language model and multiple agents, the product recommendation system based on a large language model and multiple agents includes: a dialogue management agent, a product selection agent and a product sorting agent, and the product recommendation method based on a large language model and multiple agents includes: The dialogue management agent determines whether the user has a product recommendation requirement based on the current dialogue content between the user and the large language model, and if the user has a product recommendation requirement, sends the current dialogue content to the product selection agent; The product selection agent selects a plurality of target products from a pre-built product library according to the current dialogue content, and forms a candidate product set to be sent to the dialogue management agent; The dialogue management agent sends the candidate product set and the current dialogue content to the product ranking agent; The product sorting agent sorts a plurality of target products in the candidate product set based on the current conversation content, and returns at least part of the sorted plurality of target products to the conversation management agent; The dialogue management agent generates a product recommendation sentence based on the received product and outputs the product recommendation sentence in the interface of the large language model.
2. The product recommendation method based on a large language model and multiple agents according to claim 1, It is characterized in that The process of building the pre-built product library includes: Summarize the information of multiple products in the warehouse by using a large language model to obtain summary information of each product in the warehouse; The summary information is converted into a vector of a product, and a product library including vectors of multiple products is constructed.
3. The product recommendation method based on a large language model and multiple agents according to claim 2, It is characterized in that The method of summarizing the information of multiple products in the warehouse by using the large language model to obtain summary information of each product in the warehouse includes: Extract information of multiple incoming products from a preset database; If the extracted information of the multiple warehoused products contains reference information, then according to a preset mapping relationship, the reference information is replaced with the original information, so that the information of the multiple warehoused products does not contain the reference information; The information of multiple inventory products that do not contain the reference information is summarized using a large language model to obtain summary information of each of the inventory products.
4. The product recommendation method based on a large language model and multiple agents according to claim 1, It is characterized in that The product selection agent selects multiple target products from a pre-built product library according to the current conversation content, including: The product selection agent constructs user preference prompt words for input into a large language model according to the current conversation content; The product selection agent generates a user preference summary based on the user preference prompt words using the large language model, wherein the user preference summary includes: information about the product preferred by the user; The product selection agent screens out a plurality of target products from a pre-built product library based on the user preference summary.
5. The product recommendation method based on a large language model and multiple agents according to claim 4, It is characterized in that The product ranking agent ranks multiple target products in the candidate product set based on the current conversation content, including: The product ranking agent constructs product scoring prompt words for inputting into a large language model based on the user preference summary and the candidate product set, and scores multiple target products in the candidate product set based on the product scoring prompt words using the large language model to obtain a first score for each of the target products; The product ranking agent generates a product code for each of the target products in the candidate product set based on the candidate product set, generates a user code based on the user preference summary, inputs the product code and the user code into a re-ranking model, and obtains a second score for each of the target products output by the re-ranking model; The plurality of target products are ranked based on the first score and the second score.
6. A product recommendation system based on a large language model and multi-agents, It is characterized in that The product recommendation system based on a large language model and multiple agents includes: a dialogue management agent, a product selection agent, and a product sorting agent. The dialogue management agent determines whether the user has a product recommendation requirement based on the current dialogue content between the user and the large language model, and if the user has a product recommendation requirement, sends the current dialogue content to the product selection agent; The product selection agent selects a plurality of target products from a pre-built product library according to the current dialogue content, and forms a candidate product set to be sent to the dialogue management agent; The dialogue management agent sends the candidate product set and the current dialogue content to the product ranking agent; The product sorting agent sorts a plurality of target products in the candidate product set based on the current conversation content, and returns at least part of the sorted plurality of target products to the conversation management agent; The dialogue management agent generates a product recommendation sentence based on the received product and outputs the product recommendation sentence in the interface of the large language model.
7. The product recommendation system based on a large language model and multiple agents according to claim 6, It is characterized in that The product selection agent selects multiple target products from a pre-built product library according to the current conversation content, and the specific configuration is as follows: The product selection agent constructs user preference prompt words for input into a large language model according to the current conversation content; The product selection agent generates a user preference summary based on the user preference prompt words using the large language model, wherein the user preference summary includes: information about the product preferred by the user; The product selection agent screens out a plurality of target products from a pre-built product library based on the user preference summary.
8. A computer program product, It is characterized in that It includes computer-readable instructions, which, when executed on an electronic device, enable the electronic device to implement the product recommendation method based on a large language model and multiple agents as described in any one of claims 1 to 5.
9. An electronic device, It is characterized in that The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the product recommendation method based on a large language model and multiple agents as described in any one of claims 1 to 5.
10. A computer storage medium, It is characterized in that The storage medium carries one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the product recommendation method based on a large language model and multiple agents as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Product recommendation method and system
CN113468420A
Multi-agent model training method and sorting method
CN114896291A
Commodity recommendation method and device, electronic equipment and storage medium
CN116703498A
Commodity recommendation method and device, storage medium and electronic equipment
CN116823385A
Commodity recommendation method and device, storage medium and electronic equipment
CN116823387A
Cited By
Recommendation processing method and device
CN119719501A
Resource recommendation processing method and device
CN119848353A
Multi-scene session type recommendation method based on large language model agent framework
CN119988743A
Chip type selection method, framework and circuit design method based on large language model
CN120011648A
Chip Selection Method, System and Circuit Design Method Based on Large Language Model
CN120011648B
