An intelligent investment consultant dialogue method and system based on dynamic memory reconstruction

By employing a dynamic memory reconstruction method based on a dual-agent collaborative architecture, the problem of logical confusion in existing intelligent investment advisory systems under long-term, high-risk financial investment scenarios is solved, achieving consistency and accuracy in investment advice and improving the reliability and compliance of the system.

CN121765064BActive Publication Date: 2026-05-01SHANGHAI DIANZHANG NETWORK TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI DIANZHANG NETWORK TECHNOLOGY CO LTD
Filing Date
2026-03-04
Publication Date
2026-05-01

Smart Images

  • Figure CN121765064B_ABST
    Figure CN121765064B_ABST
Patent Text Reader

Abstract

The application discloses an intelligent investment consultant dialogue method and system based on dynamic memory reconstruction. The method is based on a double-agent collaborative architecture, calls a background agent, combines a preset financial risk control logic prompt word template, performs logical consistency verification on a current input text and a topic cluster memory set, generates a memory reconstruction control signal of DELETE_OLD, MERGE or KEEP_NEW type, and responds to the signal. The system performs replacement, deletion or addition operation on the historical semantic vector in the vector database based on a unique storage identifier, and synchronously updates the topic cluster memory set. The front-end agent generates an investment suggestion based on the updated memory set. In this way, the application can improve the financial compliance and logical consistency of the system, guarantee the coherence and semantic accuracy of the memory fragments in multiple rounds of dialogue, and enhance the reliability and compliance ability of the system in the financial regulation scene.
Need to check novelty before this filing date? Find Prior Art

Description

A Dialogue Method and System for Intelligent Investment Advisors Based on Dynamic Memory Reconstruction Technical Field

[0001] This application belongs to the field of information technology, and in particular relates to an intelligent investment advisor dialogue method and system based on dynamic memory reconstruction. Background Technology

[0002] While existing large language models, retrieval enhancement generation, and multi-agent orchestration technologies have achieved certain results in general dialogue and information retrieval scenarios, they still have the following shortcomings in long-term, high-risk, and logically rigorous financial investment advisory scenarios. For example, the multi-agent orchestration framework proposed in patent US12061970B1 is mainly aimed at the automated retrieval of external financial data and tool invocation. Although this method solves the problem of real-time market data acquisition, its memory mechanism mainly relies on short-term dialogue context windows or static knowledge bases, lacking the ability to dynamically maintain user historical profiles. It cannot distinguish whether the user's current instruction is a "correction of previous strategies" or a "completely new independent operation," which leads to the system being unable to provide coherent suggestions due to contextual gaps when faced with complex strategy changes by users spanning several months.

[0003] For example, patent US20240202221A1 uses RAG technology based on access control for enterprise-level information retrieval, suitable for scenarios where knowledge points are relatively static and the focus is on "precision retrieval." However, financial investment dialogues are highly dynamic and subject to fluctuations in preferences; for instance, users' risk aversion fluctuates dramatically with market ups and downs. Such technologies employ "read-only" or "append-only" database maintenance strategies, lacking mechanisms for physically deleting and overwriting historical vectors. This leads to the system simultaneously retrieving contradictory constraints when a user's viewpoint changes, resulting in logical inconsistencies in the large model and "schizophrenic" hallucinations in its output.

[0004] Based on the aforementioned background technologies, existing intelligent investment advisory methods suffer from the following main shortcomings: 1. They lack cross-cycle semantic association capabilities, relying on simple time sliding windows, resulting in the inability to accurately recall long-tail investment intentions; 2. They lack explicit logical conflict correction mechanisms, failing to automatically clean up outdated memories when user preferences change, leading to a lack of logical consistency in recommendations; 3. The signal-to-noise ratio of the knowledge base decreases over time, with invalid and fragmented information accumulating, increasing the cost of model reasoning and reducing response accuracy; 4. They have not established a read-write integrated memory architecture, making it impossible to achieve dynamic reconstruction and closed-loop management of investment strategies. Summary of the Invention

[0005] The purpose of this application is to provide an investment advisor dialogue method and system based on dynamic memory reconstruction, which can solve at least one of the problems existing in the prior art.

[0006] According to a first aspect of this application, this application provides a method for intelligent investment advisor dialogue based on dynamic memory reconstruction. The method is based on a dual-agent collaborative architecture and includes the following steps:

[0007] S1: Receive the current text input of the user in the current dialogue round and map it to the current semantic vector, and obtain the set of historical semantic vector points stored in the vector database;

[0008] S2: Based on the density clustering algorithm, the current semantic vector and the historical semantic vector point set are clustered to determine whether the current semantic vector belongs to an existing investment topic cluster; if it belongs to an existing investment topic cluster, the memory set of the topic cluster corresponding to the existing investment topic cluster is output; otherwise, a new investment topic cluster is initialized with the current semantic vector, and the corresponding new topic cluster memory set is generated.

[0009] S3: Invoke the background intelligent agent to perform a logical consistency check between the current text input and the topic cluster memory set based on the preset financial risk control logic prompt word template, and generate a memory reconstruction control signal according to the check result. The memory reconstruction control signal includes any of the following:

[0010] The DELETE_OLD signal is used to trigger the deletion of memory segments in the topic cluster memory set that have logical conflicts with the current text input;

[0011] The MERGE signal is used to trigger semantic fusion of the current text input with the topic cluster memory set to generate a fused memory fragment;

[0012] The KEEP_NEW signal is used to trigger the retention of the current text input as a new memory fragment in the topic cluster memory set;

[0013] S4: In response to the memory reconstruction control signal, based on the unique storage identifier associated with the memory fragment to be processed, perform deletion, replacement or addition operations on the corresponding historical semantic vector in the vector database, and synchronously update the memory fragment to be processed associated in the topic cluster memory set.

[0014] S5: Invoke the foreground intelligent agent to generate investment recommendations based on the updated topic cluster memory set.

[0015] In some embodiments, the density clustering algorithm in step S2 clusters the current semantic vector and the historical semantic vector point set based on the cross-distance; wherein the calculation of the cross-distance includes:

[0016] The basic semantic distance between the current semantic vector and any historical semantic vector in the historical semantic vector point set is determined based on the cosine similarity between the current semantic vector and the historical semantic vector point set.

[0017] The core distance between the current semantic vector and any historical semantic vector is calculated based on the K-nearest neighbor algorithm.

