Metadata-based agent knowledge retrieval filtering method and device and medium
By extracting the metadata input by the user and generating target filtering conditions, and executing query condition statements in the knowledge base combined with the rewritten query problem, the problems of search time and permission control in the existing technology are solved, and efficient and safe knowledge retrieval is achieved.
Patent Information
- Application Number
- CN202510948594.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-07-09
AI Technical Summary
The existing knowledge retrieval technology takes a long time in the process of vector retrieval and scalar retrieval, resulting in inefficient search and difficult to achieve effective permission control.
By extracting the first metadata input by the user and/or obtaining the second metadata based on the user's identity information, a target filtering condition is generated, and the rewritten query problem is converted into query condition statements and executed in the knowledge base, the merger of vector and scalar retrieval is realized, and the explicit phase division is reduced.
It improves the efficiency of knowledge retrieval, reduces user waiting time, and realizes permission control based on user identity to ensure the accuracy and security of search results.
Smart Images

Figure CN120470112A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of large models, intelligent agents and artificial intelligence, and in particular to a metadata-based intelligent agent knowledge retrieval and filtering method, device and medium. Background Art
[0002] Knowledge retrieval refers to the process of finding and acquiring 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 processing of knowledge resources and a large amount of computational comparison. Scalar retrieval involves the one-by-one screening and precise matching of massive data. Both often involve huge amounts of data processing and excessive consumption of computing resources during the retrieval process, resulting in a long retrieval process and affecting retrieval efficiency. Summary of the Invention
[0004] This summary is provided to briefly introduce concepts that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] In a first aspect, the present disclosure provides a metadata-based agent knowledge retrieval and filtering method, comprising: Extracting first metadata from a data query question input by a user, and / or, with user authorization, obtaining second metadata based on the user's business identity information; generating target filtering conditions for knowledge retrieval filtering based on the first metadata and / or the second metadata; Rewriting the data query question to obtain a target query question, wherein the target query question does not include the first metadata; Converting the target filtering condition and the target query question into a query condition statement for performing knowledge query in a knowledge base, wherein the knowledge base is used to store knowledge fragments obtained by segmenting knowledge files, and knowledge fragments corresponding to the same knowledge file are associated with the same metadata tag for knowledge retrieval and filtering; The query condition statement is executed in the knowledge base to obtain knowledge fragments for answering the data query question.
[0006] In a second aspect, the present disclosure provides a metadata-based agent knowledge retrieval and filtering device, comprising: an acquisition module, configured to extract first metadata from a data query question input by a user, and / or, with user authorization, acquire second metadata based on the user's business identity information; A generating module, configured to generate a target filtering condition for knowledge retrieval filtering based on the first metadata and / or the second metadata; a rewriting module, configured to rewrite the data query question to obtain a target query question, wherein the target query question does not include the first metadata; a conversion module for converting the target filtering condition and the target query question into a query condition statement for performing knowledge query in a knowledge base, wherein the knowledge base is used to store knowledge fragments obtained by segmenting knowledge files, and knowledge fragments corresponding to the same knowledge file are associated with the same metadata tag for knowledge retrieval and 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.
[0007] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which implements the steps of the method described in the first aspect when executed by a processing device.
[0008] In a fourth aspect, the present disclosure provides an electronic device, comprising: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the method in the first aspect.
[0009] In a fifth aspect, the present disclosure provides a computer program product, comprising a computer program, which implements the steps of the method described in the first aspect when executed by a processor.
[0010] Through the above technical solution, the query condition statement is obtained based on the conversion of the target filtering condition and the target query question, so that the query condition statement can simultaneously cover the filtering condition and query question required for knowledge retrieval, and then when performing knowledge retrieval in the knowledge base, vector retrieval and scalar retrieval can be performed through the query condition statement. Compared with the related art, since there is no explicit division between the stages of vector retrieval and scalar retrieval, the retrieval time can be reduced to a certain extent, the retrieval efficiency can be improved, thereby reducing the user waiting time and improving the user experience. In addition, since the target filtering condition can be generated based on the second metadata, and the second metadata is obtained based on the user's business identity information, the retrieval scope can be limited according to the user's business identity information. On the one hand, it can realize the authority control in the knowledge retrieval filtering process and automatically filter out the knowledge content that does not match the user identity. On the other hand, it can reduce the amount of knowledge queries and further improve the retrieval efficiency.
[0011] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The above and other features, advantages and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 is a flowchart illustrating a metadata-based agent knowledge retrieval and filtering method according to an exemplary embodiment of the present disclosure; Figure 2 is a schematic diagram showing a configuration of a preset mapping relationship according to an exemplary embodiment of the present disclosure; Figure 3 is a schematic diagram showing a configuration of third metadata according to an exemplary embodiment of the present disclosure; Figure 4 is a schematic diagram showing a configuration of a filter field according to an exemplary embodiment of the present disclosure; Figure 5 is a schematic diagram showing a display of a second page according to an exemplary embodiment of the present disclosure; Figure 6 is a schematic diagram showing a configuration of a metadata tag according to an exemplary embodiment of the present disclosure; Figure 7 is a schematic diagram illustrating matching of knowledge fragments according to an exemplary embodiment of the present disclosure; Figure 8 is a flowchart illustrating a metadata-based agent knowledge retrieval and filtering method according to an exemplary embodiment of the present disclosure; Figure 9 1 is a structural block diagram of an intelligent agent question-answering device integrating different large models according to an exemplary embodiment of the present disclosure; Figure 10 The figure is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0013] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0014] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0015] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0016] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0017] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0018] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0019] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0020] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested 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 electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0021] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0022] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0023] At the same time, 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 relevant provisions.
[0024] In the field of knowledge retrieval, related technologies usually use engineering processing methods to perform knowledge retrieval based on user questions. Generally, there are two processing methods: Preprocessing: Scalar search is performed first, followed by vector search. Specifically, when receiving a user question, relevant metadata is first extracted based on specific business requirements. This extraction is primarily accomplished through two methods: regular expression matching and large-scale language modeling. Subsequently, matching documents are filtered based on the extracted metadata, and vector search is then performed on these documents to generate search results.
[0025] Post-processing: Vector search is performed first, followed by scalar search. Specifically, when a user question is received, a vector search is performed directly to obtain preliminary search results. Metadata is then extracted based on regular expressions or by invoking a large language model. The retrieved segmented content is then filtered to obtain search results.
[0026] This shows that knowledge retrieval, whether based on pre-processing or post-processing, involves two stages: vector retrieval and scalar retrieval. Vector retrieval requires complex vectorization of knowledge resources and extensive computational comparisons, while scalar retrieval involves the individual screening and precise matching of massive amounts of data. Both often involve significant data processing and excessive consumption of computing resources, resulting in a lengthy retrieval process and thus impacting efficiency.
[0027] In view of this, the present disclosure provides a metadata-based intelligent agent knowledge retrieval and filtering method, device and medium to solve the above technical problems.
[0028] The following further explains the embodiments of the present disclosure with reference to the accompanying drawings.
[0029] Figure 1 This is a flowchart of a method for retrieving and filtering intelligent knowledge based on metadata according to an exemplary embodiment of the present disclosure, with reference to Figure 1 The metadata-based agent knowledge retrieval and filtering method may include the following steps: S101: extracting first metadata from a data query question input by a user, and / or, with user authorization, obtaining second metadata based on the user's business identity information.
[0030] It should be understood that the first metadata can be a keyword in the data query question, or it can be a field value corresponding to a preset data field, and of course it can be other, and the embodiments of the present disclosure do not impose any restrictions on this. For example, the preset data field can be "product name", "sales" or "forward volume", etc. Correspondingly, the field value corresponding to "product name" can be a specific product name, such as product A, etc. The field value corresponding to "sales" can be a specific sales amount, such as 50 million, etc. The field value corresponding to "forward volume" can be a specific forwarding volume, such as 15,000, etc.
[0031] For example, an intelligent interactive page may be displayed for a user to enter a data query question, wherein the intelligent interactive page is associated with an agent. After the user enters the data query question on the intelligent interactive page, the agent may extract keywords from the data query question to obtain first metadata. For example, if the user enters "What research on agents did X conduct in 2024?" on the intelligent interactive page, the agent may extract keywords from "What research on agents did X conduct in 2024?" to obtain first metadata. For example, the first metadata may include "X," "2024," and "agent."
[0032] The second metadata may be any metadata or specified metadata related to the business identity of the user, wherein the metadata may be a department, a position, a project team, and the like.
[0033] In this embodiment, obtaining the second metadata may involve displaying an intelligent interactive page for a user to enter a data query, where the intelligent interactive page is associated with an agent. When a user creates a session on the intelligent interactive page and obtains user authorization to access the user's login information within the agent, the agent can invoke an application programming interface (API) to retrieve the user's business identity information from the business system and use any metadata or specified metadata associated with 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.
[0034] It can also be: 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 the user's authorization to obtain the user's login information in the intelligent agent, the intelligent agent can call the application programming interface to obtain the user's business identity information from the business system, and display any metadata or specified metadata related to the business identity on the intelligent interactive page for the user to select the second metadata for generating the target filtering condition. For example, the obtained metadata "Department A", metadata "Position F" and metadata "Project C" can be displayed on the intelligent interactive page. If the user selects the metadata "Department A", the metadata "Department A" will be used as the second metadata.
[0035] Of course, the second metadata may also be obtained in other ways, and the present embodiment does not impose any limitation on this.
[0036] In a possible manner, with user authorization, obtaining the second metadata based on the user's business identity information may include: Display the intelligent interaction page associated with the intelligent agent; in response to the user creating a session in the intelligent interaction page, with the user's authorization, call the application programming interface to obtain the user's business identity information from the business system based on the user's login information in the intelligent agent, and assign the business identity information to the preset session variable in the intelligent agent; determine the second metadata based on the preset session variable and the preset mapping relationship, wherein the preset mapping relationship is used to characterize 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.
[0037] The preset session variables can be determined according to actual conditions, and the embodiments of the present disclosure do not impose any restrictions on this. For example, the preset session variables can be "department", "project" or "position".
[0038] For example, when the intelligent agent detects that a user has created a session on the intelligent interactive page and has obtained the user's authorization to obtain the user's login information in the intelligent agent, if the business identity information obtained by the intelligent agent from the business system by calling 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 example, "Department A" can be assigned to the preset session variable "Department", so that the preset session variable "Department" is changed to "Department=A", and "Position Y" can be assigned to the preset session variable "Position", so that the preset session variable "Position" is "Position=Y". After that, the second metadata can be obtained based on the preset session variables and the preset mapping relationship. Among them, in the preset mapping relationship, the preset session variable "Department" in the intelligent agent and the metadata "Department" in the knowledge base have a mapping relationship, and the preset session variable "Position" in the intelligent agent and the metadata "Position" in the knowledge base have a mapping relationship. Thus, the second metadata can be obtained including: "Department=A" and "Position=Y".
[0039] In the above manner, based on the preset session variables and the preset mapping relationship, the second metadata related to the user's business identity information can be automatically obtained, so that the authority control in the knowledge retrieval process can be implemented conveniently and efficiently.
[0040] Among possible approaches, the preset mapping relationship can be obtained by: A parameter editing page for the intelligent agent is displayed, wherein the parameter editing page displays third metadata and reference configuration items pre-configured for knowledge retrieval and filtering in the knowledge base, and the reference configuration items are used to configure the preset session variables of the intelligent agent referenced by the third metadata; in response to a trigger operation on the reference configuration item, the preset session variables of the intelligent agent are displayed; in response to a selection operation in the preset session variables, a mapping relationship is established between the preset session variables corresponding to the selection operation and the third metadata.
[0041] For example, Figure 2 As shown, the parameter editing page displays the third metadata 201 pre-configured for the knowledge base and used for knowledge retrieval filtering, as well as the reference configuration item 202, wherein the reference configuration item 202 includes a drop-down control 203 for displaying the preset session variables of the intelligent agent. When the drop-down control 203 is triggered by operations such as clicking, the preset session variables of the intelligent agent can be displayed. When the target preset session variable is selected by operations such as clicking, a mapping relationship is established between the target preset session variable and the third metadata.
[0042] It should be understood that when a user enters a data query question, the data query question usually does not contain user identity information, while the knowledge files in the knowledge base may be configured with access permissions for the user identity. Therefore, in order to enable users to smoothly view the knowledge content for which they have permission and reduce interaction interruptions caused by identity verification issues, this embodiment can automatically obtain the user's business identity information after obtaining user authorization, and determine the second metadata used to generate the target filtering conditions based on the business identity information. In this way, when the data query question does not contain user identity information, there is no need to feedback clarification prompts to the user for obtaining user identity information, and identity verification and permission matching can be completed in the background, thereby significantly improving the user's interactive experience.
[0043] S102: Generate target filtering conditions for knowledge retrieval filtering based on the first metadata and / or the second metadata.
[0044] For example, generating a target filtering condition for knowledge retrieval filtering based on the first metadata and / or the second metadata may include: concatenating the first metadata and the second metadata to obtain the target filtering condition.
[0045] For example, continuing with the previous example, we can combine "X", "2024", "Agent", and "Department A" to obtain the following target filtering conditions: "Name=X&Year=2024&Category=Agent&Department=Department A".
[0046] For example, generating a target filtering condition for knowledge retrieval filtering based on the first metadata and the second metadata may include: Based on the first metadata, a first filter condition for knowledge retrieval filtering is generated; based on the second metadata, a second filter condition for knowledge retrieval filtering is generated; the first filter condition and the second filter condition are spliced into a target filter condition through a target logical operator, wherein the target logical operator represents that the first filter condition and the second filter condition are satisfied at the same time.
[0047] The target logical operator may be “AND” or “&”, or other logical operators, and the embodiment of the present disclosure does not impose any limitation on this.
[0048] For example, continuing with the above example, you can first generate a first filter condition based on "X", "2024", and "agent". For example, the first filter condition can be: like('author','X '),eq('year',2024), like('keywords','agent'). Then, you can generate a second filter condition based on "department A". For example, the second filter condition can be: like('project', 'A'). Finally, the first and second filter conditions are concatenated using the target logical operator to obtain the target filter condition. For example, the target filter condition can be: (like('author','X '),eq('year',2024), like('keywords', 'agent'))&like('project', 'A').
[0049] S103: Rewrite the data query question to obtain a target query question, wherein the target query question does not include the first metadata.
[0050] For example, the first metadata in the data query question can be deleted to obtain a candidate query question, and then the expression of the candidate query question is optimized to obtain the target query question. Optimizing the expression of the candidate query question can include deleting unnecessary punctuation, unnecessary words, and / or modal particles.
[0051] For example, continuing to refer to the above example, we can first remove "X", "2024" and "intelligent agent" from "What research did X do on intelligent agents in 2024?" to obtain the candidate query question: "What research is there on?" Then, we can optimize the expression of the candidate query statement to obtain the target query question: "What research is there?"
[0052] S104: Convert the target filtering condition and the target query question into a query condition statement for performing knowledge query in the knowledge base, wherein the knowledge base is used to store knowledge fragments obtained by segmenting the knowledge file, and the knowledge fragments corresponding to the same knowledge file are associated with the same metadata tag for knowledge retrieval filtering.
[0053] It should be understood that the query condition statement may be a SQL (Structured Query Language) statement, or a MongoDB query statement or a Redis query statement, or other statements, and the embodiments of the present disclosure do not impose any limitation on this.
[0054] S105: Execute the query condition statement in the knowledge base to obtain knowledge fragments for answering the data query question.
[0055] Through the above technical solution, a target filter condition for knowledge retrieval and filtering can be generated based on the first metadata and / or the second metadata. The data query question can be rewritten to obtain a target query question that does not include the first metadata. The target filter condition and the target query question can be converted into a query condition statement for performing knowledge search in the knowledge base. By executing the query condition statement in the knowledge base, a knowledge fragment used to answer the question is obtained. Because the query condition statement is converted based on the target filter condition and the target query question, the query condition statement can simultaneously cover the filter condition and query question required for knowledge retrieval. Therefore, when performing knowledge search in the knowledge base, the query condition statement can perform both vector search and scalar search. Compared with related technologies, since there is no explicit division between vector search and scalar search stages, the search time can be reduced to a certain extent, the search efficiency can be improved, thereby reducing user waiting time and improving user experience. In addition, because the target filter condition 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 permission control during the knowledge retrieval and filtering process, automatically filtering out knowledge content that does not match the user identity, and on the other hand, it can reduce the number of knowledge queries and further improve search efficiency.
[0056] It should also be understood that in related technologies that employ post-processing for knowledge retrieval, users typically set a search quantity threshold k during the vector retrieval phase, returning the top k search data. This then leads to further screening and filtering based on the returned data, resulting in a very small amount of search data being ultimately returned. However, in the disclosed embodiment, since there is no explicit distinction between vector and scalar search stages, the amount of search data returned can be increased to a certain extent, better meeting the user's knowledge retrieval needs.
[0057] To facilitate understanding of the metadata-based agent knowledge retrieval and filtering method provided by the present disclosure, possible implementation methods of the present disclosure are described below.
[0058] In a possible manner, the metadata-based agent knowledge retrieval and filtering method may further include: displaying a first metadata configuration page for the knowledge base; in response to a configuration operation in the first metadata configuration page, determining third metadata corresponding to the knowledge base for knowledge retrieval filtering according to the configuration operation; Accordingly, extracting the first metadata from the data query question input by the user, and / or, with the user's authorization, obtaining the second metadata based on the user's business identity information, may include: Based on the third metadata, the first metadata is extracted from the data query question input by the user, and / or, with the user's authorization, the second metadata is obtained based on the third metadata and the user's business identity information.
[0059] It should be understood that metadata generally includes a metadata name, metadata type, and 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 the metadata. Therefore, the configuration operations on the first metadata configuration page may at least include configuration operations for the metadata name, metadata type, and metadata description.
[0060] For example, Figure 3 As shown, a configuration item 301 for configuring third metadata and a new control 302 for adding a new configuration item 301 can be displayed on the first metadata configuration page. Configuration item 301 is used to configure at least the metadata name, metadata type, and metadata description of a single metadata item. Thus, in response to a configuration operation on configuration item 301 on the first metadata configuration page, third metadata for knowledge retrieval filtering can be obtained. In response to a triggering operation on the new control 302, a new configuration item 301 for configuring third metadata can be obtained.
[0061] For example, continuing with the previous example, if a user enters an agent data query question like, "What research on agents did X conduct in 2024?", the metadata associated with the user's business identity includes "Department A" and "Position Y," and the third metadata includes "Name," "Department," and "Year." Based on the third metadata, the first metadata extracted from the user's data query question may include "Name = X" and "Year = 2024." With user authorization, the second metadata extracted based on the third metadata and the user's business identity information may include "Department = A."
[0062] It should be understood that when the relevant technology uses a pre-processing method for knowledge retrieval, the method of extracting metadata is usually customized according to specific business needs. The training data of regular expressions and models are closely related to specific businesses. When business needs change, the original extraction rules may no longer be applicable and need to be redesigned and adjusted. As a result, the method of extracting metadata is usually difficult to reuse, resulting in poor scalability and difficulty in adapting to diverse business scenarios and needs. In the embodiment of the present disclosure, since the metadata used for knowledge retrieval and 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 needs without redesigning and adjusting the entire extraction model or regular expression, thereby overcoming the problems of traditional methods being difficult to reuse and poor scalability, and thus enabling the metadata-based intelligent knowledge retrieval and filtering method in the present disclosure to better meet changing business requirements.
[0063] It should also be understood that, in the case of a complex data query, the first metadata extracted from the data query based on the third metadata may include multiple items, and / or the second metadata obtained based on the third metadata and the user's business identity information may include multiple items. However, since different first metadata and / or different second metadata may have different importance in the knowledge retrieval and filtering process, in order to both accurately perform knowledge retrieval and simplify the complexity of the target filtering conditions, in a possible approach, when configuring the metadata used for knowledge retrieval in the knowledge base, the metadata's filter fields may also be configured, wherein the filter fields can be used to indicate whether the corresponding metadata participates in generating the target filtering conditions. Thus, after obtaining the first metadata and / or second metadata, the target metadata used to generate the target filtering conditions for knowledge retrieval and filtering can be determined based on the filter 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 the target filtering conditions constructed based on the first metadata and / or second metadata, and further simplifies the complexity of the query condition statements constructed based on the target filtering conditions, thereby improving the efficiency and accuracy of knowledge retrieval based on the query condition statements.
[0064] That is, in a possible manner, the third metadata may include a filter field, and the filter field is used to indicate whether the corresponding metadata participates in generating the target filter condition. Accordingly, based on the first metadata and / or the second metadata, generating the target filter condition for knowledge retrieval filtering may include: Target metadata is determined in the first metadata and / or the second metadata, wherein the filter field of the target metadata represents that the target metadata participates in generating a target filter condition; and based on the target metadata, a target filter condition for knowledge retrieval filtering is generated.
[0065] The filter fields corresponding to the metadata can be configured accordingly when configuring metadata on the first metadata configuration page. Figure 4 As shown, a configuration item 401 for configuring third metadata and a new control 402 for adding a new configuration item 401 can be displayed on the first metadata configuration page. Configuration item 401 is used to configure at least the metadata name, metadata type, metadata description, and filter fields of a single metadata item. Thus, in response to a configuration operation on configuration item 401 on the first metadata configuration page, third metadata including filter fields and used for knowledge retrieval filtering can be obtained. In response to a triggering operation on new control 402, a new configuration item 401 for configuring third metadata can be obtained.
[0066] For example, continuing with the above example, if the filter fields corresponding to "name" and "department" in the third metadata respectively indicate that "name" and "department" participate in generating the target filter condition, and the filter field corresponding to "year" indicates that "year" does not participate in generating the target filter condition, then "name=X" in the first metadata and "department=A" in the second metadata can be used as target metadata. Subsequently, target filter conditions for knowledge retrieval filtering can be generated based on the target metadata. For example, the following target filter conditions can be generated: "Name=X&Department=DepartmentA".
[0067] It should be understood that an agent can typically be associated with one or more large models, and large models generally have strong semantic understanding and data processing capabilities. Therefore, in order to improve the accuracy of knowledge fragments, further improve the efficiency of knowledge retrieval, and reduce user waiting time, the large model associated with the agent can be used to extract the first metadata from the data query question and rewrite the data query question to obtain the target query question. In other words, among possible methods, extracting the first metadata from the data query question input by the user can include: Invoking the first model to extract first metadata from the data query question input by the user; Accordingly, the data query question is rewritten to obtain the target query question, which may include: The second largest model is called to rewrite the data query question to obtain a target query question, wherein the second largest model is the same as or different from the first largest model.
[0068] For example, when the second large model is the same as the first large model, a first prompt word template can be set in advance. Therefore, 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, and the first prompt word can be input into the first large model to obtain the first metadata and the target query question based on the first prompt word through the first large model.
[0069] When the second large model differs from the first large model, a second prompt word template and a third prompt word template can be pre-set. Thus, after obtaining a data query question, the data query question can be entered into the corresponding position of the second prompt word template to obtain a second prompt word. The second prompt word can then be input into the first large model to obtain the first metadata based on the second prompt word via the first large model. Subsequently, the first metadata and the data query question can be entered into the corresponding position of the third prompt word template to obtain a third prompt word. The third prompt word can then be input into the second large model to obtain the target query question based on the third prompt word via the second large model.
[0070] 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 actual conditions, and the embodiments of the present disclosure do not impose any limitation on this.
[0071] In a possible manner, metadata tags associated with knowledge fragments are obtained by: Display a first metadata configuration page for the knowledge base; in response to a configuration operation in the first metadata configuration page, determine the third metadata corresponding to the knowledge base for knowledge retrieval filtering according to the configuration operation; display a second metadata configuration page for the knowledge file in the knowledge base; in response to a metadata editing operation on the knowledge file in the second metadata configuration page, display the third metadata, and in response to a value configuration operation on the third metadata, determine the metadata tag associated with the knowledge file for knowledge retrieval filtering according to the value configuration operation; add metadata tags to all knowledge fragments corresponding to the knowledge file.
[0072] For example, a plurality of knowledge bases storing different knowledge fragments can be displayed on a first page for knowledge retrieval. When a user triggers a target knowledge base among the plurality of knowledge bases by a click or other operation, a second page can be displayed, and at least a first editing control 501 for editing the knowledge base and an upload control 502 for uploading a knowledge file can be displayed on the second page. Figure 5 When the first editing control 501 is triggered by a click or other operation, the following may be displayed: Figure 3 or as Figure 4The first metadata configuration page is shown, and the third metadata can be configured based on the configuration method described above. For example, the third metadata configured for the target knowledge base can include "project" and "department". After configuring the third metadata for the target knowledge base, the upload control 502 can be triggered by clicking or other operations to display the upload page for uploading knowledge files. After the target knowledge file is uploaded through the upload page, the second metadata configuration page can be displayed. Alternatively, the second page can also display the knowledge files contained in the target knowledge base, and the knowledge files are associated with the 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.
[0073] Among them, the second metadata configuration page can display the third metadata corresponding to the target knowledge base, and in response to the value configuration operation for the third metadata, the metadata tag for knowledge retrieval and filtering associated with the target knowledge file is obtained. For example, continuing with the above example, the third metadata "project" and the third metadata "department" can be displayed on the second metadata configuration page. 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 for knowledge retrieval and filtering associated with the target knowledge file, and metadata tags "project A" and "department A" can be added to all knowledge fragments corresponding to the target knowledge file, such as Figure 6 shown.
[0074] It is worth noting that the tag value configured for the third metadata can be a specific value, such as "Department A" or "Project A"; it can also be a wildcard, or it can be left blank, making the tag value of the third metadata configuration empty. When the tag value is set to a wildcard, it represents that the data value for the third metadata in the target filter condition can be matched regardless of the value; when the tag value is empty, it represents that the knowledge fragment does not contain the third metadata, and it can be matched when the target filter condition does not contain the third metadata; Figure 7 shown.
[0075] In a possible manner, the third metadata may include permission metadata for performing permission control, where the permission control is used to represent access permission control for knowledge files in the knowledge base. Accordingly, in response to a value configuration operation on the third metadata, determining a metadata tag associated with the knowledge file for knowledge retrieval filtering according to the value configuration operation may include: In the process of importing the knowledge file into the knowledge base, in response to a value configuration operation on the permission metadata, determining a permission metadata tag associated with the knowledge file for permission control according to the value configuration operation; Accordingly, metadata tags are added to all knowledge fragments corresponding to the knowledge file, which may include: Add permission metadata tags to all knowledge fragments corresponding to the knowledge file.
[0076] It should be understood that the permission metadata can be determined according to actual conditions, and the embodiments of the present disclosure do not impose any restrictions on this. For example, the permission metadata can be "department", "project" and "position", etc.
[0077] It is worth noting that the value configuration operation of the permission metadata can refer to the value configuration operation of the third metadata on the second metadata configuration page, which will not be repeated here.
[0078] Through the above method, the access permissions of the knowledge files in the knowledge base can be configured, so that when performing subsequent knowledge retrieval, the search scope can be limited according to the user's business identity information, so that the user can only retrieve authorized knowledge resources that match his or her business identity, realizing permission control in the knowledge retrieval filtering process, and effectively ensuring the security and compliance of knowledge resources.
[0079] To facilitate further understanding of the metadata-based agent knowledge retrieval and filtering method provided by the present disclosure, possible implementations of the present disclosure are described below with reference to the accompanying drawings: For example, Figure 8As shown, the metadata-based agent knowledge retrieval and filtering method in this embodiment may include an indexing stage and a recall stage, wherein the indexing stage is used to configure the third metadata for knowledge retrieval and filtering corresponding to the knowledge base and the metadata tags associated with the knowledge fragments in the knowledge base, and convert them into vectors for storage after the configuration is completed. The recall stage is used to perform a series of processing based on the data query questions input by the user to obtain knowledge fragments used to answer the data query questions. Specifically, after the user inputs the data query question to the agent through the intelligent interactive page, on the one hand, the first metadata in the data query question can be extracted based on the third metadata through the first large model associated with the agent; on the other hand, the user's login information in the agent can be obtained with the user's authorization, and the application programming interface can be called to obtain the user's business identity information from the business system, and the second metadata can be obtained based on the business identity information. Afterwards, the target metadata can be filtered out from the first metadata and the second metadata based on the filter field in the third metadata, and the target filtering condition can be generated based on the target metadata. Next, the data query question can be rewritten to obtain the target query question, and based on the target query question and the 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 for answering the data query question, and the knowledge fragments and the data query question can be input into the large language model associated with the intelligent agent. After the knowledge fragments are sorted and summarized by the large language model, the answer to the data query question is output.
[0080] Based on the same concept, the embodiment of the present disclosure also provides a metadata-based intelligent agent knowledge retrieval and filtering device, such as Figure 9 As shown, the metadata-based agent knowledge retrieval and filtering device 900 may include: The acquisition module 901 is configured to extract first metadata from a data query question input by a user, and / or, with user authorization, to acquire second metadata based on the user's business identity information; A generating module 902 is configured to generate a target filtering condition for knowledge retrieval filtering based on the first metadata and / or the second metadata; A rewriting module 903 is configured to rewrite the data query question to obtain a target query question, wherein the target query question does not include the first metadata; A conversion module 904 is configured to convert the target filtering condition and the target query question into a query condition statement for performing knowledge search in a knowledge base, wherein the knowledge base is configured to store knowledge fragments obtained by segmenting knowledge files, and knowledge fragments corresponding to the same knowledge file are associated with the same metadata tag for knowledge retrieval and filtering; The execution module 905 is used to execute the query condition statement in the knowledge base to obtain the knowledge fragment used to answer the data query question.
[0081] Through the above-mentioned metadata-based intelligent knowledge retrieval and filtering device 900, a target filtering condition for knowledge retrieval filtering can be generated based on the first metadata and / or the second metadata, and the data query question can be rewritten to obtain a target query question that does not include the first metadata, and can be converted into a query condition statement for performing knowledge query in the knowledge base based on the target filtering condition and the target query question, and by executing the query condition statement in the knowledge base, a knowledge fragment for answering the question is obtained. Since the query condition statement is converted based on the target filtering condition and the target query question, the query condition statement can simultaneously cover the filtering conditions and query questions required for knowledge retrieval, and then when performing knowledge retrieval in the knowledge base, vector retrieval and scalar retrieval can be performed through the query condition statement. Compared with related technologies, since there is no explicit division between vector retrieval and scalar retrieval stages, the retrieval time can be reduced to a certain extent, the retrieval efficiency can be improved, thereby reducing user waiting time and improving 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 authority control in the knowledge retrieval filtering process and automatically filter out knowledge content that does not match the user identity. On the other hand, it can reduce the amount of knowledge queries and further improve the retrieval efficiency.
[0082] In a possible manner, the metadata-based agent knowledge retrieval and filtering device 900 may further include: A display module, configured to display a first metadata configuration page for the knowledge base; a determination module, configured to respond to a configuration operation in the first metadata configuration page and determine, according to the configuration operation, third metadata corresponding to the knowledge base for knowledge retrieval filtering; Accordingly, the acquisition module 901 can be used to extract the first metadata from the data query question input by the user based on the third metadata, and / or, with user authorization, acquire the second metadata based on the third metadata and the user's business identity information.
[0083] In a possible manner, the third metadata may include a filter field, and the filter field is used to indicate whether the corresponding metadata participates in generating the target filter condition. Accordingly, the generating module 902 may include: A first determining unit is configured to determine target metadata in the first metadata and / or the second metadata, wherein a filtering field of the target metadata indicates that the target metadata participates in generating a target filtering condition; The first generating unit is used to generate target filtering conditions for knowledge retrieval filtering based on target metadata.
[0084] In a possible manner, the acquisition module 901 may include: A display unit, used to display an intelligent interaction page associated with the intelligent agent; An acquisition unit, configured to, in response to a user creating a session in the intelligent interactive page, and under user authorization, call an application programming interface to acquire the user's business identity information from the business system based on the user's login information in the intelligent agent, and assign the business identity information to a preset session variable in the intelligent agent; The second determination unit is used to determine the second metadata based on the preset session variable and the preset mapping relationship, wherein the preset mapping relationship is used to characterize 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.
[0085] In a possible manner, the metadata-based agent knowledge retrieval and filtering device 900 may further include: The first configuration module is used to obtain the preset mapping relationship in the following manner: Displaying a parameter editing page for the agent, wherein the parameter editing page displays third metadata pre-configured for knowledge retrieval and filtering and reference configuration items for configuring preset session variables of the agent referenced by the third metadata; In response to a trigger operation on a referenced configuration item, displaying preset session variables of the agent; In response to a selection operation in the preset session variables, a mapping relationship is established between the preset session variables corresponding to the selection operation and the third metadata.
[0086] In a possible manner, the acquisition module 901 may be used to call the first large model to extract the first metadata from the data query question input by the user; Accordingly, the rewriting module 903 can be used to call the second largest model to rewrite the data query question to obtain the target query question, wherein the second largest model is the same as or different from the first largest model.
[0087] In a possible manner, the generating module 902 may include: A second generating unit, configured to generate a first filtering condition for knowledge retrieval filtering based on the first metadata; a third generating unit, configured to generate a second filtering condition for knowledge retrieval filtering based on the second metadata; The concatenation unit is configured to concatenate the first filter condition and the second filter condition into a target filter condition through a target logical operator, wherein the target logical operator represents that the first filter condition and the second filter condition are satisfied at the same time.
[0088] In a possible manner, the metadata-based agent knowledge retrieval and filtering device 900 may further include: The second configuration module is used to obtain metadata tags associated with knowledge fragments in the following manner: Displaying a first metadata configuration page for the knowledge base; In response to a configuration operation in the first metadata configuration page, determining third metadata corresponding to the knowledge base for knowledge retrieval filtering according to the configuration operation; Displaying a second metadata configuration page for the knowledge file in the knowledge base; In response to a metadata editing operation on the knowledge file in the second metadata configuration page, displaying third metadata, and in response to a value configuration operation on the third metadata, determining a metadata tag associated with the knowledge file for knowledge retrieval filtering according to the value configuration operation; Add metadata tags to all knowledge fragments corresponding to the knowledge file.
[0089] In a possible manner, the third metadata may include permission metadata for permission control, and the permission control is used to characterize the access permission control for knowledge files in the knowledge base. Accordingly, the second configuration module can also be used to respond to the value configuration operation of the permission metadata during the process of importing the knowledge file into the knowledge base, and determine the permission metadata tag for permission control associated with the knowledge file according to the value configuration operation, and add the permission metadata tag to all knowledge fragments corresponding to the knowledge file.
[0090] Based on the same concept, an embodiment of the present disclosure further provides a computer-readable medium on which a computer program is stored. When the program is executed by a processing device, the program implements the steps of any of the above-mentioned metadata-based intelligent agent knowledge retrieval and filtering methods.
[0091] Based on the same concept, an embodiment of the present disclosure further provides an electronic device, which may include: a storage device having a computer program stored thereon; The processing device is used to execute the computer program in the storage device to implement the steps of any of the above-mentioned metadata-based intelligent agent knowledge retrieval and filtering methods.
[0092] Based on the same concept, an embodiment of the present disclosure further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned metadata-based intelligent agent knowledge retrieval and filtering methods.
[0093] Reference below Figure 10 , which shows a schematic structural diagram of an electronic device 1000 suitable for implementing an embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, 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 only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0094] like Figure 10 As shown, electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1008 into a random access memory (RAM) 1003. Various programs and data required for the operation of electronic device 1000 are also stored in RAM 1003. Processing device 1001, ROM 1002, and RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to bus 1004.
[0095] Typically, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange data. Figure 10 The electronic device 1000 is shown with various devices, but 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 instead.
[0096] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0097] It should be noted that the computer-readable medium described above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable storage media may include, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, 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, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may 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 the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such a propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wire, optical cable, RF (radio frequency), or any suitable combination thereof.
[0098] In some embodiments, communications may be conducted using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.
[0099] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0100] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: extracts first metadata from the data query question input by the user, and / or, with the user's authorization, obtains second metadata based on the user's business identity information; generates a target filtering condition for knowledge retrieval filtering based on the first metadata and / or the second metadata; rewrites the data query question to obtain a target query question, wherein the target query question does not include the first metadata; converts the target filtering condition and the target query question into a query condition statement for knowledge query in a 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 tag for knowledge retrieval filtering; executes the query condition statement in the knowledge base to obtain knowledge fragments for answering questions.
[0101] Computer program code for performing the operations of the present disclosure may 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, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone 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 a remote computer, the remote computer may 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 may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0102] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0103] The modules described in the embodiments of the present disclosure may be implemented in software or hardware, wherein the name of a module does not necessarily limit the module itself.
[0104] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0105] In the context of the present disclosure, a machine-readable medium may 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 may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0106] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the present disclosure is not limited to technical solutions formed by specific combinations of the aforementioned technical features. It also encompasses other technical solutions formed by any combination of the aforementioned technical features or their equivalents, without departing from the scope of the above disclosure. For example, a technical solution formed by replacing the aforementioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0107] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0108] Although the subject matter has been described using language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims. Regarding the apparatus in the above-described embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method and will not be elaborated upon here.
Claims
1. A metadata-based agent knowledge retrieval and filtering method, characterized in that: include: Extracting first metadata from a data query question input by a user, and / or, with user authorization, obtaining second metadata based on the user's business identity information; generating target filtering conditions for knowledge retrieval filtering based on the first metadata and / or the second metadata; Rewriting the data query question to obtain a target query question, wherein the target query question does not include the first metadata; Converting the target filtering condition and the target query question into a query condition statement for performing knowledge query in a knowledge base, wherein the knowledge base is used to store knowledge fragments obtained by segmenting knowledge files, and knowledge fragments corresponding to the same knowledge file are associated with the same metadata tag for knowledge retrieval and filtering; The query condition statement is executed in the knowledge base to obtain knowledge fragments for answering the data query question.
2. The method for retrieval and filtering of agent knowledge based on metadata according to claim 1, characterized in that: The metadata-based agent knowledge retrieval and filtering method further includes: displaying a first metadata configuration page for the knowledge base; In response to a configuration operation in the first metadata configuration page, determining, according to the configuration operation, third metadata corresponding to the knowledge base for knowledge retrieval filtering; The extracting of the first metadata from the data query question input by the user, and / or, with the user's authorization, obtaining the second metadata based on the user's business identity information, includes: 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 business identity information of the user.
3. The method for retrieval and filtering of intelligent knowledge based on metadata according to claim 2, characterized in that: The third metadata includes a filter field, and the filter field is used to indicate whether the corresponding metadata participates in generating the target filter condition. The generating of the target filter condition for knowledge retrieval filtering based on the first metadata and / or the second metadata includes: determining target metadata in the first metadata and / or the second metadata, wherein a filtering field of the target metadata indicates that the target metadata participates in generating the target filtering condition; Based on the target metadata, target filtering conditions for knowledge retrieval filtering are generated.
4. The method for retrieval and filtering of intelligent agent knowledge based on metadata according to claim 1, characterized in that: The acquiring of the second metadata based on the business identity information of the user under user authorization includes: Display the intelligent interaction page associated with the intelligent agent; In response to the user creating a session in the intelligent interactive page, and with the user's authorization, based on the user's login information in the agent, calling an application programming interface to obtain the user's business identity information from the business system, and assigning the business identity information to a preset session variable in the agent; Determine second metadata based on the preset session variable and the preset mapping relationship, wherein the preset mapping relationship is used to characterize the mapping relationship between the preset session variable 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 variable.
5. The method for retrieval and filtering of intelligent agent knowledge based on metadata according to claim 4, characterized in that: The preset mapping relationship is obtained in the following manner: Displaying a parameter editing page for the agent, wherein the parameter editing page displays third metadata and reference configuration items pre-configured for the knowledge base for knowledge retrieval filtering, and the reference configuration items are used to configure preset session variables of the agent referenced by the third metadata; In response to a triggering operation on the reference configuration item, displaying preset session variables of the agent; 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.
6. The method for retrieval and filtering of intelligent agent knowledge based on metadata according to any one of claims 1 to 5, characterized in that: The step of extracting the first metadata from the data query question input by the user includes: Invoke the first model to extract first metadata from the data query question input by the user; Rewriting the data query question to obtain a target query question includes: A second large model is called to rewrite the data query question to obtain a target query question, wherein the second large model is the same as or different from the first large model.
7. The method for retrieval and filtering of intelligent agent knowledge based on metadata according to any one of claims 1 to 5, characterized in that: Generating a target filtering condition for knowledge retrieval filtering based on the first metadata and the second metadata includes: generating a first filtering condition for knowledge retrieval filtering based on the first metadata; generating a second filtering condition for knowledge retrieval filtering based on the second metadata; The first filtering condition and the second filtering condition are spliced into a target filtering condition through a target logical operator, wherein the target logical operator represents that the first filtering condition and the second filtering condition are satisfied at the same time.
8. The method for retrieval and filtering of intelligent agent knowledge based on metadata according to any one of claims 1 to 5, characterized in that: The metadata tags associated with the knowledge fragments are obtained in the following way: displaying a first metadata configuration page for the knowledge base; In response to a configuration operation in the first metadata configuration page, determining, according to the configuration operation, third metadata corresponding to the knowledge base for knowledge retrieval filtering; displaying a second metadata configuration page for the knowledge file in the knowledge base; In response to an operation to edit the metadata of the knowledge file in the second metadata configuration page, displaying the third metadata, and in response to an operation to configure a value of the third metadata, determining a metadata tag associated with the knowledge file for knowledge retrieval filtering according to the value configuration operation; The metadata tags are added to all knowledge fragments corresponding to the knowledge file.
9. The method for retrieval and filtering of intelligent agent knowledge based on metadata according to claim 8, characterized in that: The third metadata includes permission metadata for performing permission control, wherein the permission control is used to represent access permission control for knowledge files in the knowledge base. The step of responding to a value configuration operation on the third metadata and determining a metadata tag associated with the knowledge file for knowledge retrieval filtering according to the value configuration operation includes: In the process of importing the knowledge file into the knowledge base, in response to a value configuration operation on the rights metadata, determining a rights metadata tag for rights control associated with the knowledge file according to the value configuration operation; Adding the metadata tags to all knowledge fragments corresponding to the knowledge file includes: The permission metadata tag is added to all knowledge fragments corresponding to the knowledge file.
10. A metadata-based agent knowledge retrieval and filtering device, characterized in that: include: an acquisition module, configured to extract first metadata from a data query question input by a user, and / or, with user authorization, acquire second metadata based on the user's business identity information; A generating module, configured to generate a target filtering condition for knowledge retrieval filtering based on the first metadata and / or the second metadata; a rewriting module, configured to rewrite the data query question to obtain a target query question, wherein the target query question does not include the first metadata; a conversion module for converting the target filtering condition and the target query question into a query condition statement for performing knowledge query in a knowledge base, wherein the knowledge base is used to store knowledge fragments obtained by segmenting knowledge files, and knowledge fragments corresponding to the same knowledge file are associated with the same metadata tag for knowledge retrieval and 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.
11. A computer-readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 9 are implemented.
12. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 9.
13. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
SQL statement parsing-based data permission control method and apparatus
CN106250782A
Permission filtering method and device and storage medium
CN112084167A
Data authority control method and device, electronic equipment and storage medium
CN114461610A
Data authority management method and device
CN115758459A
Data authority control method and device, electronic equipment and computer storage medium
CN118012892A
Cited By
Multi-modal knowledge search method and system, electronic equipment and storage medium
CN121524417A