Metadata-based intelligent agent knowledge retrieval and filtering methods, devices, and media
By using a metadata-based intelligent agent knowledge retrieval method, user input and identity information are extracted to generate filtering conditions, the query question is rewritten, and the query statement is executed in the knowledge base. This solves the problems of long retrieval time and difficult access control in existing technologies, and achieves efficient and accurate knowledge retrieval and access management.
Patent Information
- Application Number
- CN202510948594.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-07-09
AI Technical Summary
Existing knowledge retrieval technologies are time-consuming in both vector and scalar retrieval processes, resulting in low retrieval efficiency and difficulty in achieving effective access control and knowledge content filtering.
By extracting primary metadata from user input and/or obtaining secondary metadata based on user identity information, target filtering conditions are generated, data query questions are rewritten and converted into query condition statements, and executed in the knowledge base for knowledge retrieval. Combined with the semantic understanding capabilities of large models, seamless integration of vector and scalar retrieval is achieved.
It reduces search time, improves search efficiency, implements access control and filters mismatched knowledge content, and enhances user experience and the accuracy of search results.
Smart Images

Figure CN120470112B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the fields of large models, intelligent agents, and artificial intelligence, and specifically to an intelligent agent knowledge retrieval and filtering method, apparatus, and medium based on metadata. Background Technology
[0002] Knowledge retrieval refers to the process of finding and obtaining the required knowledge from various knowledge resources. To improve the accuracy of knowledge retrieval, related technologies typically include two retrieval stages: vector retrieval and scalar retrieval.
[0003] Vector retrieval requires complex vectorization of knowledge resources and a large amount of computational comparison, while scalar retrieval involves filtering and precise matching of massive amounts of data. Both often involve large amounts of data processing and excessive consumption of computational resources during the retrieval process, resulting in a long retrieval time and thus affecting retrieval efficiency. Summary of the Invention
[0004] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] Firstly, this disclosure provides a metadata-based intelligent agent knowledge retrieval and filtering method, including:
[0006] Extract first metadata from the data query question input by the user, and / or, with the user's authorization, obtain second metadata based on the user's business identity information;
[0007] Based on the first metadata and / or the second metadata, generate target filtering conditions for knowledge retrieval filtering;
[0008] The data query problem is rewritten to obtain the target query problem, wherein the target query problem does not include the first metadata;
[0009] The target filtering conditions and the target query question are converted into query condition statements for knowledge retrieval in the knowledge base, wherein the knowledge base is used to store knowledge fragments obtained by segmenting knowledge files, and the knowledge fragments corresponding to the same knowledge file are associated with the same metadata tags for knowledge retrieval filtering;
[0010] Execute the query condition statement in the knowledge base to obtain knowledge fragments used to answer the data query question.
[0011] Secondly, this disclosure provides a metadata-based intelligent agent knowledge retrieval and filtering device, comprising:
[0012] The acquisition module is used to extract first metadata from the data query question input by the user, and / or, with the user's authorization, to acquire second metadata based on the user's business identity information;
[0013] The generation module is used to generate target filtering conditions for knowledge retrieval filtering based on the first metadata and / or the second metadata;
[0014] The rewriting module is used to rewrite the data query problem to obtain the target query problem, wherein the target query problem does not include the first metadata;
[0015] The conversion module is used to convert the target filtering conditions and the target query question into query condition statements for knowledge querying in the knowledge base, wherein the knowledge base is used to store knowledge fragments obtained by segmenting knowledge files, and the knowledge fragments corresponding to the same knowledge file are associated with the same metadata tags for knowledge retrieval filtering;
[0016] An execution module is used to execute the query condition statement in the knowledge base to obtain knowledge fragments for answering the data query question.
[0017] Thirdly, this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect.
[0018] Fourthly, this disclosure provides an electronic device, comprising:
[0019] A storage device on which computer programs are stored;
[0020] A processing device for executing the computer program in the storage device to implement the steps of the method in the first aspect.
[0021] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0022] Through the above technical solution, the query condition statement is derived from the target filtering conditions and the target query question. Therefore, the query condition statement can simultaneously cover the filtering conditions and query questions required for knowledge retrieval. Thus, when performing knowledge retrieval in the knowledge base, both vector retrieval and scalar retrieval can be performed through the query condition statement. Compared to related technologies, since there is no explicit division between vector retrieval and scalar retrieval stages, retrieval time can be reduced to a certain extent, improving retrieval efficiency, thereby reducing user waiting time and improving user experience. Furthermore, since the target filtering conditions can be generated based on secondary metadata, and this secondary metadata is obtained based on user business identity information, the retrieval scope can be limited according to the user's business identity information. On the one hand, this enables access control during the knowledge retrieval filtering process, automatically filtering out knowledge content that does not match the user's identity; on the other hand, it reduces the amount of knowledge queries, further improving retrieval efficiency.
[0023] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0024] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:
[0025] Figure 1 This is a flowchart illustrating an intelligent agent knowledge retrieval and filtering method based on metadata, according to an exemplary embodiment of this disclosure.
[0026] Figure 2 This is a schematic diagram illustrating a preset mapping relationship according to an exemplary embodiment of the present disclosure;
[0027] Figure 3 This is a schematic diagram illustrating the configuration of third-party metadata according to an exemplary embodiment of the present disclosure;
[0028] Figure 4 This is a schematic diagram illustrating the configuration of a filtering field according to an exemplary embodiment of the present disclosure;
[0029] Figure 5 This is a schematic diagram illustrating the display of a second page according to an exemplary embodiment of the present disclosure;
[0030] Figure 6 This is a schematic diagram illustrating the configuration of a metadata tag according to an exemplary embodiment of the present disclosure;
[0031] Figure 7This is a schematic diagram illustrating the matching of knowledge fragments according to an exemplary embodiment of the present disclosure;
[0032] Figure 8 This is a flowchart illustrating an intelligent agent knowledge retrieval and filtering method based on metadata, according to an exemplary embodiment of this disclosure.
[0033] Figure 9 This is a structural block diagram of an intelligent agent question-answering device that integrates different large models, according to an exemplary embodiment of the present disclosure;
[0034] Figure 10 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0035] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0036] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0037] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0038] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0039] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0040] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0041] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0042] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0043] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0044] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0045] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0046] In the field of knowledge retrieval, relevant technologies typically employ engineered approaches based on user questions, generally including the following two methods:
[0047] Preprocessing method: Scalar retrieval is performed first, followed by vector retrieval. Specifically, when a user question is received, relevant metadata information is first extracted based on specific business requirements. There are two main extraction methods: one is based on regular expression matching, and the other is implemented by calling a large language model. Subsequently, documents matching the extracted metadata information are filtered out, and then vector retrieval is performed on these documents to obtain the search results.
[0048] Post-processing method: Vector retrieval is performed first, followed by scalar retrieval. Specifically, when a user question is received, vector retrieval is performed directly to obtain preliminary search results. Then, metadata is extracted based on regular expressions or by calling a large language model, and the retrieved segmented content is filtered to obtain the final search results.
[0049] Therefore, knowledge retrieval based on either preprocessing or postprocessing methods involves two stages: vector retrieval and scalar retrieval. Vector retrieval requires complex vectorization of knowledge resources and extensive computational comparisons, while scalar retrieval involves meticulous filtering and precise matching of massive amounts of data. Both often result in large data processing volumes and excessive consumption of computational resources, leading to lengthy retrieval processes and impacting retrieval efficiency.
[0050] In view of this, this disclosure provides a method, apparatus and medium for intelligent agent knowledge retrieval and filtering based on metadata, in order to solve the above-mentioned technical problems.
[0051] The embodiments of this disclosure will be further explained below with reference to the accompanying drawings.
[0052] Figure 1 This is a flowchart illustrating an intelligent agent knowledge retrieval and filtering method based on metadata, according to an exemplary embodiment of this disclosure. (Refer to...) Figure 1 The metadata-based intelligent agent knowledge retrieval and filtering method may include the following steps:
[0053] S101: Extract first metadata from the data query question entered by the user, and / or, with user authorization, obtain second metadata based on the user's business identity information.
[0054] It should be understood that the first metadata can be keywords in the data query question, field values corresponding to preset data fields, or other things, and this disclosure does not impose any limitations on them. For example, the preset data fields can be "product name," "sales amount," or "forwarding volume," etc. Accordingly, the field value corresponding to "product name" can be a specific product name, such as product A. The field value corresponding to "sales amount" can be a specific sales amount, such as 50 million. The field value corresponding to "forwarding volume" can be a specific forwarding volume, such as 15,000.
[0055] For example, an intelligent interactive page can be displayed for users to input data query questions, and this page is associated with an intelligent agent. When a user inputs a data query question on the intelligent interactive page, the intelligent agent can extract keywords from the query question to obtain primary metadata. For instance, if a user inputs "What research on intelligent agents was conducted on X in 2024?" on the intelligent interactive page, the intelligent agent can extract keywords from this query to obtain primary metadata, which may include "X", "2024", and "intelligent agent".
[0056] The second metadata can be any metadata or specified metadata related to the user's business identity. The metadata can be the department, position, and project team, etc.
[0057] In this embodiment, obtaining the second metadata can be achieved by displaying an intelligent interactive page for users to input data query questions, wherein the intelligent interactive page is associated with an intelligent agent. When a user creates a session on the intelligent interactive page and obtains user authorization to obtain the user's login information in the intelligent agent, the intelligent agent can call an application programming interface to obtain the user's business identity information from the business system, and use any metadata or specified metadata related to the business identity as the second metadata. For example, the obtained metadata "Department A", metadata "Position F", and metadata "Project C" can be used as the second metadata.
[0058] Alternatively, it can display an intelligent interactive page for users to input data and query questions. This page is associated with an intelligent agent. When a user creates a session on the intelligent interactive page and obtains authorization to access the user's login information within the intelligent agent, the agent can call an application programming interface (API) to retrieve the user's business identity information from the business system. It then displays any or specified metadata related to this business identity on the intelligent interactive page, allowing the user to select secondary metadata for generating target filtering conditions. For example, the retrieved metadata "Department A," "Position F," and "Project C" can be displayed on the intelligent interactive page. If the user selects "Department A," then "Department A" is used as the secondary metadata.
[0059] Of course, the second metadata can also be obtained through other means, and this disclosure does not impose any restrictions on this.
[0060] Among possible methods, obtaining second metadata based on the user's business identity information, with user authorization, may include:
[0061] Display the intelligent interaction page associated with the intelligent agent; in response to the user creating a session on the intelligent interaction page, and with the user's authorization, based on the user's login information in the intelligent agent, call the application programming interface to obtain the user's business identity information from the business system, and assign the business identity information to the preset session variable in the intelligent agent; determine the second metadata according to the preset session variable and the preset mapping relationship, wherein the preset mapping relationship is used to represent the mapping relationship between the preset session variable in the intelligent agent and the metadata in the knowledge base, and the value of the second metadata is the same as the value assigned to the preset session variable.
[0062] The preset session variables can be determined according to the actual situation, and this embodiment of the disclosure does not impose any restrictions on them. For example, the preset session variables can be "department", "project" or "position", etc.
[0063] For example, when an agent detects that a user has created a session on an intelligent interaction page and has obtained user authorization to access the user's login information within the agent, if the business identity information obtained by the agent from the business system via the application programming interface is "Department A" and "Position Y", then "Department A" and "Position Y" can be assigned to the corresponding preset session variables respectively. For instance, "Department A" can be assigned to the preset session variable "Department", making the preset session variable "Department" change to "Department = A", and "Position Y" can be assigned to the preset session variable "Position", making the preset session variables "Position" "Position = Y". Then, based on the preset session variables and preset mapping relationships, the second metadata can be obtained. Specifically, in the preset mapping relationships, the preset session variable "Department" in the agent and the metadata "Department" in the knowledge base have a mapping relationship, and the preset session variable "Position" in the agent and the metadata "Position" in the knowledge base also have a mapping relationship. Therefore, the second metadata includes: "Department = A" and "Position = Y".
[0064] Using the above method, based on preset session variables and preset mapping relationships, secondary metadata related to the user's business identity information can be automatically obtained, thereby enabling convenient and efficient access control during the knowledge retrieval process.
[0065] Among the possible methods, the preset mapping relationship can be obtained in the following way:
[0066] The parameter editing page for the agent is displayed. The parameter editing page displays the third-party metadata for knowledge retrieval filtering pre-configured in the knowledge base, as well as reference configuration items. The reference configuration items are used to configure the preset session variables of the agent referenced by the third-party metadata. In response to the trigger operation of the reference configuration items, the preset session variables of the agent are displayed. In response to the selection operation in the preset session variables, the preset session variable corresponding to the selection operation is mapped to the third-party metadata.
[0067] For example, such as Figure 2 As shown, the parameter editing page displays pre-configured third-party metadata 201 for knowledge retrieval filtering and reference configuration items 202. The reference configuration item 202 includes a drop-down control 203 for displaying preset session variables of the agent. When the drop-down control 203 is triggered by clicking or other operations, the preset session variables of the agent can be displayed. When a target preset session variable is selected by clicking or other operations, a mapping relationship is established between the target preset session variable and the third-party metadata.
[0068] It should be understood that when a user enters a data query question, the query question typically does not contain the user's identity information, while the knowledge files in the knowledge base may be configured with access permissions specific to the user's identity. Therefore, to enable users to smoothly view the knowledge content they have access to and to reduce interaction interruptions caused by authentication issues, this embodiment can automatically obtain the user's business identity information with the user's authorization, and determine the second metadata used to generate the target filtering conditions based on this business identity information. In this way, when the data query question does not contain user identity information, there is no need to provide the user with clarification prompts regarding obtaining user identity information; authentication and permission matching can be completed in the background, thereby significantly improving the user's interactive experience.
[0069] S102: Based on the first metadata and / or the second metadata, generate target filtering conditions for knowledge retrieval filtering.
[0070] For example, generating target filtering conditions for knowledge retrieval based on first metadata and / or second metadata may include concatenating the first metadata and second metadata to obtain the target filtering conditions.
[0071] For example, continuing with the previous example, we can concatenate "X", "2024", "agent", and "department A" to obtain the following target filtering conditions:
[0072] "Name=X&Year=2024&Category=Agent&Department=Department A".
[0073] For example, based on the first metadata and the second metadata, generating target filtering conditions for knowledge retrieval filtering may include:
[0074] Based on the first metadata, a first filtering condition for knowledge retrieval is generated; based on the second metadata, a second filtering condition for knowledge retrieval is generated; the first and second filtering conditions are concatenated into a target filtering condition using a target logical operator, wherein the target logical operator represents that both the first and second filtering conditions are satisfied.
[0075] The target logical operator can be "AND", "&", or other operators, and this disclosure does not impose any restrictions on them.
[0076] For example, continuing with the previous example, we can first generate the first filter condition based on "X", "2024", and "agent". For example, the first filter condition could be: like('author','X '), eq('year',2024), like('keywords','agent'). Then, we can generate the second filter condition based on "department A". For example, the second filter condition could be: like('project', 'A'). Finally, we concatenate the first and second filter conditions using the target logical operator to obtain the target filter condition. For example, the target filter condition could be: (like('author','X '), eq('year',2024), like('keywords', 'agent'))&like('project', 'A').
[0077] S103: Rewrite the data query problem to obtain the target query problem, wherein the target query problem does not include the first metadata.
[0078] For example, we can first delete the first metadata in the data query question to obtain candidate query questions, and then optimize the wording of the candidate query questions to obtain the target query question. Optimizing the wording of the candidate query questions can include deleting redundant punctuation marks, redundant words, and / or modifiers.
[0079] For example, continuing with the previous example, we can first remove "X", "2024" and "intelligent agent" from the query "What research about intelligent agents was conducted in X in 2024", resulting in the candidate query "What research was conducted in X in 2024?". Then, we can optimize the wording of the candidate query to obtain the target query "What research was conducted?".
[0080] S104: Convert the target filtering conditions and target query questions into query condition statements for knowledge retrieval in the knowledge base. The knowledge base is used to store knowledge fragments obtained by segmenting knowledge files. Knowledge fragments corresponding to the same knowledge file are associated with the same metadata tags used for knowledge retrieval filtering.
[0081] It should be understood that the query condition statement can be an SQL (Structured Query Language) statement, a MongoDB query statement, or a Redis query statement, or of course, other statements. This disclosure does not impose any restrictions on this.
[0082] S105: Execute the query condition statement in the knowledge base to obtain knowledge fragments used to answer data query questions.
[0083] The above technical solution allows for the generation of target filtering conditions for knowledge retrieval based on first metadata and / or second metadata. It also enables the rewriting of data query questions to obtain target query questions excluding the first metadata, and the conversion of target filtering conditions and target query questions into query condition statements for knowledge retrieval in the knowledge base. Executing these query condition statements in the knowledge base yields knowledge fragments to answer the questions. Since the query condition statements are derived from the target filtering conditions and target query questions, they can simultaneously cover the filtering conditions and query questions required for knowledge retrieval. Therefore, when performing knowledge retrieval in the knowledge base, both vector and scalar retrieval can be performed using these query condition statements. Compared to related technologies, the absence of explicit division between vector and scalar retrieval stages reduces retrieval time and improves efficiency, thereby reducing user waiting time and enhancing user experience. Furthermore, since the target filtering conditions can be generated based on second metadata, which is derived from user business identity information, the retrieval scope can be limited according to the user's business identity. This allows for access control during the knowledge retrieval filtering process, automatically filtering out knowledge content that does not match the user's identity, and reduces the amount of knowledge retrieval, further improving retrieval efficiency.
[0084] Furthermore, it should be understood that when using post-processing methods for knowledge retrieval, related technologies typically involve users setting a retrieval quantity threshold k during the vector retrieval stage, returning the top k retrieval data, and then performing further filtering and selection based on the returned data, resulting in a limited final number of returned retrieval data. However, in this embodiment, since there is no explicit distinction between vector retrieval and scalar retrieval stages, the number of returned retrieval data can be increased to a certain extent, better meeting the user's knowledge retrieval needs.
[0085] To facilitate understanding of the metadata-based intelligent agent knowledge retrieval and filtering method provided in this disclosure, the possible implementation methods in this disclosure are described below.
[0086] Among possible approaches, metadata-based agent knowledge retrieval and filtering methods may also include:
[0087] Display the first metadata configuration page for the knowledge base; in response to the configuration operation on the first metadata configuration page, determine the third metadata for knowledge retrieval filtering corresponding to the knowledge base based on the configuration operation;
[0088] Accordingly, extracting first metadata from the user-input data query question, and / or, with user authorization, obtaining second metadata based on the user's business identity information, may include:
[0089] Based on the third metadata, extract the first metadata from the data query question entered by the user, and / or, with user authorization, obtain the second metadata based on the third metadata and the user's business identity information.
[0090] It should be understood that metadata generally includes a metadata name, a metadata type, and a metadata description. The metadata type defines the data format of the metadata, such as string, integer, number, and boolean. The metadata description explains the meaning and purpose of this metadata. Therefore, the configuration operations on the first metadata configuration page can at least include configuration operations for the metadata name, metadata type, and metadata description.
[0091] For example, such as Figure 3 As shown, the first metadata configuration page can display configuration item 301 for configuring third metadata and a new control 302 for adding configuration item 301. Configuration item 301 is used to configure at least the metadata name, metadata type, and metadata description of a single metadata element. Therefore, in response to a configuration operation on configuration item 301 on the first metadata configuration page, a third metadata element for knowledge retrieval filtering can be obtained. In response to a trigger operation on the new control 302, a new configuration item 301 for configuring the third metadata element can be obtained.
[0092] For example, continuing with the previous example, if the user inputs a data query question about intelligent agents: "What research did X conduct on intelligent agents in 2024?", and the metadata related to the user's business identity includes "Department A" and "Position Y", while the third metadata includes "Name", "Department", and "Year", then based on the third metadata, the first metadata extracted from the user's input data query question can include "Name = X" and "Year = 2024". With user authorization, based on the third metadata and the user's business identity information, the second metadata can include "Department = A".
[0093] It should be understood that when related technologies employ preprocessing methods for knowledge retrieval, the methods for extracting metadata are typically customized based on specific business needs. Since regular expressions and model training data are closely related to specific business requirements, when these needs change, the original extraction rules may no longer be applicable, requiring redesign and adjustment. This makes metadata extraction methods difficult to reuse, resulting in poor scalability and difficulty in adapting to diverse business scenarios and needs. However, in this embodiment, because the metadata used for knowledge retrieval filtering in the knowledge base can be configured, when business needs change, the metadata configuration of the knowledge base can be adjusted to quickly match business requirements without redesigning and adjusting the entire extraction model or regular expressions. This overcomes the problems of poor reusability and scalability inherent in traditional methods, enabling the metadata-based intelligent agent knowledge retrieval filtering method of this disclosure to better meet constantly changing business requirements.
[0094] Furthermore, it should be understood that when the data query problem is complex, the first metadata extracted from the data query problem based on the third metadata may include multiple components, and / or, the second metadata obtained based on the third metadata and the user's business identity information may include multiple components. However, since different first metadata and / or different second metadata have varying degrees of importance in the knowledge retrieval filtering process, in order to both accurately perform knowledge retrieval filtering and simplify the complexity of the target filtering conditions, one possible approach is to configure the filtering fields of the metadata used for knowledge retrieval in the knowledge base when configuring the metadata. These filtering fields can be used to characterize whether the corresponding metadata participates in generating the target filtering conditions. Therefore, after obtaining the first metadata and / or second metadata, the target metadata used to generate the target filtering conditions for knowledge retrieval can be determined based on the filtering fields corresponding to the first metadata and / or second metadata, and the target filtering conditions can be generated based on the target metadata. This simplifies the complexity of constructing target filtering conditions based on the first metadata and / or second metadata, thereby simplifying the complexity of the query condition statements constructed based on the target filtering conditions and improving the efficiency and accuracy of knowledge retrieval based on query condition statements.
[0095] In other words, in possible ways, the third metadata may include a filter field, which is used to characterize whether the corresponding metadata participates in generating the target filter conditions. Accordingly, based on the first metadata and / or the second metadata, the target filter conditions for knowledge retrieval filtering can be generated, which may include:
[0096] Target metadata is determined in the first metadata and / or the second metadata, wherein the filter field of the target metadata indicates that the target metadata participates in the generation of target filter conditions; based on the target metadata, target filter conditions for knowledge retrieval filtering are generated.
[0097] The filter fields corresponding to the metadata can be configured when configuring metadata on the first metadata configuration page. For example, refer to... Figure 4 As shown, the first metadata configuration page can display configuration item 401 for configuring third metadata and a new control 402 for adding configuration item 401. Configuration item 401 is used to configure at least the metadata name, metadata type, metadata description, and filter fields of a single metadata element. Therefore, in response to a configuration operation on configuration item 401 on the first metadata configuration page, a third metadata element including filter fields and used for knowledge retrieval filtering can be obtained. In response to a trigger operation on the new control 402, a new configuration item 401 for configuring the third metadata element can be obtained.
[0098] For example, continuing with the previous example, if the filter fields corresponding to "Name" and "Department" in the third metadata indicate that "Name" and "Department" participate in generating the target filter conditions, and the filter field corresponding to "Year" indicates that "Year" does not participate in generating the target filter conditions, then "Name=X" in the first metadata and "Department=A" in the second metadata can be used as the target metadata. Then, based on the target metadata, target filter conditions for knowledge retrieval can be generated. For example, the following target filter conditions can be generated:
[0099] "Name=X&Department=DepartmentA".
[0100] It should be understood that intelligent agents can typically be associated with one or more large models, and these large models generally possess powerful semantic understanding and data processing capabilities. Therefore, to improve the accuracy of knowledge fragments and further enhance the efficiency of knowledge retrieval while reducing user waiting time, primary metadata can be extracted from the data query question through the large models associated with the intelligent agent, and the data query question can be rewritten to obtain the target query question. That is to say, among possible methods, extracting primary metadata from the user-input data query question can include:
[0101] The first major model is invoked to extract primary metadata from the user's input data query question;
[0102] Accordingly, the data query problem is rewritten to obtain the target query problem, which may include:
[0103] The second major model is used to rewrite the data query problem to obtain the target query problem. The second major model may be the same as or different from the first major model.
[0104] For example, when the second major model is the same as the first major model, a first prompt word template can be pre-set. After obtaining the data query question, the data query question can be filled into the corresponding position of the first prompt word template to obtain the first prompt word. The first prompt word is then input into the first major model so that the first major model can obtain the first metadata and the target query question based on the first prompt word.
[0105] When the second major model differs from the first major model, a second and a third suggestion term template can be pre-set. After obtaining the data query question, the query question can be filled into the corresponding positions of the second suggestion term template to obtain the second suggestion term. This second suggestion term is then input into the first major model to obtain the first metadata based on the second suggestion term. Subsequently, the first metadata and the data query question can be filled into the corresponding positions of the third suggestion term template to obtain the third suggestion term. This third suggestion term is then input into the second major model to obtain the target query question based on the third suggestion term.
[0106] It should be understood that the first prompt word template, the second prompt word template, and the third prompt word template can be determined according to the actual situation, and this disclosure does not impose any restrictions on them.
[0107] In one possible way, the metadata tags associated with knowledge fragments are obtained as follows:
[0108] Display the first metadata configuration page for the knowledge base; in response to configuration operations on the first metadata configuration page, determine the third metadata for knowledge retrieval filtering corresponding to the knowledge base based on the configuration operations; display the second metadata configuration page for knowledge files in the knowledge base; in response to metadata editing operations on the knowledge files on the second metadata configuration page, display the third metadata, and in response to value configuration operations on the third metadata, determine the metadata tags associated with the knowledge files for knowledge retrieval filtering based on the value configuration operations; add metadata tags to all knowledge fragments corresponding to the knowledge files.
[0109] For example, a first page for knowledge retrieval can display multiple knowledge bases storing different knowledge fragments. When a user triggers a target knowledge base from these multiple knowledge bases through actions such as clicking, a second page can be displayed. This second page can at least display a first editing control 501 for editing the knowledge base and an upload control 502 for uploading knowledge files. Figure 5 As shown. When the first editing control 501 is triggered by an action such as clicking, it can display as follows. Figure 3 Or such as Figure 4The first metadata configuration page, as shown, allows for the configuration of third metadata based on the aforementioned configuration methods. For example, the third metadata configured for the target knowledge base may include "project" and "department". After configuring the third metadata for the target knowledge base, an upload control 502 can be triggered by clicking or other operations, displaying an upload page for uploading knowledge files. After uploading the target knowledge file through the upload page, the second metadata configuration page can be displayed. Alternatively, the second page may also display the knowledge files contained in the target knowledge base, with the knowledge files associated with a second editing control 503. When the second editing control 503 is triggered by clicking or other operations, the second metadata configuration page can be displayed.
[0110] The second metadata configuration page can display the third metadata corresponding to the target knowledge base. In response to the configuration operation for the third metadata value, metadata tags associated with the target knowledge file for knowledge retrieval filtering are obtained. For example, continuing with the previous example, the second metadata configuration page can display the third metadata "Project" and the third metadata "Department". After configuring "Project A" for the third metadata "Project" and "Department A" for the third metadata "Department", "Project A" and "Department A" can be used as metadata tags associated with the target knowledge file for knowledge retrieval filtering. The metadata tags "Project A" and "Department A" will be added to all knowledge fragments corresponding to the target knowledge file, such as... Figure 6 As shown.
[0111] It's worth noting that the tag value configured for the third-party metadata can be a specific value, such as "Department A" or "Project A"; it can also be a wildcard, or it can be left empty, leaving the tag value empty. When the tag value is set to a wildcard, it means that the data value for that third-party metadata in the target filter condition will match regardless of its value; when the tag value is empty, it means that the knowledge fragment does not contain that third-party metadata, and it can match when the target filter condition does not contain that third-party metadata. Figure 7 As shown.
[0112] In some possible approaches, the third metadata may include access control metadata for performing access control, which characterizes access control to knowledge files in the knowledge base. Accordingly, in response to a value configuration operation on the third metadata, metadata tags associated with the knowledge files for knowledge retrieval filtering are determined based on the value configuration operation, and may include:
[0113] During the process of importing knowledge files into the knowledge base, in response to the value configuration operation of the permission metadata, the permission metadata tag associated with the knowledge file for permission control is determined based on the value configuration operation;
[0114] Accordingly, metadata tags are added to all knowledge fragments corresponding to the knowledge file, which may include:
[0115] Add permission metadata tags to all knowledge fragments corresponding to the knowledge file.
[0116] It should be understood that the permission metadata can be determined according to the actual situation, and this disclosure embodiment does not impose any restrictions on it. For example, the permission metadata can be "department", "project" and "position", etc.
[0117] It is worth noting that the configuration of permission metadata values can be done in the same way as the configuration of third metadata values on the second metadata configuration page, and will not be repeated here.
[0118] The above methods allow for the configuration of access permissions for knowledge files in the knowledge base. This enables subsequent knowledge retrieval to be limited to the scope of the search based on the user's business identity information, ensuring that the user can only retrieve authorized knowledge resources that match their business identity. This achieves access control during the knowledge retrieval filtering process and effectively guarantees the security and compliance of knowledge resources.
[0119] To facilitate a further understanding of the metadata-based intelligent agent knowledge retrieval and filtering method provided in this disclosure, the possible implementations of this disclosure are described below in conjunction with the accompanying drawings:
[0120] For example, such as Figure 8As shown, the metadata-based intelligent agent knowledge retrieval filtering method in this embodiment can include an indexing stage and a recall stage. The indexing stage configures the third metadata corresponding to the knowledge base for knowledge retrieval filtering, as well as the metadata tags associated with knowledge fragments in the knowledge base, and converts them into vectors for storage after configuration. The recall stage performs a series of processes based on the user-inputted data query question to obtain knowledge fragments for answering the data query question. Specifically, after the user inputs a data query question to the intelligent agent through the intelligent interaction page, on the one hand, the first metadata in the data query question can be extracted based on the third metadata through the first major model associated with the intelligent agent; on the other hand, with user authorization, the user's login information in the intelligent agent can be obtained, and the user's business identity information can be obtained from the business system by calling the application programming interface, and second metadata can be obtained based on the business identity information. Then, based on the filtering fields in the third metadata, target metadata can be filtered from the first and second metadata, and target filtering conditions can be generated based on the target metadata. Next, the data query question can be rewritten to obtain the target query question. Based on the target query question and target filtering conditions, it can be converted into a query condition statement for knowledge query in the knowledge base. Finally, the query condition statement can be executed in the knowledge base to obtain knowledge fragments to answer the data query question. The knowledge fragments and the data query question can be input into the large language model associated with the agent. After the large language model organizes and summarizes the knowledge fragments, it outputs the answer to the data query question.
[0121] Based on the same concept, embodiments of this disclosure also provide a metadata-based intelligent agent knowledge retrieval and filtering device, such as... Figure 9 As shown, the metadata-based intelligent agent knowledge retrieval and filtering device 900 may include:
[0122] The acquisition module 901 is used to extract first metadata from the data query question input by the user, and / or, with user authorization, to obtain second metadata based on the user's business identity information;
[0123] The generation module 902 is used to generate target filtering conditions for knowledge retrieval filtering based on the first metadata and / or the second metadata.
[0124] The rewriting module 903 is used to rewrite the data query problem to obtain the target query problem, wherein the target query problem does not include the first metadata.
[0125] The conversion module 904 is used to convert the target filtering conditions and target query questions into query condition statements for knowledge retrieval in the knowledge base. The knowledge base is used to store knowledge fragments obtained by segmenting knowledge files. Knowledge fragments corresponding to the same knowledge file are associated with the same metadata tags for knowledge retrieval filtering.
[0126] Execution module 905 is used to execute query condition statements in the knowledge base to obtain knowledge fragments used to answer data query questions.
[0127] The aforementioned metadata-based intelligent agent knowledge retrieval filtering device 900 can generate target filtering conditions for knowledge retrieval based on first metadata and / or second metadata. It can also rewrite the data query question to obtain a target query question excluding the first metadata, and convert the target filtering conditions and target query question into query condition statements for knowledge retrieval in the knowledge base. By executing these query condition statements in the knowledge base, knowledge fragments for answering the question are obtained. Since the query condition statements are derived from the target filtering conditions and target query question, they can simultaneously cover the filtering conditions and query question required for knowledge retrieval. Therefore, when performing knowledge retrieval in the knowledge base, both vector retrieval and scalar retrieval can be performed using the query condition statements. Compared to related technologies, since there is no explicit division between vector retrieval and scalar retrieval stages, retrieval time can be reduced to a certain extent, retrieval efficiency can be improved, thereby reducing user waiting time and enhancing user experience. In addition, since the target filtering conditions can be generated based on the second metadata, and the second metadata is obtained based on the user's business identity information, the search scope can be limited according to the user's business identity information. On the one hand, it can realize the access control in the knowledge retrieval filtering process and automatically filter out knowledge content that does not match the user's identity. On the other hand, it can reduce the amount of knowledge query and further improve the retrieval efficiency.
[0128] In some possible embodiments, the metadata-based intelligent agent knowledge retrieval filtering device 900 may also include:
[0129] The display module is used to display the first metadata configuration page for the knowledge base;
[0130] The determination module is used to respond to the configuration operation on the first metadata configuration page and determine the third metadata corresponding to the knowledge base for knowledge retrieval filtering based on the configuration operation;
[0131] Accordingly, the acquisition module 901 can be used to extract first metadata from the data query question input by the user based on third metadata, and / or, with user authorization, to acquire second metadata based on the third metadata and the user's business identity information.
[0132] In one possible approach, the third metadata may include a filter field, which is used to characterize whether the corresponding metadata participates in generating the target filter conditions. Accordingly, the generation module 902 may include:
[0133] The first determining unit is used to determine the target metadata in the first metadata and / or the second metadata, wherein the filter field of the target metadata represents the target metadata participating in the generation of target filter conditions;
[0134] The first generation unit is used to generate target filtering conditions for knowledge retrieval filtering based on target metadata.
[0135] In some possible ways, the acquisition module 901 may include:
[0136] The display unit is used to display the intelligent interactive page associated with the intelligent agent;
[0137] The acquisition unit is used to respond to the user creating a session on the intelligent interaction page. With the user's authorization, based on the user's login information in the intelligent agent, it calls the application programming interface to obtain the user's business identity information from the business system and assigns the business identity information to the preset session variable in the intelligent agent.
[0138] The second determining unit is used to determine the second metadata based on the preset session variables and the preset mapping relationship. The preset mapping relationship is used to characterize the mapping relationship between the preset session variables in the agent and the metadata in the knowledge base. The value of the second metadata is the same as the value assigned to the preset session variables.
[0139] In some possible embodiments, the metadata-based intelligent agent knowledge retrieval filtering device 900 may also include:
[0140] The first configuration module is used to obtain the preset mapping relationship in the following way:
[0141] The parameter editing page for the agent is displayed. The parameter editing page displays the third-party metadata for knowledge retrieval filtering pre-configured in the knowledge base, as well as the reference configuration items. The reference configuration items are used to configure the preset session variables of the agent referenced by the third-party metadata.
[0142] In response to a triggered action on a referenced configuration item, display the agent's preset session variables;
[0143] In response to a selection operation in a preset session variable, a mapping relationship is established between the preset session variable corresponding to the selection operation and the third-party metadata.
[0144] In one possible way, module 901 can be used to call the first major model to extract first metadata from the user-input data query question;
[0145] Correspondingly, the rewriting module 903 can be used to call the second major model to rewrite the data query problem and obtain the target query problem, wherein the second major model is the same as or different from the first major model.
[0146] In some possible ways, generation module 902 may include:
[0147] The second generation unit is used to generate first filtering conditions for knowledge retrieval filtering based on the first metadata.
[0148] The third generation unit is used to generate second filtering conditions for knowledge retrieval filtering based on the second metadata;
[0149] The concatenation unit is used to concatenate the first filter condition and the second filter condition into a target filter condition by means of a target logical operator, wherein the target logical operator represents that the first filter condition and the second filter condition are satisfied simultaneously.
[0150] In some possible embodiments, the metadata-based intelligent agent knowledge retrieval filtering device 900 may also include:
[0151] The second configuration module is used to obtain the metadata tags associated with knowledge fragments in the following way:
[0152] Displays the first metadata configuration page for the knowledge base;
[0153] In response to the configuration operation on the first metadata configuration page, the third metadata corresponding to the knowledge base for knowledge retrieval filtering is determined according to the configuration operation;
[0154] Displays the second metadata configuration page for knowledge files in the knowledge base;
[0155] In response to the metadata editing operation of the knowledge file in the second metadata configuration page, the third metadata is displayed, and in response to the value configuration operation of the third metadata, the metadata tags associated with the knowledge file for knowledge retrieval filtering are determined according to the value configuration operation;
[0156] Add metadata tags to all knowledge fragments corresponding to the knowledge file.
[0157] In one possible manner, the third metadata may include permission metadata for access control, which represents access control to knowledge files in the knowledge base. Accordingly, the second configuration module may also be used, in response to a value configuration operation on the permission metadata during the import of knowledge files into the knowledge base, to determine the permission metadata tag associated with the knowledge file for access control based on the value configuration operation, and to add permission metadata tags to all knowledge fragments corresponding to the knowledge file.
[0158] Based on the same concept, embodiments of this disclosure also provide a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of any of the above-described metadata-based intelligent agent knowledge retrieval and filtering methods.
[0159] Based on the same concept, this disclosure also provides an electronic device that may include:
[0160] A storage device on which computer programs are stored;
[0161] A processing device for executing a computer program stored in a storage device to implement the steps of any of the above-described metadata-based agent knowledge retrieval and filtering methods.
[0162] Based on the same concept, embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described metadata-based intelligent agent knowledge retrieval and filtering methods.
[0163] The following is for reference. Figure 10 The diagram illustrates a structural schematic of an electronic device 1000 suitable for implementing embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 10 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0164] like Figure 10 As shown, the electronic device 1000 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. The RAM 1003 also stores various programs and data required for the operation of the electronic device 1000. The processing unit 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0165] Typically, the following devices can be connected to the I / O interface 1005: input devices 1006 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 1007 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1008 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows electronic device 1000 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 10An electronic device 1000 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0166] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 1009, or installed from storage device 1008, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of embodiments of this disclosure.
[0167] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0168] In some implementations, communication can be conducted using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol), and can be interconnected with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0169] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0170] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: extract first metadata from a user-input data query question, and / or, with user authorization, obtain second metadata based on the user's business identity information; generate target filtering conditions for knowledge retrieval based on the first metadata and / or the second metadata; rewrite the data query question to obtain a target query question, wherein the target query question does not include the first metadata; convert the target filtering conditions and the target query question into query condition statements for knowledge retrieval in a knowledge base, wherein the knowledge base stores knowledge fragments obtained by segmenting knowledge files, and knowledge fragments corresponding to the same knowledge file are associated with the same metadata tags for knowledge retrieval filtering; and execute the query condition statements in the knowledge base to obtain knowledge fragments for answering the question.
[0171] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0172] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0173] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules are not, in some cases, intended to limit the functionality of the module itself.
[0174] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0175] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0176] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0177] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0178] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.
Claims
1. A metadata-based intelligent agent knowledge retrieval and filtering method, characterized in that, include: Displays the first metadata configuration page for the knowledge base; In response to the configuration operation in the first metadata configuration page, the third metadata for knowledge retrieval filtering corresponding to the knowledge base is determined according to the configuration operation; Based on the third metadata, first metadata is extracted from the data query question input by the user, and / or, with user authorization, second metadata is obtained based on the third metadata and the user's business identity information; Based on the first metadata and / or the second metadata, generate target filtering conditions for knowledge retrieval filtering; The data query problem is rewritten to obtain the target query problem, wherein the target query problem does not include the first metadata; The target filtering conditions and the target query question are converted into query condition statements for knowledge retrieval in the knowledge base, wherein the knowledge base is used to store knowledge fragments obtained by segmenting knowledge files, and the knowledge fragments corresponding to the same knowledge file are associated with the same metadata tags for knowledge retrieval filtering; Execute the query condition statement in the knowledge base to obtain knowledge fragments used to answer the data query question.
2. The metadata-based intelligent agent knowledge retrieval and filtering method according to claim 1, characterized in that, The third metadata includes a filter field, which is used to characterize whether the corresponding metadata participates in generating the target filter condition. Generating the target filter condition for knowledge retrieval filtering based on the first metadata and / or the second metadata includes: Target metadata is determined from the first metadata and / or the second metadata, wherein the filter field of the target metadata indicates that the target metadata participates in generating the target filter condition; Based on the target metadata, target filtering conditions are generated for knowledge retrieval filtering.
3. The metadata-based intelligent agent knowledge retrieval and filtering method according to claim 1, characterized in that, The step of obtaining second metadata based on the user's business identity information when the user authorizes the process includes: Displays the intelligent interaction page associated with the intelligent agent; In response to the user creating a session on the intelligent interaction page, with the user's authorization, based on the user's login information in the intelligent agent, the application programming interface is called to obtain the user's business identity information from the business system, and the business identity information is assigned to a preset session variable in the intelligent agent; Based on the preset session variables and the preset mapping relationship, the second metadata is determined, wherein the preset mapping relationship is used to characterize the mapping relationship between the preset session variables in the agent and the metadata in the knowledge base, and the value of the second metadata is the same as the value assigned to the preset session variables.
4. The metadata-based intelligent agent knowledge retrieval and filtering method according to claim 3, characterized in that, The preset mapping relationship is obtained in the following way: The parameter editing page for the agent is displayed, wherein the parameter editing page displays third-party metadata for knowledge retrieval filtering pre-configured for the knowledge base and reference configuration items, and the reference configuration items are used to configure the preset session variables of the agent referenced by the third-party metadata; In response to a trigger operation on the referenced configuration item, the agent's preset session variables are displayed; In response to a selection operation in the preset session variable, a mapping relationship is established between the preset session variable corresponding to the selection operation and the third metadata.
5. The metadata-based intelligent agent knowledge retrieval and filtering method according to any one of claims 1-4, characterized in that, The extraction of first metadata from the user-input data query question includes: The first major model is invoked to extract primary metadata from the user's input data query question; The process of rewriting the data query problem to obtain the target query problem includes: The data query problem is rewritten by calling the second major model to obtain the target query problem, wherein the second major model is the same as or different from the first major model.
6. The metadata-based intelligent agent knowledge retrieval and filtering method according to any one of claims 1-4, characterized in that, The step of generating target filtering conditions for knowledge retrieval based on the first metadata and the second metadata includes: Based on the first metadata, generate the first filtering conditions for knowledge retrieval filtering; Based on the second metadata, a second filtering condition for knowledge retrieval filtering is generated; The first filtering condition and the second filtering condition are concatenated into a target filtering condition by a target logical operator, wherein the target logical operator represents that both the first filtering condition and the second filtering condition are satisfied simultaneously.
7. The metadata-based intelligent agent knowledge retrieval and filtering method according to any one of claims 1-4, characterized in that, The metadata tags associated with the knowledge fragments are obtained in the following way: Displays the first metadata configuration page for the knowledge base; In response to the configuration operation in the first metadata configuration page, the third metadata for knowledge retrieval filtering corresponding to the knowledge base is determined according to the configuration operation; Displays the second metadata configuration page for the knowledge files in the knowledge base; In response to the metadata editing operation of the knowledge file in the second metadata configuration page, the third metadata is displayed, and in response to the value configuration operation of the third metadata, the metadata tags associated with the knowledge file for knowledge retrieval filtering are determined according to the value configuration operation; Add the metadata tags to all knowledge fragments corresponding to the knowledge file.
8. The metadata-based intelligent agent knowledge retrieval and filtering method according to claim 7, characterized in that, The third metadata includes permission metadata for access control, which characterizes access control to knowledge files in the knowledge base. In response to a value configuration operation on the third metadata, determining metadata tags associated with the knowledge files for knowledge retrieval filtering based on the value configuration operation includes: During the process of importing the knowledge file into the knowledge base, in response to the value configuration operation of the permission metadata, the permission metadata tag associated with the knowledge file for permission control is determined according to the value configuration operation; Adding the metadata tags to all knowledge fragments corresponding to the knowledge file includes: Add the permission metadata tags to all knowledge fragments corresponding to the knowledge file.
9. A metadata-based intelligent agent knowledge retrieval and filtering device, characterized in that, include: The display module is used to display the first metadata configuration page for the knowledge base; The determination module is used to respond to the configuration operation on the first metadata configuration page and determine the third metadata corresponding to the knowledge base for knowledge retrieval filtering based on the configuration operation; The acquisition module is used to extract first metadata from the data query question input by the user based on third metadata, and / or, with user authorization, to acquire second metadata based on the third metadata and the user's business identity information; The generation module is used to generate target filtering conditions for knowledge retrieval filtering based on the first metadata and / or the second metadata; The rewriting module is used to rewrite the data query problem to obtain the target query problem, wherein the target query problem does not include the first metadata; The conversion module is used to convert the target filtering conditions and the target query question into query condition statements for knowledge querying in the knowledge base, wherein the knowledge base is used to store knowledge fragments obtained by segmenting knowledge files, and the knowledge fragments corresponding to the same knowledge file are associated with the same metadata tags for knowledge retrieval filtering; An execution module is used to execute the query condition statement in the knowledge base to obtain knowledge fragments for answering the data query question.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When executed by a processing device, the computer program performs the steps of the method according to any one of claims 1-8.
11. An electronic device, characterized in that, include: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1-8.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-8.
Citation Information
Patent Citations
SQL statement parsing-based data permission control method and apparatus
CN106250782A
Permission filtering method and device and storage medium
CN112084167A