[0018] The maximum value among the basic semantic distance, the core distance of the current semantic vector, and the core distance of any historical semantic vector is selected as the mutual distance between the current semantic vector and any historical semantic vector.

[0019] In some embodiments, the process of determining whether the current semantic vector belongs to an existing investment topic cluster in step S2 includes:

[0020] Construct a minimum spanning tree based on the reachability distance, and prune the minimum spanning tree to obtain the existing cluster of investment topics;

[0021] For each existing investment topic cluster, extract the core historical semantic vector from the topic cluster memory set;

[0022] If the mutual distance between the current semantic vector and any core historical semantic vector in the existing investment topic cluster does not exceed the preset dynamic threshold, then the current semantic vector is determined to belong to the existing investment topic cluster, and the topic cluster memory set corresponding to the existing investment topic cluster is output.

[0023] Otherwise, initialize a new investment topic cluster with the current semantic vector and generate a corresponding new topic cluster memory set.

[0024] In some embodiments, in step S3, the background intelligent agent performs a logical consistency check on the current text input and the topic cluster memory set based on a preset financial risk control logic prompt word template, specifically including:

[0025] It receives a triple consisting of the current text input, the topic cluster memory set, and the financial risk control logic prompt word template as input; among them, the financial risk control logic prompt word template is used to guide the background agent to perform different types of logical consistency checks;

[0026] The background AI agent executes decision functions and generates memory reconstruction control signals based on the thought chain reasoning process guided by the financial risk control logic prompt template.

[0027] In some embodiments, the memory reconstruction control signal is generated based on the following mutual exclusion determination result:

[0028] When there is a logical conflict between the current text input and the topic cluster memory set, a DELETE_OLD signal is generated;

[0029] A MERGE signal is generated when the current text input and the topic cluster memory set satisfy the semantic fusion condition;

[0030] The KEEP_NEW signal is generated when the current text input does not have a logical conflict with the topic cluster memory set, nor does it meet the semantic fusion conditions.

[0031] In some embodiments, step S4 specifically includes:

[0032] In response to the type of memory reconstruction control signal, the memory segment to be processed is determined, and a unique storage identifier for the memory segment to be processed is obtained, wherein the unique storage identifier is associated with the corresponding historical semantic vector;

[0033] Based on the unique storage identifier, delete, replace, or add operations are performed on the memory fragments to be processed in the topic cluster memory set; and corresponding delete, replace, or add operations are performed on the historical semantic vectors associated with the unique storage identifier in the vector database.

[0034] In some embodiments, the steps of operating based on a unique stored identifier include:

[0035] In response to the memory reconstruction control signal being the DELETE_OLD signal, the unique storage identifier corresponding to the memory fragment to be processed that is determined to be logically conflicting is obtained, and the following actions are performed: the memory fragment to be processed is removed from the memory set of its topic cluster or marked as invalid, and the historical semantic vector associated with the unique storage identifier is deleted from the vector database.

[0036] In response to the memory reconstruction control signal being a MERGE signal, the unique storage identifier set associated with the topic cluster memory set corresponding to the existing investment topic cluster is obtained. Based on the current text input and the topic cluster memory set, a fused memory fragment is generated, which is mapped to a fused semantic vector. Then, the following actions are performed: replacing the original memory fragment in the topic cluster memory set with the fused memory fragment, and replacing all historical semantic vectors corresponding to the unique storage identifier set with the fused semantic vector in the vector database.

[0037] In response to the memory reconstruction control signal being the KEEP_NEW signal, the current semantic vector is written as a new record to the vector database, and the following actions are performed: adding the new memory fragment containing the current text input and the corresponding large model answer to the corresponding topic cluster memory set, and assigning a new unique storage identifier to the new memory fragment and associating it with the current semantic vector.

[0038] In some embodiments, step S1 specifically includes:

[0039] Receive the natural language text entered by the user in the current dialogue turn as the current text input;

[0040] The current text input is processed sequentially through text cleaning, sensitive information removal, and financial statement standardization preprocessing operations to generate preprocessed text.

[0041] The pre-trained embedding model in the financial field is invoked to map the pre-processed text into a fixed-dimensional numerical vector, which serves as the current semantic vector.

[0042] Obtain the historical semantic vector point set, which consists of historical semantic vectors generated by preprocessing and vectorizing the text input of the previous dialogue rounds in the same way as the current text input.

[0043] A second aspect of this application provides an intelligent investment advisor dialogue system, which is implemented based on a dual-agent collaborative architecture, including:

[0044] The semantic vector generation unit is used to receive the current text input of the user in the current dialogue round and map it into the current semantic vector, and to obtain the set of historical semantic vector points stored in the vector database;

[0045] The topic affiliation determination unit is used to cluster the current semantic vector with the historical semantic vector point set based on the density clustering algorithm to determine whether the current semantic vector belongs to an existing investment topic cluster. If it belongs to an existing investment topic cluster, the memory set of the topic cluster corresponding to the existing investment topic cluster is output. Otherwise, a new investment topic cluster is initialized with the current semantic vector, and the corresponding new topic cluster memory set is generated.

[0046] The memory consistency verification unit is used to invoke the background intelligent agent to perform logical consistency verification between the current text input and the topic cluster memory set based on the preset financial risk control logic prompt word template, and generate a memory reconstruction control signal according to the verification result. The memory reconstruction control signal includes any one of the following:

[0047] The DELETE_OLD signal is used to trigger the deletion of memory segments in the topic cluster memory set that have logical conflicts with the current text input;

[0048] The MERGE signal is used to trigger semantic fusion of the current text input with the topic cluster memory set to generate a fused memory fragment;

[0049] The KEEP_NEW signal is used to trigger the retention of the current text input as a new memory fragment in the topic cluster memory set;

[0050] The memory and vector collaborative update unit is used to respond to the memory reconstruction control signal, and based on the unique storage identifier associated with the memory fragment to be processed, to perform deletion, replacement or addition operations on the corresponding historical semantic vector in the vector database, and synchronously update the memory fragment to be processed associated in the topic cluster memory set.

[0051] The investment suggestion generation unit is used to call the front-end intelligent agent to generate investment suggestions based on the updated topic cluster memory set.

[0052] A third aspect of this application provides an electronic device including a memory and a processor coupled to each other, the processor being configured to execute program instructions stored in the memory to implement the intelligent investment advisor dialogue method based on dynamic memory reconstruction as described above.

