A financial question-answering system based on agent and RAG knowledge base cooperation
Patent Information
- Application Number
- CN202610125328.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-29
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2046-01-29
AI Technical Summary
这种局限性使得现有系统难以支撑具备财务专业深度的自动化分析与问答应用
[0009]The embodiments in this specification construct a computational relationship network and perform intent recognition on user questions. This enables the location of target data cells through semantic retrieval, and then the search for related data based on the computational relationship network. This effectively solves the problems of structural destruction and logical breakage that exist in traditional methods when processing financial tables.
Smart Images

Figure CN121705404B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a financial question-answering system based on the collaboration of Agent and RAG knowledge base. Background Technology
[0002] In financial management applications, professionals often need to quickly extract accurate information and answer complex business questions from massive amounts of corporate financial documents. These documents are typically in unstructured electronic form, such as annual reports, quarterly financial statements, and internal audit documents for listed companies. Structured tables containing key financial data, such as income statements, balance sheets, and cash flow statements, constitute the core information carriers of these documents. Traditional keyword matching retrieval technologies face significant limitations in handling these needs because they cannot understand the business semantics behind user queries and struggle to address comprehensive problems involving multi-data-point correlation calculations.
[0003] With the development of artificial intelligence technology, knowledge-based question answering methods based on Retrieval Augmentation (RAG) have been introduced into this field, aiming to improve the efficiency and accuracy of information retrieval. These systems support semantic similarity-based retrieval by slicing document content and converting it into vector representations, thus overcoming to some extent the mechanical limitations of keyword matching. However, existing RAG-based systems still have several inherent shortcomings when processing financial table data.
[0004] First, common text slicing methods easily disrupt the inherent logical structure and integrity of financial tables, resulting in individual text fragments potentially containing only partial relevant data and failing to reflect the interrelationships between accounts. Second, the system's retrieval process primarily relies on the vectorized representation of text fragments, lacking explicit modeling and utilization of the inherent computational relationships between financial data.
[0005] When users ask questions involving the calculation or comparative analysis of financial indicators, such as inquiring about the reasons for changes in gross profit margin or trends in solvency, existing systems typically only return text paragraphs that are semantically similar to the query. These paragraphs may describe relevant concepts, but often fail to provide complete analytical data. The system itself lacks the ability to automatically identify and correlate all the necessary data components for calculation. This limitation makes it difficult for existing systems to support automated analysis and question-and-answer applications requiring in-depth financial expertise. Summary of the Invention
[0006] To overcome the aforementioned problems in the existing technology, this disclosure provides a financial question-answering system based on the collaboration of an Agent and a RAG knowledge base. Specifically, this application is implemented through the following technical solution: According to a first aspect of the embodiments of this specification, a financial question-answering system based on the collaboration of an Agent and a RAG knowledge base is provided, comprising: A knowledge base construction module is used to identify data cells in the original document, generate text descriptions for each data cell, and construct a computational relationship network. The computational relationship network includes nodes and edges. The nodes are used to record the original data and corresponding text descriptions of the data cells, and the edges are used to represent the computational relationships between several nodes. The interaction analysis module is used to determine the retrieval instruction by recognizing the intent of the natural language questions input by the user; the retrieval instruction includes generating semantic retrieval instructions and relational retrieval instructions. The retrieval processing module is configured to obtain semantic retrieval results in each of the text descriptions based on the semantic retrieval instructions, the semantic retrieval results including a plurality of target data cells; and to find data cells associated with the plurality of target data cells in the computational relationship network based on the relationship retrieval instructions to obtain relationship retrieval results, and to generate a final query result based on the semantic retrieval results and the relationship retrieval results.
[0007] According to a second aspect of the embodiments of this specification, a financial question-answering method based on the collaboration of an Agent and a RAG knowledge base is provided, comprising: By recognizing the intent of the natural language question input by the user, a search instruction is determined; the search instruction includes generating semantic search instructions and relational search instructions. Based on the semantic retrieval instructions, semantic retrieval results are obtained from each of the text descriptions, and the semantic retrieval results include several target data cells; the text descriptions are pre-generated for the data cells in the original document. Based on the relationship retrieval instruction, the relationship retrieval result is obtained by searching for data cells associated with the plurality of target data cells in the computational relationship network; the computational relationship network includes nodes and edges, the nodes are used to record the original data and corresponding text description of the data cells, and the edges are used to represent the computational relationship between the plurality of nodes; The final query results are generated based on the semantic search results and the relational search results.
[0008] According to a third aspect of the embodiments of this specification, a computer-readable storage medium is provided, wherein the storage medium stores a computer program that, when executed by a processor, implements the method as described in the second aspect.
[0009] The embodiments in this specification construct a computational relationship network and perform intent recognition on user questions. This enables the location of target data cells through semantic retrieval, and then the search for related data based on the computational relationship network. This effectively solves the problems of structural destruction and logical breakage that exist in traditional methods when processing financial tables.
[0010] Furthermore, by integrating semantic retrieval results with relational retrieval results to generate the final query results, it achieves full-process coverage from underlying data verification to business context analysis, providing complete business explanations and improving the reliability and systematic analysis capabilities of financial Q&A. Attached Figure Description
[0011] Figure 1 This is a schematic diagram of a financial question-answering system based on the collaboration of an Agent and a RAG knowledge base, as provided in the embodiments of this specification. Figure 2 This is a schematic diagram illustrating an application example of the financial question-and-answer system provided in the embodiments of this specification; Figure 3 This is a flowchart illustrating a financial question-answering method based on the collaboration of an Agent and a RAG knowledge base, as provided in the embodiments of this specification. Detailed Implementation
[0012] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0013] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0014] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0015] In the field of financial management, professionals often need to quickly extract accurate information and answer complex business questions from massive amounts of corporate financial documents. These financial documents typically exist in unstructured electronic document format, such as annual reports, quarterly financial statements, and internal audit documents for listed companies. Among them, structured tables containing key financial data, such as income statements, balance sheets, and cash flow statements, constitute the core information carrier of the documents. Traditional keyword matching retrieval technology faces significant limitations in handling these needs because it cannot understand the business semantics behind user queries, and it is even more difficult to deal with comprehensive problems involving the correlation and calculation of multiple data points.
[0016] With the development of artificial intelligence technology, retrieval-enhanced knowledge-based question answering has been introduced into this field, aiming to improve the efficiency and accuracy of information retrieval. These systems support semantic similarity-based retrieval by slicing document content and converting it into vector representations, thus overcoming to some extent the mechanical limitations of keyword matching. However, existing retrieval-enhanced systems still have several inherent shortcomings when processing financial table data.
[0017] First, common text slicing methods easily disrupt the inherent logical structure and integrity of financial tables, resulting in individual text fragments potentially containing only partial relevant data and failing to reflect the interrelationships between accounts. Second, the system's retrieval process primarily relies on the vectorized representation of text fragments, lacking explicit modeling and utilization of the inherent computational relationships between financial data.
[0018] When users ask questions involving the calculation or comparative analysis of financial indicators, such as inquiring about the reasons for changes in gross profit margin or trends in solvency, existing systems typically only return text paragraphs that are semantically similar to the query. These paragraphs may describe relevant concepts, but often fail to provide complete analytical data directly. The system itself lacks the ability to automatically identify and correlate all the necessary data components for calculation; for example, when answering questions about gross profit margin, it cannot ensure that it can simultaneously and accurately retrieve the current period's operating revenue and operating costs. This limitation makes it difficult for existing systems to support automated analysis and question-and-answer applications requiring in-depth financial expertise.
[0019] Therefore, there is a need to develop an intelligent question-answering system that can deeply integrate knowledge from the financial domain, especially one that can understand and utilize the computational logic between data. This system needs to be able to collaboratively apply semantic understanding and relational reasoning during the retrieval phase, thereby providing high-quality answers to complex financial analysis questions that are both accurate and context-aware.
[0020] Please see Figure 1 and Figure 2 , Figure 1 This specification provides an embodiment of a financial question-answering system based on the collaboration of an Agent and a RAG knowledge base. Figure 2 This is a schematic diagram illustrating an application example of the financial question-and-answer system provided in the embodiments of this specification. The financial question-and-answer system includes: A knowledge base construction module is used to identify data cells in the original document, generate text descriptions for each data cell, and construct a computational relationship network. The computational relationship network includes nodes and edges. The nodes are used to record the original data and corresponding text descriptions of the data cells, and the edges are used to represent the computational relationships between several nodes. The interaction analysis module is used to determine the type of retrieval instruction by recognizing the intent of the natural language questions input by the user; the retrieval instructions include generating semantic retrieval instructions and relational retrieval instructions. The retrieval processing module is configured to obtain semantic retrieval results in each of the text descriptions based on the semantic retrieval instructions, the semantic retrieval results including a plurality of target data cells; and to find data cells associated with the plurality of target data cells in the computational relationship network based on the relationship retrieval instructions to obtain relationship retrieval results, and to generate a final query result based on the semantic retrieval results and the relationship retrieval results.
[0021] Specifically, the knowledge base construction module is responsible for structuring the original documents. This module identifies data cells in the document and generates a corresponding text description for each cell. The text description incorporates information such as the row and column headings of the cell, forming a natural language expression with clear business semantics. Furthermore, this module constructs a computational relationship network using a graph structure, where nodes record the original numerical values and text descriptions of data cells, and edges represent the mathematical computational relationships between different nodes.
[0022] The interaction analysis module is responsible for parsing user questions and generating search instructions. This module performs intent recognition on the natural language questions entered by the user and determines the type of search instruction to be executed based on the recognition results. This embodiment defines two types of search instructions: semantic search instructions for finding semantically relevant content from text descriptions, and relational search instructions for finding data with computational associations with specified data cells from a computational relational network.
[0023] The retrieval processing module is responsible for executing the retrieval operation and generating the final answer. This module first performs semantic matching on each text description based on semantic retrieval instructions, obtaining semantic retrieval results. These results contain a set of target data cells determined by semantic similarity. Subsequently, using these target data cells as starting points, the module searches for other data cells related to them through computational edges in the computational relationship network based on relation retrieval instructions, obtaining relation retrieval results. Finally, the module integrates the semantic retrieval results and relation retrieval results to generate the system's final query result for the user's question. This design aims to upgrade from "simple answers" to "deep analysis," enriching the content of the response.
[0024] Based on the above knowledge base construction modules, the embodiments of this specification can construct a RAG (Retrieval Enhanced Generation) knowledge base. The RAG knowledge base of these embodiments can consist of a vector database and a graph database. On one hand, the text descriptions generated from data cells are stored in the vector database, supporting retrieval based on semantic similarity; on the other hand, the computational relationships between data cells are constructed as a graph structure and stored in the graph database, supporting relational queries based on mathematical logic. These two storage methods together constitute the knowledge foundation of the system.
[0025] In this embodiment, the agent is manifested as multiple processing modules with autonomous decision-making capabilities. Among them, the interaction analysis module acts as the decision agent, which autonomously determines the type and priority of the retrieval strategy by recognizing the intent of natural language questions; the retrieval processing module acts as the execution agent, which autonomously completes the entire process from data retrieval to result fusion by coordinating the two paths of semantic retrieval and relational retrieval.
[0026] Specifically, when a user asks a financial question, the system uses the Agent module to analyze the user's intent and generate dual search instructions. These instructions are executed in parallel within the RAG knowledge base: the semantic search instruction searches for relevant text descriptions in the vector database, while the relational search instruction traverses and computes the relational network in the graph database. Finally, the Agent coordinates the two search results to generate a financial analysis answer that incorporates both business context and computational depth.
[0027] For example, in the knowledge base construction module, for a fragment of Company A's profit statement in an original document in the original document library, containing data cells such as "Operating Revenue: 1,000,000 yuan", "Operating Costs: 600,000 yuan", and "Gross Profit: 400,000 yuan", text descriptions such as "Company A's operating revenue in 2024 was 1,000,000 yuan", "Company A's operating costs in 2024 were 600,000 yuan", and "Company A's gross profit in 2024 was 400,000 yuan" can be generated respectively.
[0028] Furthermore, three corresponding nodes are established in the computational relationship network. Simultaneously, edges are established between the "Operating Revenue" node, the "Operating Cost" node, and the "Gross Profit" node, with the computational relationship encoded on them being Gross Profit = Operating Revenue - Operating Cost; thereby completing the generation of the text description and computational relationship network, and storing it in the RAG knowledge base.
[0029] Then, the interactive analysis module receives the user input "Please analyze the changes in gross profit margin." and recognizes that the user's intention is to perform "financial ratio calculation and trend analysis," which falls under the category of calculation and analysis questions. Based on this, it generates semantic search instructions to find descriptive text related to "gross profit margin," "decline," and "reasons"; and generates relational search instructions to find the data needed to calculate the gross profit margin and possible influencing factors.
[0030] Based on the question "Please analyze the changes in gross profit margin," simply returning a pre-stored gross profit margin value and its changes would not be a satisfactory answer. The semantic search results in this embodiment provide direct business context. They might find a passage from management's discussion and analysis: "The decline in gross profit margin this period was mainly due to rising raw material prices and increased promotional expenses resulting from intensified market competition." This provides a preliminary, qualitative explanation for the answer.
[0031] The purpose of relation retrieval results is to provide accurate and quantitative data evidence. Starting with the "gross profit margin" cell, the system automatically locates and retrieves the "gross profit margin" and "operating cost" data cells for the current period and the base period based on the edges in the relation network (gross profit margin = (operating revenue - operating cost) / operating revenue).
[0032] Finally, by integrating the above information, a richer answer can be constructed: Confirming the facts: "Calculations show that the gross profit margin for this period is 18%, a decrease of 4 percentage points from 22% in the previous period." Quantitative analysis: "This change stems from the fact that while operating revenue increased by 5%, operating costs increased by 10%, with the cost growth rate exceeding the revenue growth rate being the main reason." Contextualization: "This analysis is consistent with the 'rising raw material prices' factor mentioned by management in the annual report."
[0033] This specification's embodiments, by constructing a computational relationship network and recognizing user intent, can locate target data cells through semantic retrieval, and then perform related data searches based on the computational relationship network. This effectively solves the structural damage and logical breaks that exist in traditional methods when processing financial tables. Furthermore, by fusing semantic retrieval results with relationship retrieval results to generate the final query result, it achieves full-process coverage from underlying data verification to business context analysis, providing a complete business explanation and improving the reliability and systematic analysis capabilities of financial Q&A.
[0034] In one or more preferred embodiments of the present invention, the knowledge base construction module is further configured to: The directionality, computation operators, and weight parameters of the edges in the computational relationship network are determined, and the weight parameters are used to characterize the importance of the corresponding computational relationship.
[0035] During the calculation process, the data flow is definite. For example, in the relationship Gross Profit = Revenue - Cost of Goods Sold, "Revenue" and "Cost of Goods Sold" are input nodes, and "Gross Profit" is the output node. Labeling the directionality means that the system explicitly records that data flows from the "Revenue" and "Cost of Goods Sold" nodes to the "Gross Profit" node. This avoids logical confusion during reverse reasoning or traversal.
[0036] Calculation operators are used to specify the concrete mathematical rules governing the operations between nodes. They do more than simply indicate a "relationship"; they precisely define "how to calculate." For example, the operator in the relationship above is "subtraction." Other common operators include "addition" (as in calculating "total assets"), "division" (as in calculating "gross profit margin"), and so on.
[0037] Based on directionality and computational operators, the retrieval processing module can know for sure that starting from the "Operating Revenue" and "Operating Costs" nodes, and following an edge marked with the "Subtraction" operator pointing to "Gross Profit," the value of "Gross Profit" can be calculated. This enables the system not only to retrieve data but also to dynamically perform calculations based on the network, verify data consistency, and explain the derivation process of the answer.
[0038] The weighting parameter provides the basis for prioritizing intelligent retrieval and decision-making in complex networks. Specifically, the weighting parameter is a quantitative indicator attached to each computational relationship. Its value can be pre-set based on financial domain knowledge to distinguish the importance of different computational relationships. For example, reconciliation relationships mandated by accounting standards (such as the balance sheet balancing formula) are assigned higher weights, while derivation relationships based on statistical estimations are assigned relatively lower weights.
[0039] When a system needs to traverse the network from a single node to find relevant data, it may face the choice of multiple paths. Therefore, when searching for data cells associated with the target data cells, the retrieval processing module can traverse each edge based on weight parameters to determine the relationship retrieval results.
[0040] Furthermore, the step of finding data cells associated with the plurality of target data cells to obtain relationship retrieval results includes: When searching for data cells associated with the target data cells, a graph traversal algorithm based on weight parameters is used, prioritizing the traversal of edges with higher weight parameters; The nodes connected to the edges with higher weight parameters are taken as associated data cells, and the relationship retrieval results are determined based on the associated data cells.
[0041] For example, when a user asks "What are the key factors affecting net profit?", the retrieval processing module can traverse the calculation network starting from the "net profit" node. It may simultaneously discover edges leading to "operating profit" and edges leading to "non-operating income and expenses". According to predefined weights, the edge "Net Profit = Operating Profit - Income Tax" has a much higher weight than the edges related to "non-operating income and expenses", because operating profit is a core indicator reflecting a company's ability to continue operating.
[0042] Accordingly, the retrieval and processing module will prioritize traversing high-weight paths, thereby first retrieving and analyzing key factors such as "operating profit" and its subordinate "operating revenue," "operating costs," and "period expenses," and then prioritizing and emphasizing the analysis of these high-weight factors in the final answer, thus generating an answer that is more in line with financial analysis conventions and focuses on the core issues.
[0043] In one or more preferred embodiments of the present invention, the knowledge base construction module is further configured to: Determine the data timestamps of the nodes in the computational relationship network; For multiple nodes representing the same financial indicator, edges are constructed between the multiple nodes based on the data timestamps to represent the temporal relationship.
[0044] During the knowledge base construction process, the system adds a data timestamp attribute to each node in the computational relationship network. This timestamp precisely records the accounting period of the financial value corresponding to the node, transforming the originally isolated numerical data into information units with clear time coordinates. Based on these timestamps, the knowledge base construction module identifies all sets of nodes representing the same financial indicator and constructs temporal relationship edges for them in chronological order. These temporal edges form data chains organized along the time dimension in the computational relationship network. For example, connecting the "operating revenue" nodes for 2021, 2022, and 2023 sequentially establishes a direct association path for cross-period data. This design makes the time dimension an inherent structural characteristic of the network, rather than an externally added label.
[0045] Furthermore, based on this time-enhanced computational relationship network, the interactive analysis module can generate more targeted search instructions. The determination of the search instructions includes: If the natural language question is identified to contain a comparison intent, semantic retrieval instructions and relation retrieval instructions are generated for retrieving data from multiple comparable periods based on the temporal relation edges. If the natural language question is identified to contain trend analysis intent, semantic retrieval instructions and relation retrieval instructions are generated for retrieving data from multiple consecutive periods based on the time-series relation.
[0046] In the interactive analysis module, when a user's question contains a comparative intent, such as "compare the company's net profit over the past two years," it generates instructions specifically for retrieving data from multiple comparable periods. These instructions explicitly require the use of time-series relationship edges to quickly locate and obtain the data node set corresponding to the comparable periods, ensuring the consistency and comparability of the basic comparison.
[0047] When a trend analysis intent is identified, such as "analyze the R&D investment trend over the past five years," the module generates instructions for retrieving data from multiple consecutive periods. These instructions fully utilize the continuous data chain formed by temporal relationships, requiring the system to obtain a complete data sequence along the time-series path, providing ample data support for trend identification and change analysis.
[0048] For example, when faced with a query to "analyze the trend of the company's gross profit margin over the past three years", the system first quickly locates the relevant nodes of gross profit margin for the three years through the temporal relationship edge, avoiding a complex semantic matching process; then it obtains the corresponding operating revenue and operating cost data for each year along the calculation relationship edge; finally, it combines the relevant explanatory content obtained from semantic retrieval to generate a complete answer that includes trend charts, change calculations, and cause analysis.
[0049] The temporal enhancement mechanism in the embodiments of this specification enables the system to efficiently handle complex financial problems involving the time dimension. By directly utilizing pre-built temporal relationship paths, it significantly improves retrieval efficiency and analysis depth.
[0050] Furthermore, the interactive analysis module is also used to generate search strategy description information after the search instruction is determined; The retrieval processing module is used to generate the final query results based on the retrieval strategy description information, semantic retrieval results, and relational retrieval results.
[0051] After generating a specific search instruction, the interactive analysis module also generates a search strategy description. For example, when a user requests a "comparative analysis of the company's gross profit margin changes over the past two years," the system identifies the comparison intent and generates the corresponding search instruction. Simultaneously, the search strategy description explicitly requires: "Calculate the absolute value and magnitude of the gross profit margin for the two periods, and compare and analyze the differences in the changes of its constituent elements." Based on this strategy information, the search processing module first obtains the operating revenue and operating cost data for the two years through relational retrieval, calculating the precise gross profit margin and its changes; then, combining this with relevant text descriptions obtained through semantic retrieval, it generates a complete answer that includes data comparison, change analysis, and explanations of the reasons.
[0052] Taking the question "Analyze the R&D investment trend over the past five years" as an example, after the system identifies the intention to analyze the trend, the generated retrieval strategy description information may require: "Calculate the compound growth rate, identify trend turning points, and conduct analysis in conjunction with industry background." Based on this strategy, the system obtains a five-year continuous R&D investment data sequence through relational retrieval, obtains relevant policy descriptions and industry background information for each year through semantic retrieval, and finally generates an in-depth report that includes trend charts, growth calculations, and background analysis.
[0053] Furthermore, generating the final query result based on the retrieval strategy description information, semantic retrieval results, and relational retrieval results includes: The calculated relationship represented by the edge is performed on the original data recorded by the node in the relation retrieval result to obtain derived data.
[0054] In generating the final query results, computational operations are first performed on the data nodes obtained from the relation retrieval results. The rules for these computational operations are directly derived from the computational relationships defined by the edges in the computational relation network. The system reads the original values recorded in the nodes and performs precise calculations according to the mathematical operation rules represented by the edges, thereby obtaining the derived data required by the user's question. This process realizes the transformation from basic data to analytical indicators, enabling the system to dynamically generate analytical conclusions that go beyond the pre-stored data.
[0055] The retrieval strategy description information, derived data, and text descriptions in the semantic retrieval results are integrated to generate the final query results.
[0056] After obtaining the derived data, the system enters the information integration phase. At this stage, the retrieval strategy description information serves as a template for the integration process, defining the organizational logic and presentation method of various types of information. The system organically integrates the calculated derived data with relevant text descriptions from the semantic retrieval results, rather than simply piecing them together.
[0057] For example, when a user requests "analysis of the company's profitability changes over the past two years," the search strategy description might include the following instructions: "Calculate the changes in core profitability indicators such as gross profit margin and net profit margin, and focus on analyzing the relationship between changes in operating revenue and costs and expenses." The system first performs calculations defined in the relational network based on the raw data such as operating revenue, operating costs, and period expenses from the relational search results, obtaining derived data such as gross profit margin and net profit margin for each year. Subsequently, the system integrates this derived data with textual descriptions obtained from the semantic search results (such as management's discussions on cost control and explanations of changes in the market environment). The final query result might look like this: "Calculations show that the company's gross profit margin increased from 30.5% in 2022 to 32.1% in 2023, mainly due to a 15% increase in operating revenue while operating costs only increased by 12%. Management pointed out in the annual report that this improvement stemmed from improved production efficiency and product structure optimization…" Through a strategy-guided data fusion mechanism, the system ensures that raw data can be transformed into insightful professional analysis, providing accurate quantitative conclusions while incorporating sufficient business context explanations, ultimately generating a complete analytical report that meets the needs of financial professionals.
[0058] Furthermore, to ensure data consistency verification and correlation analysis capabilities, and to improve the reliability and professional value of the system output results, the retrieval processing module is also used for: When the text description in the semantic retrieval results is logically related to the derived data, the related information is established and marked in the final query results; When there is a numerical contradiction between the text description in the semantic retrieval results and the derived data, the contradictory information is marked in the final query results.
[0059] In the embodiments described in this specification, when the text description in the semantic search results is logically related to the derived financial indicators calculated based on the relational search results, the search processing module will actively identify and establish a clear correspondence in the final query results. This association is not merely a simple juxtaposition of text and numbers, but rather a fusion of qualitative description and quantitative analysis through deep semantic understanding. For example, when the semantic search results contain the statement "This year, the company improved its profitability by optimizing its product structure," and the relational search results show that the gross profit margin has indeed increased, the system will establish a correspondence between this text description and the specific gross profit margin increase data in the final answer, forming a coherent analysis such as "The product structure optimization mentioned by management has indeed brought about profit improvement, specifically reflected in the increase in gross profit margin from X% to Y%."
[0060] When the system detects a numerical discrepancy between the text description in the semantic search results and the derived financial indicators calculated based on the relational search results, it initiates a data verification mechanism and explicitly marks the discrepancy in the final query results. This discrepancy identification demonstrates the system's rigor and avoids misleading users. For example, if the semantic search results contain the description "operating revenue remained stable this quarter," while the relational search results show a significant decline in operating revenue, the system will not simply ignore this discrepancy. Instead, it will present both pieces of information in the final answer and clearly mark the inconsistency, such as "Although the text description mentions that operating revenue remained stable, calculations based on financial statement data show that operating revenue actually decreased from A to B this quarter, indicating a significant difference."
[0061] Please see Figure 3 This specification also provides a financial question-answering method based on the collaboration of Agent and RAG knowledge base, including: By recognizing the intent of the natural language question input by the user, a search instruction is determined; the search instruction includes generating semantic search instructions and relational search instructions. Based on the semantic retrieval instructions, semantic retrieval results are obtained from each of the text descriptions, and the semantic retrieval results include several target data cells; the text descriptions are pre-generated for the data cells in the original document. Based on the relationship retrieval instruction, the relationship retrieval result is obtained by searching for data cells associated with the plurality of target data cells in the computational relationship network; the computational relationship network includes nodes and edges, the nodes are used to record the original data and corresponding text description of the data cells, and the edges are used to represent the computational relationship between the plurality of nodes; The final query results are generated based on the semantic search results and the relational search results.
[0062] This specification also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method shown in any of the above embodiments.
[0063] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0064] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0065] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0066] The embodiments of the subject matter and functional operation described in this specification can be implemented in the following ways: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or combinations thereof. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier for execution by a data processing apparatus or for controlling the operation of a data processing apparatus. Alternatively or additionally, the program instructions may be encoded on artificially generated propagation signals, such as machine-generated electrical, optical, or electromagnetic signals, which are generated to encode information and transmit it to a suitable receiving device for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or combinations thereof.
[0067] The processing and logic described in this specification can be executed by one or more programmable computers that execute one or more computer programs to perform corresponding functions by operating on input data and generating output.
[0068] Suitable computers for executing computer programs include, for example, general-purpose and / or special-purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit receives instructions and data from read-only memory and / or random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include one or more mass storage devices for storing data, such as disks, magneto-optical disks, or optical disks, or the computer will be operatively coupled to such mass storage devices to receive data from or transfer data to them, or both. However, a computer is not required to have such devices. Furthermore, a computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, to name a few.
[0069] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, such as semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks. Processors and memory may be supplemented by or incorporated into dedicated logic circuitry.
[0070] While this specification contains numerous specific implementation details, these should not be construed as limiting the scope of any invention or the scope of the claims, but rather are primarily intended to describe features of specific embodiments of a particular invention. Certain features described in the various embodiments herein may also be implemented in combination in a single embodiment. Conversely, various features described in a single embodiment may also be implemented separately in various embodiments or in any suitable sub-combination. Furthermore, while features may function in certain combinations as described above and even initially claimed in this way, one or more features from a claimed combination may be removed from that combination in some cases, and a claimed combination may refer to a sub-combination or a variation thereof.
[0071] Similarly, although the operations are depicted in a specific order in the accompanying drawings, this should not be construed as requiring these operations to be performed in the specific order shown or sequentially, or requiring all illustrated operations to be performed to achieve the desired result. In some cases, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and components in the above embodiments should not be construed as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
[0072] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings are not necessarily shown in a specific order or sequence to achieve the desired result. In some implementations, multitasking and parallel processing may be advantageous.
[0073] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A financial question-answering system based on the collaboration of Agent and RAG knowledge base, characterized in that, include: The knowledge base construction module is used to identify data cells in the original document, generate text descriptions for each data cell, and construct a computational relationship network. The computational relationship network includes nodes and edges. The nodes are used to record the original data and corresponding text descriptions of the data cells, and the edges are used to represent the computational relationships between several of the nodes. The interaction analysis module is used to determine the retrieval instruction by recognizing the intent of the natural language questions input by the user; the retrieval instruction includes semantic retrieval instructions and relational retrieval instructions. The retrieval processing module is configured to obtain semantic retrieval results in each of the text descriptions based on the semantic retrieval instructions, the semantic retrieval results including a plurality of target data cells; and to find data cells associated with the plurality of target data cells in the computational relationship network based on the relationship retrieval instructions to obtain relationship retrieval results, and to generate a final query result based on the semantic retrieval results and the relationship retrieval results.
2. The financial question-and-answer system according to claim 1, characterized in that, The knowledge base construction module is also used for: The directionality, computation operators, and weight parameters of the edges in the computational relationship network are determined, and the weight parameters are used to characterize the importance of the corresponding computational relationship.
3. The financial question-and-answer system according to claim 2, characterized in that, The process of finding data cells associated with the plurality of target data cells to obtain relationship retrieval results includes: When searching for data cells associated with the target data cells, a graph traversal algorithm based on weight parameters is used, prioritizing the traversal of edges with higher weight parameters; The nodes connected to the edges with higher weight parameters are taken as associated data cells, and the relationship retrieval results are determined based on the associated data cells.
4. The financial question-and-answer system according to claim 1, characterized in that, The knowledge base construction module is also used for: Determine the data timestamps of the nodes in the computational relationship network; For multiple nodes representing the same financial indicator, edges are constructed between the multiple nodes based on the data timestamps to represent the temporal relationship.
5. The financial question-and-answer system according to claim 4, characterized in that, The determination of the retrieval instruction includes: If the natural language question is identified to contain a comparison intent, a relation retrieval instruction is generated for retrieving data from multiple comparable periods based on the temporal relation edge. If the natural language question is found to contain trend analysis intent, a relation retrieval instruction is generated for retrieving data from multiple consecutive periods based on the time-series relation.
6. The financial question-and-answer system according to claim 1, characterized in that, The interactive analysis module is also used to generate search strategy description information after the search instruction is determined; The retrieval processing module is used to generate the final query results based on the retrieval strategy description information, semantic retrieval results, and relational retrieval results.
7. The financial question-and-answer system according to claim 6, characterized in that, The process of generating the final query results based on the retrieval strategy description information, semantic retrieval results, and relational retrieval results includes: The computational relationship represented by the edge is performed on the original data recorded by the nodes in the relation retrieval results to obtain derived data; The retrieval strategy description information, derived data, and text descriptions in the semantic retrieval results are integrated to generate the final query results.
8. The financial question-and-answer system according to claim 7, characterized in that, The retrieval processing module is also used for: When the text description in the semantic retrieval results is logically related to the derived data, the related information is established and marked in the final query results; When the text description in the semantic retrieval results contradicts the derived data numerically, the contradictory information is marked in the final query results.
9. A financial question-answering method based on the collaboration of Agent and RAG knowledge base, characterized in that, include: By recognizing the intent of the natural language questions input by the user, the retrieval instructions are determined; the retrieval instructions include semantic retrieval instructions and relational retrieval instructions. Based on the semantic retrieval instructions, semantic retrieval results are obtained from various text descriptions, and the semantic retrieval results include several target data cells; the text descriptions are pre-generated based on the data cells in the original document. Based on the relationship retrieval instruction, the data cell associated with the plurality of target data cells is searched in the computational relationship network to obtain the relationship retrieval result; the computational relationship network includes nodes and edges, the nodes are used to record the original data and corresponding text description of the data cell, and the edges are used to represent the computational relationship between the plurality of nodes; The final query results are generated based on the semantic search results and the relational search results.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method of claim 9.
Citation Information
Patent Citations
Financial intelligent question and answer method and system based on mixed retrieval and dynamic query
CN120256574A
Query method and system based on vector database and graph query, terminal and medium
CN121144300A