[0053] A fourth aspect of this application provides a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the intelligent investment advisor dialogue method based on dynamic memory reconstruction as described above.

[0054] This application provides a dialogue method for intelligent investment advisors based on dynamic memory reconstruction. The method is based on a dual-agent collaborative architecture. In multi-turn dialogues, it first receives the user's current text input and maps it to a current semantic vector, while simultaneously acquiring a stored set of historical semantic vector points. Then, it uses a density clustering algorithm to determine whether the current semantic vector belongs to an existing investment topic cluster and outputs the corresponding topic cluster memory set or initializes a new cluster. Subsequently, it calls a background agent, combined with a pre-set financial risk control logic prompt template, to perform a logical consistency check between the current input and the topic cluster memory set, generating a memory reconstruction control signal of type DELETE_OLD, MERGE, or KEEP_NEW. In response to this signal, the system performs replacement, deletion, or addition operations on historical semantic vectors in the vector database based on a unique storage identifier, and synchronously updates the topic cluster memory set. Finally, the front-end agent generates investment advice based on the updated memory set. Through this approach, this application has at least the following technical effects:

[0055] (1) By using the financial risk control logic verification and memory reconstruction control signal mechanism of the background intelligent agent, the contradictions in investment advice caused by memory conflict or semantic inconsistency are effectively avoided, thereby improving the financial compliance and logical consistency of the system.

[0056] (2) Density clustering is used to dynamically determine the attribution of the current semantic vector and the historical semantic vector point set, and the answer is generated based on the updated memory set, which ensures the continuity of memory fragments and semantic accuracy in multi-turn dialogues.

[0057] (3) By using a unique storage identifier to synchronously update the vector database and the topic cluster memory set, the atomicity, traceability and auditability of memory operations are realized, which enhances the reliability and compliance of the system in the context of financial supervision. Attached Figure Description

[0058] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0059] Figure 1 is a flowchart illustrating an embodiment of the intelligent investment advisor dialogue method based on dynamic memory reconstruction of this application.

[0060] Figure 2 is a schematic diagram of the structure of Embodiment 1 of the intelligent investment advisor dialogue system of this application.

[0061] Figure 3 is a flowchart of step S1 in Figure 1.

[0062] Figure 4 is a flowchart illustrating the process of "clustering the current semantic vector with the historical semantic vector point set based on the density clustering algorithm" in step S2 of the embodiment of this application.

[0063] Figure 5 is a flowchart illustrating the process of "determining whether the current semantic vector belongs to an existing investment topic cluster" in step S2 of an embodiment of this application.

[0064] Figure 6 is a flowchart of step S3 in Figure 1.

[0065] Figure 7 is a flowchart of step S4 in Figure 1.

[0066] Figure 8 is a schematic diagram of the hardware structure of an embodiment of the electronic device of this application.

[0067] Figure 9 is a schematic diagram of the structure of an embodiment of the computer-readable storage medium of this application. Detailed Implementation

[0068] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0069] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0070] It should be noted that, in this document, the term "comprising" or any other variation thereof is 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. Unless otherwise specified, 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 that element.

[0071] The following description, in conjunction with the accompanying drawings, details the enhancement method, system, device, and storage medium for the investment advice suitability review intelligent agent provided in this application, through specific embodiments and application scenarios.

[0072] Please refer to Figures 1 and 2 together. Figure 1 is a flowchart of the first embodiment of the intelligent investment advisor dialogue method based on dynamic memory reconstruction of this application, and Figure 2 is a structural diagram of the first embodiment of the intelligent investment advisor dialogue system of this application.

[0073] The intelligent investment advisor dialogue system in Figure 2 includes a semantic vector generation unit 21, a topic attribution determination unit 22, a memory consistency verification unit 23, a memory and vector collaborative update unit 24, and an investment advice generation unit 25. The memory consistency verification unit 23 includes a backend intelligent agent 231, and the investment advice generation unit includes a frontend intelligent agent 251. The units are connected in a pipelined coupling manner, and each unit executes the steps in Figure 1 one by one.

[0074] The intelligent investment advisor dialogue method based on dynamic memory reconstruction provided in this embodiment is implemented using a dual-agent collaborative architecture, comprising a backend agent 231 and a frontend agent 251. The method specifically includes the following steps:

[0075] S1: Receive the current text input of the user in the current dialogue round and map it to the current semantic vector, and obtain the set of historical semantic vector points stored in the vector database;

[0076] Step S1 is used to build the semantic memory foundation of the intelligent investment advisor dialogue system. As shown in Figure 3, this step specifically includes:

[0077] S101: Receive the natural language text entered by the user in the current dialogue turn as the current text input;

[0078] Specifically, natural language text refers to statements entered by users in free text form that express investment intentions or inquiries, such as "Is it still a good time to buy CATL?" or "Adjust my position to 30%", rather than structured instructions or machine code. Natural language text is used as the current text input and is denoted as T. curr .

[0079] S102: Perform text cleaning, sensitive information removal and financial statement standardization preprocessing operations sequentially on the current text input to generate preprocessed text;

[0080] Specifically, the current text input is first cleaned, including but not limited to removing irrelevant characters, correcting obvious pinyin errors, unifying the representation of numbers and units, and removing noisy data, in order to improve the machine readability of the text;

[0081] Then, sensitive information in the current text input is removed. Optionally, based on preset financial data security rules, potentially sensitive personal information or privacy details in the user input can be automatically identified and anonymized.

[0082] Next, financial terminology standardization is performed to unify the language of the current text input into standardized financial terminology. Optionally, a financial terminology mapping table or rule engine can be used to convert colloquial, ambiguous, or polysemous investment expressions into standard financial semantic units. For example, "adding to a position," "buying more," and "heavy investment" are standardized to "increasing the purchase ratio"; "liquidating" and "selling all" are standardized to "selling all"; "bullish" and "optimistic" are standardized to "bullish"; and "stop-loss price 200" is standardized to "setting a stop-loss price = 200 yuan." This step significantly improves the consistency of different users' expressions in the semantic space, which helps to improve the accuracy of subsequent clustering and logical verification.

[0083] S103: Call the pre-trained embedding model in the financial field to map the pre-processed text into a fixed-dimensional numerical vector as the current semantic vector;

[0084] Specifically, pre-trained embedding models in the financial field can be semantic encoders based on the Transformer architecture, such as BERT variants (e.g., FinBERT, ReutersBERT) that are further pre-trained or fine-tuned on financial texts including listed company announcements, research reports, financial news, and investor Q&A, or sentence embedding models (e.g., Sentence-BERT fine-tuned with financial corpora). This model can capture professional semantic relationships within the investment context; for example, it can bring "reducing holdings in CATL" closer to "reducing new energy positions" in the vector space, while maintaining a reasonable distance from "increasing holdings in photovoltaics."

[0085] In practice, the preprocessed text is input into a pre-trained embedding model in the financial field, and after mapping, a numerical vector with a fixed dimension is generated as the current semantic vector, labeled as V. curr .

[0086] S104: Obtain the historical semantic vector point set, which consists of historical semantic vectors generated by preprocessing and vectorizing the text input of the previous dialogue rounds in the same way as the current text input.

[0087] Specifically, the user's self-reported language text from the previous N historical dialogue rounds is obtained as the text input for the historical dialogue rounds, denoted as T. hist The historical semantic vectors obtained after performing the preprocessing in step S102 and the vectorization process in step S103 on the text input in each historical dialogue round are collected to form a historical semantic vector point set, labeled as V. his .

[0088] Alternatively, in other embodiments, for each historical dialogue round's text input T hist The large language model generates the answer A. hist .

[0089] S2: Based on the density clustering algorithm, the current semantic vector and the historical semantic vector point set are clustered to determine whether the current semantic vector belongs to an existing investment topic cluster; if it belongs to an existing investment topic cluster, the memory set of the topic cluster corresponding to the existing investment topic cluster is output; otherwise, a new investment topic cluster is initialized with the current semantic vector, and the corresponding new topic cluster memory set is generated.

[0090] Specifically, step S2 requires determining whether the investment intention expressed by the current user input belongs to an existing investment topic, thereby deciding whether to integrate the current user input into the existing investment topic memory or start a completely new investment topic. As shown in Figure 4, this step is implemented through clustering processing based on a density clustering algorithm. The density clustering algorithm clusters the current semantic vector and the historical semantic vector point set based on the cross-distance; the calculation of the cross-distance includes:

[0091] S201: Determine the basic semantic distance between the current semantic vector and any historical semantic vector in the set of historical semantic vector points, based on the cosine similarity between the current semantic vector and any historical semantic vector in the set of historical semantic vector points.

[0092] Vector databases store historical semantic vector point sets. v1,v2,…,v n It is V hist Any historical semantic vector in the.

[0093] The underlying semantic distance is used to calculate the cosine similarity between the current semantic vector and any historical semantic vector. This underlying semantic distance... Defined as the complement of the cosine distance, it is used to measure the dissimilarity of two investment topics in the original semantic space, and its mathematical form is:

[0094]

[0095] S202: Calculate the core distance between the current semantic vector and any historical semantic vector based on the k-Nearest Neighbors algorithm;

[0096] Specifically, the core distance is used to characterize the local density of the semantic space. For any historical semantic vector v i Its core distance d core (v i ) is defined as the historical semantic vector v i Distance to its k-th nearest neighbor:

[0097]

[0098] in express The The nearest neighbor vectors For the smoothing parameter (taken in this embodiment) ).

[0099] The local density threshold relied upon by density clustering algorithms is determined by parameters. In terms of control, MinPts represents the minimum number of conversation rounds required to form a cluster of investment topics. Core distance effectively reflects the density of investment topics. If an investment topic is discussed intensively, then... Smaller; conversely, larger.

[0100] S203: Select the maximum value among the basic semantic distance, the core distance of the current semantic vector, and the core distance of any historical semantic vector as the mutual distance between the current semantic vector and any historical semantic vector.

[0101] Calculate the current semantic vector V by combining the basic semantic distance and the core distance. curr With historical semantic vectors The distance between them is denoted as d. mreach The mathematical form is:

[0102]

[0103] Calculate the reach distance between each historical semantic vector in the historical semantic vector point set.

[0104] Select the basic semantic distance d(v) curr ,v i ), the core distance d of the current semantic vector core (v currand the core distance d of any historical semantic vector core (v i The maximum value among the three is used as the cross-distance between the current semantic vector and any historical semantic vector.

[0105] At this point, the reachability distance is no longer a simple cosine distance, but a robust metric that incorporates local density, thus better representing semantic topological metrics.

[0106] Next, as shown in Figure 5, the current semantic vector V is determined. curr The process of determining whether an investment topic falls under an existing category includes:

[0107] S204: Construct a minimum spanning tree based on the reach distance, and prune the minimum spanning tree to obtain the existing cluster of investment topics;

[0108] In step S203, the cross-distance between the current semantic vector and any historical semantic vector is calculated. Based on these cross-distances, a minimum spanning tree is constructed. By pruning this minimum spanning tree, several connected subgraphs are identified as investment topic clusters. Among them, connected subgraphs that existed before this dialogue constitute existing investment topic clusters. It should be noted that the number of existing investment topic clusters is not fixed; it can be zero or one or more, and the system can handle this adaptively.

[0109] S205: For each existing investment topic cluster, extract the core historical semantic vector from the topic cluster memory set;

[0110] Iterate through each existing investment topic cluster, and from the memory set of the associated topic clusters in each existing topic cluster, determine which historical semantic vectors belong to the core historical semantic vectors based on the core distance in step S202. Optionally, for any historical semantic vector v i If the core distance does not exceed the preset density threshold, the historical semantic vector is considered to be located in a local high-density region and has sufficient semantic representativeness, and is marked as a core historical semantic vector; otherwise, it is regarded as a boundary point or noise point and does not participate in the attribution determination.

[0111] Each existing investment topic cluster corresponds to at least one core historical semantic vector. In this way, we avoid using all semantic vectors in the existing investment topic cluster for calculation, thereby improving the efficiency of judgment. At the same time, relying only on high-density core vector points can enhance the robustness of investment topic attribution judgment and prevent misjudgment due to individual noise or edge expressions.

[0112] S206: If the mutual distance between the current semantic vector and any core historical semantic vector in the existing investment topic cluster does not exceed the preset dynamic threshold, then the current semantic vector is determined to belong to the existing investment topic cluster, and the topic cluster memory set corresponding to the existing investment topic cluster is output.

[0113] Specifically, if the distance between the current semantic vector and any core historical semantic vector in the existing investment topic cluster does not exceed a preset dynamic threshold, then the current semantic vector is determined to belong to the existing investment topic cluster, and the topic cluster memory set corresponding to the existing investment topic cluster is output.

[0114] For example, if a user previously discussed "new energy vehicles," and the current text input is "How is CATL's Q2 business?", then the current text input is determined to be a continuation of an existing investment topic cluster. The corresponding topic cluster memory set is then output and marked as... .

[0115] The topic cluster memory set is a logical set consisting of multiple historical memory fragments belonging to the same investment topic cluster. Each historical memory fragment corresponds to a dialogue round, including the user's text input in the historical dialogue round, as well as its corresponding large model answer and its unique storage identifier.

[0116] Each historical memory fragment is associated with a historical semantic vector through a unique storage identifier. Multiple historical semantic vectors constitute a set of historical semantic vector points, which are stored in a vector database.

[0117] S207: Initialize a new investment topic cluster with the current semantic vector and generate the corresponding new topic cluster memory set.

[0118] Optionally, the system selects the most recent M memory fragments (where M is a preset positive integer, e.g., M=10) from the historical dialogue rounds that are most relevant to the semantics of the current text input, as the initial memory set for the new investment topic cluster. The selection of these memory fragments is based on the cosine similarity between their corresponding historical semantic vectors and the current semantic vectors, and only memory fragments with similarity higher than a preset threshold are retained. The selected memory fragments, together with the memory fragments of the current dialogue round, constitute the new topic cluster memory set, and the mapped semantic vectors are stored in the vector database.

[0119] S3: Invoke the background intelligent agent 231, based on the preset financial risk control logic prompt word template, to perform a logical consistency check on the current text input and the topic cluster memory set, and generate a memory reconstruction control signal based on the check result. The memory reconstruction control signal includes any of the following:

[0120] The DELETE_OLD signal is used to trigger the deletion of memory segments in the topic cluster memory set that have logical conflicts with the current text input;

[0121] The MERGE signal is used to trigger semantic fusion of the current text input with the topic cluster memory set to generate a fused memory fragment;

[0122] The KEEP_NEW signal is used to trigger the retention of the current text input as a new memory fragment in the topic cluster memory set;

[0123] Specifically, the background intelligent agent 231, acting as a background logic supervisor, does not directly respond to the user but instead performs rigorous financial logic verification tasks. It utilizes the reasoning capabilities of a large language model to identify whether there are {attribute conflicts} (e.g., the historical record is "conservative / R1", and the current instruction is "full short position / R5") or {dependency completion relationships} (e.g., supplementing past ambiguous transaction amounts). Based on the verification, it outputs an explicit set of operation instructions.

[0124] As shown in Figure 6, the specific process includes:

[0125] S301: Receives a triple consisting of the current text input, the topic cluster memory set, and the financial risk control logic prompt word template as input; wherein, the financial risk control logic prompt word template is used to guide the background intelligent agent 231 to perform different types of logic consistency checks;

[0126] The background agent 231 receives a triple consisting of the current text input, the topic cluster memory set, and the financial risk control logic prompt word template as input, and marks it as...

[0127] Triple group ,

[0128] Where T curr Input the current text. For topic cluster memory set, P rules This is a template for explicitly coded financial risk control logic prompts.

[0129] The financial risk control logic prompt template is a pre-built, structured, large-language model guidance instruction in the background intelligent agent 231, designed for specific risk control scenarios. For example, the financial risk control logic prompt template can be a position conflict verification template, defining the role as "You are a securities investment compliance auditor";

[0130] You can create a template for verifying the consistency of risk preferences and define the role as "You are a wealth management risk control specialist"; you can also create a template for verifying time logic and timeliness and define the role as "You are an investment operations auditor".

[0131] In this embodiment, the financial risk logic prompt word template mentioned in step S301 is a set of structured natural language instructions pre-configured by financial compliance experts to guide the background intelligent agent 231 to perform specific types of logical consistency checks. These templates, as system-level pre-built resources, are automatically matched and injected into the reasoning memory fragment according to the investment topic type (such as "position management", "risk preference", "sector rotation") of the current text input during runtime.

[0132] For example, when a user's position adjustment is detected, the system loads a "position conflict verification template," instructing the backend agent 231 to compare the new and old text inputs for directional contradictions. When risk preference-related statements are identified, a "risk preference consistency template" is activated to verify whether the current investment topic conflicts with historical memory fragments. Each financial risk logic prompt template clearly defines the judgment rules for three scenarios: semantic fusion, logical conflict, and independent validity. It also forces the backend agent 231 to output standardized memory reconstruction control signals, thereby ensuring that the verification process is interpretable, auditable, and compliant with financial regulatory requirements.

[0133] S302: The background intelligent agent 231 executes the decision function and generates memory reconstruction control signals based on the thought chain reasoning process guided by the financial risk control logic prompt word template.

[0134] Background agent 231 uses financial risk logic prompt template P rules The guided thought process derivation involves executing a decision function. Optionally, the decision function in this embodiment is not a traditional program function, but rather refers to the decision function of the background intelligent agent 231 upon receiving the triplet. Then, based on the pre-set thought chain reasoning process in the financial risk logic prompt word template, intermediate reasoning steps are generated step by step, and finally the end-to-end reasoning process of outputting the unique memory reconstruction control signal is completed. For example, the thought chain reasoning process is as follows: 1. Check if there is a logical conflict; 2. If there is no conflict, determine whether semantic fusion is possible; 3. Otherwise, it is regarded as a new memory fragment.

[0135] The reasoning process of this thought chain is implemented by the large language model of the background intelligent agent 231, and the structured and executable nature of the decision results is guaranteed by mutual exclusion judgment results. Memory reconstruction control signals include, but are not limited to, DELETE_OLD, MERGE, or KEEP_NEW signals, as follows:

[0136] When there is a logical conflict between the current text input and the topic cluster memory set, a DELETE_OLD signal is generated;

[0137] When the current text input is semantically fused with the topic cluster memory set, a MERGE signal is generated;

[0138] When the current text input has neither a logical conflict with the topic cluster memory set nor meets the semantic fusion conditions, the KEEP_NEW signal is generated.

[0139] S4: In response to the memory reconstruction control signal, based on the unique storage identifier associated with the memory fragment to be processed, perform deletion, replacement or addition operations on the corresponding historical semantic vector in the vector database, and synchronously update the memory fragment to be processed associated in the topic cluster memory set.

[0140] Specifically, as shown in Figure 7, step S4 includes:

[0141] S401: In response to the type of the memory reconstruction control signal, determine the memory segment to be processed and obtain the unique storage identifier of the memory segment to be processed, wherein the unique storage identifier is associated with the corresponding historical semantic vector;

[0142] Specifically, based on the type of memory reconstruction control signal, the range of the memory segment to be processed is determined, and its unique storage identifier in the vector database is obtained through the indexing mechanism inside the intelligent advisor investment system.

[0143] For example, if a user's current text input in the current dialogue round is "I said I would buy CATL before, but I'm not buying it now," the background agent 231 analyzes the input and generates a DELETE_OLD signal, implicitly indicating that "the conflicting memory fragment is 'buy CATL'." The vector database receives the DELETE_OLD signal, determines that the memory fragment to be processed is "buy CATL," and then obtains the unique storage identifier of the memory fragment to be processed, "buy CATL."

[0144] When the background agent 231 generates a MERGE signal after analysis, the memory fragment to be processed is all the historical memory fragments contained in the entire existing investment topic cluster. The unique storage identifier associated with each of the historical memory fragments is obtained to form a unique storage identifier set.

[0145] When the background agent 231 generates the KEEP_NEW signal after analysis, the memory fragment to be processed is the user's current text input in the current round. This current text input belongs to a new memory fragment and has no associated unique storage identifier, so no query operation is required at this time.

[0146] S402: Based on a unique storage identifier, perform deletion, replacement, or addition operations on the memory fragments to be processed in the topic cluster memory set;

[0147] S403: And perform corresponding deletion, replacement or addition operations on the historical semantic vectors associated with unique storage identifiers in the vector database.

[0148] Specifically, steps S402 and S403 include:

[0149] In response to the memory reconstruction control signal being the DELETE_OLD signal, the unique storage identifier corresponding to the memory fragment to be processed that is determined to be logically conflicting is obtained, and the following actions are performed: the memory fragment to be processed is removed from the memory set of its topic cluster or marked as invalid, and the historical semantic vector associated with the unique storage identifier is deleted from the vector database.

[0150] Optionally, when a DELETE_OLD signal is received, it indicates that there is a logical conflict between the current text input and a certain historical memory fragment. For example, if the historical memory fragment is "buy Kweichow Moutai" and the current text input is "sell all liquor stocks", the historical memory fragment is directly removed from the topic cluster memory set or marked as invalid. Based on the conflict identifier attached to the DELETE_OLD signal, the unique storage identifier corresponding to the historical memory fragment is obtained. Then, the vector database performs a deletion operation to remove the associated historical semantic vector.

[0151] In this way, only conflicting historical memory fragments are deleted, while other valid memories of the same existing topic cluster are preserved, ensuring that the structure of the existing investment topic cluster is not destroyed as a whole.

[0152] In response to the memory reconstruction control signal being a MERGE signal, the unique storage identifier set associated with the topic cluster memory set corresponding to the existing investment topic cluster is obtained. Based on the current text input and the topic cluster memory set, a fused memory fragment is generated, which is mapped to a fused semantic vector. Then, the following actions are performed: replacing the original memory fragment in the topic cluster memory set with the fused memory fragment, and replacing all historical semantic vectors corresponding to the unique storage identifier set with the fused semantic vector in the vector database.

[0153] Optionally, when a MERGE signal is received, it indicates that the current user input has semantic overlap or integrability with historical memory fragments in the existing topic cluster memory set. For example, the current user input is "increase CATL position to 30%", while the historical memory fragment is "hold CATL". In this case, firstly, multiple unique storage identifier sets associated with the topic cluster memory set are obtained. Then, the current text input is semantically fused with the relevant historical memory fragments in the topic cluster memory set to generate a fused memory fragment, such as "the user plans to increase CATL holdings to 30%". Next, the same financial domain embedding model as in step S103 is called to map the fused memory fragment into a new fused semantic vector. Finally, in the vector database, all historical semantic vectors corresponding to the unique storage identifier set are atomically replaced with the new fused semantic vector.

[0154] In this way, memory fragmentation can be avoided, and a new fused semantic vector can be used to represent the latest consensus on the entire investment topic, which both compresses storage and improves the efficiency of subsequent clustering.

[0155] In response to the memory reconstruction control signal being the KEEP_NEW signal, the current semantic vector is written as a new record to the vector database, and the following actions are performed: adding the new memory fragment containing the current text input and the corresponding large model answer to the corresponding topic cluster memory set, and assigning a new unique storage identifier to the new memory fragment and associating it with the current semantic vector.

[0156] Optionally, when the KEEP_NEW signal is received, it indicates that the current text input has neither logical conflict with the topic cluster memory set nor meets the semantic fusion condition. At this time, a new memory fragment containing the current text input and the corresponding large model answer is added to the corresponding topic cluster memory set. At the same time, the current semantic vector generated by the current text input in step S103 is written as a new record into the vector database and assigned a new unique storage identifier.

[0157] In this way, new investment topics can be injected without interference, providing clusterable semantic anchors for subsequent dialogue.

[0158] All three types of operations use a unique storage identifier as the operation key, which can ensure: (1) accuracy: the target memory fragment and its associated vector are located directly through the unique identifier, avoiding accidental deletion or replacement due to semantic similarity; (2) atomicity: the updates of the vector database and the topic cluster memory set are performed in a collaborative manner to ensure that the two states are synchronized - if any sub-operation fails, the overall operation will not take effect, thereby ensuring data consistency; (3) traceability: all change operations record the unique storage identifier, the corresponding dialogue round, the memory reconstruction control signal type and the operation timestamp, which meets the requirements of the financial industry for the integrity, auditability and regulatory compliance of operation logs.

[0159] Through the refined vector management mechanism described in step S4, the intelligent investment advisor dialogue system has evolved from passive historical memory storage to active dynamic memory reconstruction, providing the front-end intelligent agent 251 with a memory foundation that is always logically self-consistent and semantically coherent.

[0160] S5: Call the foreground agent 251 to generate investment recommendations based on the updated topic cluster memory set.

[0161] Specifically, after steps S1 to S4 are completed, the front-end intelligent agent 251 reads the updated topic cluster memory set and can optionally obtain real-time market data of the current financial market (including but not limited to major indices, industry sector price changes, individual stock announcements and macroeconomic policy information).

[0162] The front-end intelligent agent 251, based on the user's historical investment topics, risk preferences, and dialogue memory fragments recorded in the topic cluster memory set, combined with real-time market data, drives the large language model to perform reasoning through pre-set investment suggestion generation prompt word templates, generating personalized investment suggestions that include specific targets, allocation ratios, and risk warnings. The investment suggestions are fed back to the user in the form of natural language text, and the content is ensured to comply with financial regulatory requirements.

[0163] In summary, the embodiments of the intelligent investment advisor dialogue method based on dynamic memory reconstruction and the embodiments of the intelligent investment advisor dialogue system of this application, based on the dynamic density clustering algorithm of mutual distance and the dual-agent explicit memory reconstruction mechanism, have achieved significant optimization effects in long-term memory management, logical self-consistency maintenance and reasoning efficiency of the intelligent investment advisor dialogue system. This application can improve the financial compliance and logical consistency of the system, ensure the coherence and semantic accuracy of memory fragments in multi-turn dialogues, and enhance the reliability and compliance capabilities of the system in financial regulatory scenarios.

[0164] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the intelligent investment advisor dialogue system in this embodiment is only illustrated by the above-described functional unit division. In practical applications, the above functions can be assigned to different functional units or modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application.

[0165] Please refer to Figure 8, which is a schematic diagram of the hardware structure of an embodiment of the electronic device of this application. The device includes a memory and a processor coupled to each other. The processor is used to execute program instructions stored in the memory to implement the corresponding process as described in the foregoing method embodiment. In a specific implementation scenario, the electronic device 30 may include, but is not limited to, a microcomputer or a server. In addition, the electronic device 30 may also include mobile devices such as laptops and tablets, which are not limited here.

[0166] The electronic device may include a processor 301 and a memory 302 storing program instructions.

[0167] When processor 301 executes the program, it implements the steps in the above method embodiments.

[0168] For example, the program can be divided into one or more modules / units, one or more of which are stored in memory 302 and executed by processor 301 to complete this application. The one or more modules / units can be a series of program instruction segments capable of performing a specific function, which describe the execution process of the program in the device.

[0169] Specifically, the processor 301 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0170] Memory 302 may include mass storage for data or instructions. For example, and not limitingly, memory 302 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 302 may include removable or non-removable (or fixed) media. Where appropriate, memory 302 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 302 is non-volatile solid-state memory.

[0171] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to one aspect of this disclosure.

[0172] The processor 301 implements any of the methods described above by reading and executing program instructions stored in the memory 302.

[0173] In one example, the electronic device may also include a communication interface 303 and a bus 310. The processor 301, memory 302, and communication interface 303 are connected via the bus 310 and communicate with each other.

[0174] The communication interface 303 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0175] Bus 310 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 310 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0176] Furthermore, in conjunction with the process of the foregoing method embodiments, as shown in FIG9, this application embodiment can be implemented using a computer-readable storage medium 40. The storage medium 40 stores program instructions 401; these program instructions 401 are executed by a processor to implement the steps of the above method embodiments.

[0177] This application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0178] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0179] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above method embodiments and achieve the same technical effects. To avoid repetition, it will not be described again here.

[0180] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0181] The functional modules shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on machine-readable media or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable media" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer grids such as the Internet, intranets, etc.

[0182] The foregoing flowcharts and / or block diagrams of methods, systems, and program products according to embodiments of this disclosure have described various aspects of the present disclosure. It should be understood that each block in the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to create a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the function / action specified in one or more blocks of the flowcharts and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified function or action, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0183] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A dialogue method for intelligent investment advisors based on dynamic memory reconstruction, characterized in that, The method is based on a dual-agent collaborative architecture. Includes the following steps: S1: Receive the current text input of the user in the current dialogue round and map it to the current semantic vector, and obtain the set of historical semantic vector points stored in the vector database; S2: Based on the density clustering algorithm, the current semantic vector and the historical semantic vector point set are clustered to determine whether the current semantic vector belongs to the existing investment topic cluster; If it belongs to the existing investment topic cluster, then output the topic cluster memory set corresponding to the existing investment topic cluster; otherwise, initialize a new investment topic cluster with the current semantic vector and generate the corresponding new topic cluster memory set. S3: Invoke the background agent to perform a logical consistency check on the current text input and the topic cluster memory set based on the preset financial risk control logic prompt word template, and generate a memory reconstruction control signal according to the check result. The memory reconstruction control signal includes any one of the following: DELETE_OLD signal, used to trigger the deletion of memory segments in the topic cluster memory set that have logical conflicts with the current text input; MERGE signal, used to trigger semantic fusion of the current text input and the topic cluster memory set to generate a fused memory segment; KEEP_NEW signal, used to trigger the retention of the current text input as a new memory segment in the topic cluster memory set; S4: In response to the memory reconstruction control signal, based on the unique storage identifier associated with the memory segment to be processed, perform deletion, replacement or addition operations on the corresponding historical semantic vector in the vector database, and synchronously update the memory segments to be processed associated in the topic cluster memory set; S5: Invoke the front-end agent to generate investment advice based on the updated topic cluster memory set.

2. The intelligent investment advisor dialogue method based on dynamic memory reconstruction according to claim 1, characterized in that, The density clustering algorithm described in step S2 clusters the current semantic vector and the historical semantic vector point set based on the cross-distance. The calculation of the cross-reach distance includes: determining the basic semantic distance between the current semantic vector and any historical semantic vector in the historical semantic vector point set based on the cosine similarity; calculating the core distance between the current semantic vector and any historical semantic vector based on the K-nearest neighbor algorithm; and selecting the maximum value among the basic semantic distance, the core distance of the current semantic vector, and the core distance of any historical semantic vector as the cross-reach distance between the current semantic vector and any historical semantic vector.

3. The intelligent investment advisor dialogue method based on dynamic memory reconstruction according to claim 2, characterized in that, The process of determining whether the current semantic vector belongs to an existing investment topic cluster in step S2 includes: constructing a minimum spanning tree based on the cross-distance, pruning the minimum spanning tree to obtain the existing investment topic clusters; for each existing investment topic cluster, extracting the core historical semantic vector from the topic cluster memory set; if the cross-distance between the current semantic vector and any of the core historical semantic vectors in the existing investment topic clusters does not exceed a preset dynamic threshold, then it is determined that the current semantic vector belongs to the existing investment topic cluster, and the topic cluster memory set corresponding to the existing investment topic cluster is output; otherwise, a new investment topic cluster is initialized with the current semantic vector, and a corresponding new topic cluster memory set is generated.

4. The intelligent investment advisor dialogue method based on dynamic memory reconstruction according to claim 1, characterized in that, In step S3, the background agent performs a logical consistency check on the current text input and the topic cluster memory set based on a preset financial risk control logic prompt template. Specifically, this includes: receiving a triple consisting of the current text input, the topic cluster memory set, and the financial risk control logic prompt template as input; wherein, the financial risk control logic prompt template is used to guide the background agent to perform different types of logical consistency checks; the background agent executes a decision function and generates the memory reconstruction control signal based on the thought chain reasoning process guided by the financial risk control logic prompt template.

5. The intelligent investment advisor dialogue method based on dynamic memory reconstruction according to claim 4, characterized in that, The generation of the memory reconstruction control signal is based on the following mutual exclusion determination result: when the current text input has a logical conflict with the topic cluster memory set, the DELETE_OLD signal is generated; The MERGE signal is generated when the current text input and the topic cluster memory set satisfy the semantic fusion condition; the KEEP_NEW signal is generated when the current text input and the topic cluster memory set have neither logical conflict nor satisfy the semantic fusion condition.

6. The intelligent investment advisor dialogue method based on dynamic memory reconstruction according to claim 1, characterized in that, Step S4 specifically includes: in response to the type of the memory reconstruction control signal, determining the memory segment to be processed and obtaining a unique storage identifier for the memory segment to be processed, wherein the unique storage identifier is associated with a corresponding historical semantic vector; based on the unique storage identifier, performing deletion, replacement, or addition operations on the memory segment to be processed in the topic cluster memory set; and performing corresponding deletion, replacement, or addition operations on the historical semantic vector associated with the unique storage identifier in the vector database.

7. The intelligent investment advisor dialogue method based on dynamic memory reconstruction according to claim 6, characterized in that, The steps of operating based on the unique storage identifier include: in response to the memory reconstruction control signal being the DELETE_OLD signal, obtaining the unique storage identifier corresponding to the memory fragment to be processed that is determined to be logically conflicting, and performing: removing or marking the memory fragment to be processed from the topic cluster memory set to which it belongs, and deleting the historical semantic vector associated with the unique storage identifier from the vector database; in response to the memory reconstruction control signal being the MERGE signal, obtaining the set of unique storage identifiers associated with the topic cluster memory set corresponding to the existing investment topic cluster, generating a fused memory fragment based on the current text input and the topic cluster memory set, mapping the fused memory fragment to a fused semantic vector, and performing: replacing the original memory fragment in the topic cluster memory set with the fused memory fragment, and replacing all historical semantic vectors corresponding to the unique storage identifier set with the fused semantic vector in the vector database; in response to the memory reconstruction control signal being the KEEP_NEW signal. The signal writes the current semantic vector as a new record into the vector database, and performs the following: adding a new memory fragment containing the current text input and the corresponding large model answer to the corresponding topic cluster memory set, and assigning a new unique storage identifier to the new memory fragment and associating it with the current semantic vector.

8. The intelligent investment advisor dialogue method based on dynamic memory reconstruction according to claim 1, characterized in that, Step S1 specifically includes: receiving natural language text input by the user in the current dialogue round as the current text input; performing preprocessing operations such as text cleaning, sensitive information removal, and financial expression standardization on the current text input in sequence to generate preprocessed text; calling a pre-trained embedding model in the financial field to map the preprocessed text into a fixed-dimensional numerical vector as the current semantic vector; and obtaining the historical semantic vector point set, which is composed of historical semantic vectors generated by preprocessing and vectorizing the text input of previous dialogue rounds in the same way as the current text input.

9. A smart investment advisor dialogue system, characterized in that, The system is implemented based on a dual-agent collaborative architecture, including: a semantic vector generation unit, used to receive the current text input of the user's current dialogue round and map it into a current semantic vector, and obtain the historical semantic vector point set stored in the vector database; a topic affiliation determination unit, used to perform clustering processing on the current semantic vector and the historical semantic vector point set based on a density clustering algorithm to determine whether the current semantic vector belongs to an existing investment topic cluster; if it belongs to the existing investment topic cluster, it outputs the topic cluster memory set corresponding to the existing investment topic cluster; otherwise, it initializes a new investment topic cluster with the current semantic vector and generates the corresponding new topic cluster memory set; a memory consistency verification unit, used to call the background agent, based on a preset financial risk control logic prompt word template, to perform logical consistency verification on the current text input and the topic cluster memory set, and generate a memory reconstruction control signal according to the verification result, the memory reconstruction control signal including any one of the following: a DELETE_OLD signal, used to trigger the deletion of memory fragments in the topic cluster memory set that have logical conflicts with the current text input; MERGE A signal is used to trigger semantic fusion of the current text input with the topic cluster memory set to generate a fused memory fragment; a KEEP_NEW signal is used to trigger the retention of the current text input as a new memory fragment in the topic cluster memory set; a memory and vector collaborative update unit is used to respond to the memory reconstruction control signal, and perform deletion, replacement or addition operations on the corresponding historical semantic vector in the vector database based on the unique storage identifier associated with the memory fragment to be processed, and synchronously update the memory fragment to be processed associated in the topic cluster memory set; an investment suggestion generation unit is used to call the foreground agent to generate investment suggestions based on the updated topic cluster memory set.

10. An electronic device, characterized in that, It includes a memory and a processor that are coupled to each other, the processor being used to execute program instructions stored in the memory to implement the intelligent investment advisor dialogue method based on dynamic memory reconstruction as described in any one of claims 1 to 8.

11. A computer-readable storage medium having program instructions stored thereon, characterized in that, When the program instructions are executed by the processor, they implement the intelligent investment advisor dialogue method based on dynamic memory reconstruction as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Systems and methods of large language model driven orchestration of task-specific machine learning software agents

    US12061970B1

  • Generative artificial intelligence enterprise search

    US20240202221A1

  • User dialogue generation method and system based on memory fusion

    CN120952153A

  • Public opinion risk assessment method and system based on multi-agent and large language model

    CN121052639A