Enterprise question answering enhancement method, device, equipment, medium and product based on RAG technology

By generating original environmental feature vectors and hierarchical retrieval instructions in the enterprise question-answering enhancement method, it is possible to accurately map business scenarios without manual input, thereby improving retrieval accuracy and speed, and solving the problems of difficulty in capturing implicit needs and slow response caused by manual input by users in existing RAG technology.

CN120892540BActive Publication Date: 2025-12-09CHANGSHA WANYING TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511417502.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2025-12-09
Estimated Expiration
2045-09-30

AI Technical Summary

Technical Problem

Existing RAG technology relies too heavily on users manually inputting contextual information in enterprise intelligent customer service scenarios, making it difficult to capture implicit needs in dynamic operating environments. This results in discrepancies between search results and actual user needs, and the search response speed is slow, failing to meet user requirements.

Method used

By responding to trigger commands, the system obtains the current page data, generates the original environmental feature vector, generates knowledge base retrieval commands at different levels based on the vector, performs vector semantic retrieval and keyword precision retrieval in parallel, generates natural language answers using the LIM model, and optimizes response speed by combining a cached database.

Benefits of technology

It improves the accuracy and response speed of search results, resolves the conflict between generality and personalization caused by single knowledge base retrieval, expands the search scope, enhances the semantic relevance between search results and user operations, and reduces response latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892540B_ABST
    Figure CN120892540B_ABST
Patent Text Reader

Abstract

The application discloses an enterprise question answering enhancement method and device based on RAG technology, equipment, medium and product, relates to the natural language processing technical field, and the method comprises the following steps: acquiring current page data and generating an original environment feature vector in response to a trigger instruction; based on the original environment feature vector, different hierarchical retrieval instructions corresponding to different hierarchical knowledge bases are generated; based on the different hierarchical retrieval instructions, vector semantic retrieval and keyword accurate retrieval are performed in parallel in the corresponding hierarchical knowledge base to obtain different hierarchical retrieval results corresponding to the different hierarchical knowledge bases; the different hierarchical retrieval results are de-duplicated and comprehensively sorted, and a natural language answer matched with current page information is generated by using an LIM model. The application can improve retrieval accuracy and response speed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of natural language processing, in particular to an enterprise question answering enhancement method and device based on RAG technology, equipment, medium and product. BACKGROUND

[0002] With the rapid development of artificial intelligence technology, the retrieval augmentation generation (RAG) system has been widely used in enterprise intelligent customer service, document auxiliary generation, business process guidance and other fields because it can combine external knowledge base to improve the accuracy of large language model (LLM) output. However, the existing RAG technology still has defects in the above application scenarios. In particular, in the enterprise intelligent customer service scenario, the existing RAG technology excessively relies on user manual input of context information, is difficult to capture implicit requirements in a dynamic operation environment, and leads to deviation between the retrieval result and the actual needs of the user. In addition, the existing RAG technology has slow retrieval response, which is difficult to meet the needs of users. Therefore, there is an urgent need for an enterprise question answering enhancement method that can improve retrieval accuracy and response speed. SUMMARY

[0003] In view of the above defects or deficiencies in the related art, the purpose of the present application is to provide an enterprise question answering enhancement method and device based on RAG technology, equipment, medium and product, which can improve retrieval accuracy and response speed.

[0004] To achieve the above-mentioned purpose, the present application provides the following solutions:

[0005] In a first aspect, the present application provides an enterprise question answering enhancement method based on RAG technology, comprising: obtaining current page data in response to a trigger instruction to generate an original environment feature vector; based on the original environment feature vector, generating different level retrieval instructions corresponding to different levels of knowledge base; based on the different level retrieval instructions, performing vector semantic retrieval and keyword exact retrieval in the corresponding level knowledge base in parallel to obtain different level retrieval results corresponding to different levels of knowledge base; de-duplicating and comprehensively sorting the different level retrieval results, and using a LIM model to generate a natural language answer matching the current page information.

[0006] Optionally, the method further comprises: based on the different level retrieval instruction, searching whether there is a pre-generated record in the cache database corresponding to the different level; if there is a pre-generated record in the cache database of the different level, returning the pre-generated retrieval result cached by the cache database of the different level to the user terminal; if there is no pre-generated record in the cache database of the different level, based on the retrieval instruction of the different level, performing vector semantic retrieval and keyword exact retrieval in the knowledge base corresponding to the level in parallel to obtain different level retrieval results corresponding to the knowledge base of the different level; deduplicating and comprehensively sorting the different level retrieval results, and generating a natural language answer matched with the current page information by using a LIM model.

[0007] Optionally, the response trigger instruction acquires current page data and generates an original environment feature vector, comprising: in response to the trigger instruction input by the user terminal, monitoring the DOM tree of the current page, capturing the element state and user operation path of the current page, and generating the original environment feature vector; the original environment feature vector comprises page structure features, business data features, user interaction features, permission and role features.

[0008] Optionally, based on the original environment feature vector, the method further comprises: based on the domain ontology library, the original environment feature vector is parsed into a public library retrieval instruction, a shared library retrieval instruction and a private library retrieval instruction; the public library retrieval instruction corresponds to an enterprise-level knowledge base, the shared library retrieval instruction corresponds to a project shared knowledge base, and the private library retrieval instruction corresponds to a user personal knowledge base.

[0009] Optionally, after the original environment feature vector is parsed into the different level retrieval instruction corresponding to the different level knowledge base, the method further comprises: based on the LowLLM model, the public library retrieval instruction, the shared library retrieval instruction and the private library retrieval instruction are subjected to noise purification, intent decoupling and term alignment to generate an optimized public library retrieval instruction, an optimized shared library retrieval instruction and an optimized private library retrieval instruction.

[0010] Optionally, the vector semantic retrieval and the keyword exact retrieval are performed in parallel in the knowledge base of the corresponding level based on the retrieval instructions of different levels to obtain different level retrieval results corresponding to the knowledge base of different levels, including: performing the vector semantic retrieval and the keyword exact retrieval on the enterprise-level knowledge base based on the optimized common library retrieval instruction, and performing preliminary fusion on the results of the vector semantic retrieval and the keyword exact retrieval to generate the common library retrieval result corresponding to the enterprise-level knowledge base; performing the vector semantic retrieval and the keyword exact retrieval on the project shared knowledge base based on the optimized shared library retrieval instruction, and performing preliminary fusion on the results of the vector semantic retrieval and the keyword exact retrieval to generate the shared library retrieval result corresponding to the project shared knowledge base; and performing the vector semantic retrieval and the keyword exact retrieval on the user personal knowledge base based on the optimized private library retrieval instruction, and performing preliminary fusion on the results of the vector semantic retrieval and the keyword exact retrieval to generate the private library retrieval result corresponding to the user personal knowledge base.

[0011] In a second aspect, the present application provides an enterprise question answering enhancement device based on RAG technology, comprising:

[0012] a response generation module configured to obtain current page data in response to a trigger instruction and generate an original environment feature vector;

[0013] an instruction generation module configured to generate retrieval instructions corresponding to knowledge bases of different levels based on the original environment feature vector;

[0014] a retrieval generation module configured to perform vector semantic retrieval and keyword exact retrieval in parallel in the knowledge base of the corresponding level based on the retrieval instructions of different levels to obtain different level retrieval results corresponding to the knowledge base of different levels;

[0015] a result generation module configured to perform deduplication and comprehensive sorting on the different level retrieval results, and generate a natural language answer matching the current page information by using a LIM model.

[0016] In a third aspect, the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the enterprise question answering enhancement method based on RAG technology according to any one of the above.

[0017] In a fourth aspect, the present application provides a computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of the enterprise question answering enhancement method based on RAG technology according to any one of the above.

[0018] In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method for enhancing enterprise question answering based on RAG technology according to any one of the above.

[0019] According to the specific embodiments provided in the present application, the following technical effects are disclosed:

[0020] The present application provides a method, device, equipment, medium and product for enhancing enterprise question answering based on RAG technology. The current page data is obtained by responding to the trigger instruction, and the original environment feature vector is generated. The business scenario can be accurately mapped without manual input. The defect that it is difficult to capture the implicit demand in the dynamic operation environment caused by excessive dependence on manual input of context information in the prior art is solved. The different level retrieval instructions corresponding to the knowledge bases of different levels are generated through the original environment feature vector, which can effectively improve the semantic correlation degree between the retrieval results and the current operation of the user. Through the retrieval instructions of different levels, the vector semantic retrieval and the keyword accurate retrieval are performed in parallel in the corresponding level knowledge base to obtain the retrieval results of different levels corresponding to the knowledge bases of different levels. Not only can the defect of the conflict between universality and individualization caused by single knowledge base retrieval be solved, but also the retrieval range can be effectively expanded and the accuracy of retrieval can be improved. On the basis of improving the accuracy of retrieval, parallel retrieval can effectively improve the retrieval efficiency. Through deduplication and comprehensive sorting of the retrieval results of different levels, and using the LIM model to generate a natural language answer matched with the current page information, the accuracy of the retrieval results can be further improved. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0022] Figure 1 A flowchart of a method for enhancing enterprise question answering based on RAG technology according to an embodiment of the present application is provided.

[0023] Figure 2 A functional module diagram of a device for enhancing enterprise question answering based on RAG technology according to an embodiment of the present application is provided.

[0024] Figure 3 A structural diagram of a computer device according to an embodiment of the present application is provided. DETAILED DESCRIPTION

[0025] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, all the other embodiments obtained by those of ordinary skill in the art without creative effort belong to the scope of the present application.

[0026] The above purposes, features and advantages of the present application will be more obvious and understandable. The present application will be further described in detail below with reference to the drawings and specific embodiments.

[0027] In an exemplary embodiment, as shown in Figure 1 An enterprise question answering enhancement method based on RAG technology is provided, which is executed by a computer device, specifically, can be executed by a terminal or a server or other computer device alone, or can be executed by a terminal and a server together. In the embodiments of the present application, the method includes the following steps S101 to S104. Wherein:

[0028] In step S101, current page data is acquired in response to a trigger instruction, and an original environment feature vector is generated.

[0029] In the example embodiment, the original environment feature vector includes page structure features, business data features, user interaction features, and permission and role features. Among them, the page structure features are DOM path identifiers, hierarchical paths in the page element DOM tree (such as / html / body / div[2] / form / input[@id="project_id"]), which are used to accurately locate element positions and ensure the accuracy of captured data. Page metadata includes page unique ID (such as page_contract_draft), URL (such as / procurement / contract / draft), version number (such as v1.2), etc., which are used to distinguish different business pages and avoid cross-page data confusion. Business data features include element content and attributes, i.e. the specific values of the page elements operated by the user, including: input box text (such as project number "PRJ-202506" and contract amount "50,000 yuan"); selected items in the drop-down box (such as procurement type "service procurement" and department "R&D department"); button / label status (such as whether the "submit" button is clickable and whether the "under review" label is active). Business object association ID is the business entity identifier related to the current operation (such as project ID, supplier ID, and contract ID), which is used to bind the project shared library or personal knowledge base. User interaction features, such as operation path sequence, are the user's behavior trajectory in the page (such as homepage→ procurement management→ supplier screening→ contract drafting), which is generated by recording the DOM nodes of click, jump, etc. events, and is used to determine the user's current business scenario. Timestamp is the time of occurrence of each operation (such as 2025-07-21 10:30:15), which is used to distinguish different operation stages of the same page and assist in screening time-sensitive knowledge. User role code is the permission identifier of the currently logged-in user (such as role_manager and role_staff), which is used to generate permission-adapted search instructions (such as the "maximum review amount" field accessible to managers). The permission range parameter is the boundary of the resources that the user can operate (such as the range of projects that can be viewed and the list of fields that can be edited), which is extracted through the visibility and editability attributes of elements in the DOM (such as the "advanced settings" hidden from administrators).

[0030] Optionally, the above step S101 includes monitoring the DOM tree of the current page in response to the trigger instruction input by the user terminal, capturing the element state and user operation path of the current page, and generating the original environment feature vector.

[0031] Step S102, based on the original environment feature vector, generates different levels of search instructions corresponding to different levels of knowledge bases.

[0032] In the example embodiment, the terminal device is provided with a browser automation tool, the browser automation tool monitors the DOM tree changes in real time through MutationObserver, captures the user operation path and page element state, and generates retrieval instructions corresponding to knowledge bases of different levels, which include page ID, permission role and business object ID.

[0033] Optionally, the step S102 can include: parsing the original environment feature vector into a public library retrieval instruction, a shared library retrieval instruction and a private library retrieval instruction based on the domain ontology library; the public library retrieval instruction corresponds to an enterprise-level knowledge base, the shared library retrieval instruction corresponds to a project shared knowledge base, and the private library retrieval instruction corresponds to a user personal knowledge base.

[0034] In the example embodiment, the domain ontology library (Domain Ontology Library) is a structured knowledge model constructed for a specific industry or business field (such as finance, medical treatment, enterprise management, etc.), which realizes formalized description of domain knowledge by standardizing definition of core concepts, relationships between concepts and business rules in the field, so that the computer can understand and reason the semantic information of the field. The core role of the domain ontology library is to eliminate term ambiguity and establish a unified knowledge framework to provide semantic level accurate matching for information retrieval, intelligent question answering and other scenarios. The domain ontology library in the embodiment of the application is an ontology library for enterprise procurement, for example, the core concepts can include: procurement type, business process, role and document, etc.; the procurement type is, for example: service procurement, equipment procurement, and material procurement; the business process is, for example: demand reporting, supplier screening, contract drafting, approval, and payment; the role is, for example: procurement specialist, department manager, financial auditor, and general manager; and the document is, for example: procurement demand sheet, supplier qualification document, contract draft, and approval sheet. The relationships between concepts can include: parent-child relationship, association relationship, and constraint relationship; the parent-child relationship is, for example: contract drafting is a sub-process of the business process; the department manager is a sub-role of the approval role; the association relationship is, for example: contract drafting needs to be associated with the supplier qualification document; payment needs to be associated with the approval; and the constraint relationship is, for example: when the contract amount is greater than 1 million, the approval role must include the general manager; and the supplier screening for service procurement needs to be additionally associated with the service qualification certification. The business rules convert the implicit rules in the field into executable logic, such as: procurement type = equipment procurement and amount > 500,000 yuan, then the business process must include the bidding link; and if the user role = procurement specialist, then only demand reporting and contract drafting can be initiated, without final approval authority.

[0035] The domain ontology library uses its concept mapping, relationship reasoning, rule constraints, and other mechanisms to convert the original environment feature vector unstructured data into structured search targets, generates search instructions corresponding to enterprise-level knowledge base, project-level shared knowledge base, and user personal knowledge base, and realizes precise routing of enterprise-level knowledge base, project-level shared knowledge base, and user personal knowledge base.

[0036] In other embodiments, the domain ontology library is combined with the LowLLM model to convert the original environment feature vector input by the user, i.e., non-standard terminology or structured information, into standardized expressions matching the indexes of enterprise-level knowledge base, project-level shared knowledge base, and user personal knowledge base according to the core concepts, relationships between concepts, and business rules defined in the domain ontology library, realizing terminology alignment optimization and query intent decoupling.

[0037] The public library search instruction contains enterprise-level public parameters such as procurement type and department specification, the shared library search instruction contains project-level shared parameters such as project number and contract amount, and the private library search instruction contains user-level personalized parameters such as project handler and historical operation record. Among them, the public library uses version snapshot mechanism to store standardized answers, the shared library realizes project internal knowledge sharing through permission group binding, and the private library uses AES-256 algorithm to encrypt and store personalized data.

[0038] Further optionally, the public library search instruction is used to locate the enterprise-level knowledge base and store public knowledge such as general specifications and standard processes. The generation logic includes extracting business type parameters (such as procurement type and approval process) and permission roles in the environment feature vector and mapping them to the classification tags of the public library. Adding version constraints (such as the current system version) ensures the timeliness of the search results.

[0039] The shared library search instruction is used to locate the project-level shared knowledge base and store documents and collaboration records of specific projects. The generation logic includes extracting project identifiers (such as project ID and contract number) and collaboration parameters (such as department and team) in the environment feature vector and mapping them to the project space of the shared library. Adding permission filtering (such as allowing only project members to access) ensures data security.

[0040] The private library search instruction is used to locate the user personal knowledge base and store historical operation records and personalized preferences. The generation logic includes extracting user ID and operation context (such as historical approval records and commonly used templates) in the environment feature vector and mapping them to the user private space. Adding time window constraints (such as records in the last 3 months) improves search efficiency.

[0041] In other embodiments, in order to improve the accuracy of the retrieval, after the step S102, the method can further include: based on the LowLLM model, performing noise purification, intent decoupling and term alignment on the public library retrieval instruction, the shared library retrieval instruction and the private library retrieval instruction, to generate an optimized public library retrieval instruction, an optimized shared library retrieval instruction and an optimized private library retrieval instruction.

[0042] It should be noted that noise purification includes merging repeated fields and removing redundant information, intent decoupling includes converting structured operation paths into natural language queries, and term alignment includes mapping uniform user input terms and knowledge base indexes through a domain ontology library.

[0043] In addition, in the Prompt conversation record generation, after the LowLLM model receives the retrieval instruction, the retrieval instruction is first converted into a JSON format optimized Prompt containing query and filters, then the natural language query and the filtering condition are separated, and then the optimized retrieval instruction is sent to the corresponding knowledge base to complete the optimization processing of the retrieval instruction.

[0044] Step S103, based on the retrieval instructions of different levels, performing vector semantic retrieval and keyword exact retrieval in the corresponding level knowledge base in parallel, to obtain different level retrieval results corresponding to different level knowledge bases.

[0045] In an example embodiment, the retrieval instruction includes a public library retrieval instruction, a shared library retrieval instruction and a private library retrieval instruction, and the optimized retrieval instruction includes an optimized public library retrieval instruction, an optimized shared library retrieval instruction and an optimized private library retrieval instruction.

[0046] Optionally, the above step S103 can include: based on the optimized public library retrieval instruction, performing vector semantic retrieval and keyword exact retrieval on the enterprise-level knowledge base, and preliminarily fusing the results after the vector semantic retrieval and the keyword exact retrieval to generate a public library retrieval result corresponding to the enterprise-level knowledge base; based on the optimized shared library retrieval instruction, performing vector semantic retrieval and keyword exact retrieval on the project shared knowledge base, and preliminarily fusing the results after the vector semantic retrieval and the keyword exact retrieval to generate a shared library retrieval result corresponding to the project shared knowledge base; based on the optimized private library retrieval instruction, performing vector semantic retrieval and keyword exact retrieval on the user personal knowledge base, and preliminarily fusing the results after the vector semantic retrieval and the keyword exact retrieval to generate a private library retrieval result corresponding to the user personal knowledge base.

[0047] It is understood that before the parallel retrieval is started, the optimized retrieval instructions of each level need to be structured and split, to provide input for two retrieval methods, including vector retrieval input and keyword retrieval input, wherein the vector retrieval input is to convert the semantic parameters in the retrieval instruction (such as the service procurement contract drafting specification) into a dense vector (generated by a pre-trained text embedding model such as BERT, Sentence-BERT), which is used to calculate the cosine similarity with the vector in the knowledge base. The keyword retrieval input is to extract explicit keywords (such as service procurement, contract template, PRJ-202506) from the retrieval instruction, and expand the keyword coverage through the domain word table (such as contract drafting, contract preparation → draft preparation).

[0048] The optimized public library retrieval instruction, the optimized shared library retrieval instruction, and the optimized private library retrieval instruction are used to perform three-level knowledge base parallel execution hybrid retrieval on enterprise-level knowledge base, project shared knowledge base, and user personal knowledge base. Through multi-thread scheduling (such as Python's concurrent.futures or distributed framework Celery), the enterprise-level knowledge base, the project shared knowledge base, and the user personal knowledge base are simultaneously started for vector semantic retrieval and keyword exact retrieval. The retrieval logic of each level is as follows:

[0049] The vector semantic retrieval of the enterprise-level knowledge base is to input the semantic vector of the retrieval instruction, such as the vector corresponding to "manager's authority specification for service procurement contract drafting". The cosine similarity between the vector corresponding to "manager's authority specification for service procurement contract drafting" and the knowledge vector in the enterprise-level knowledge base (such as the vector of "purchase management specification" and "contract drafting standard") is calculated, and the TOP10 high similarity result is returned. This result focuses on implicit association, such as the indirect association between "service procurement" and "supplier qualification audit". The keyword exact retrieval is to input the keywords extracted from the retrieval instruction (such as service procurement, contract drafting, manager's authority, and v1.2 version). The BM25 algorithm is used to retrieve the text index of the public library, and the documents containing the keywords are accurately matched (focusing on explicit matching, such as clauses in the specification that explicitly mention the manager's approval authority). The output includes document ID (such as pub_std_003), keyword matching score (such as 0.92), and matching keyword position (such as article 3.2).

[0050] After that, the two retrieval results are de-duplicated (keeping the high-score version), sorted according to "keyword score × 0.7 + vector score × 0.3" (compliance scenario weight), and the retrieval result of the enterprise-level knowledge base is obtained (such as TOP8 result).

[0051] The vector semantic retrieval of the project shared knowledge base is a semantic vector of the input search instruction, such as the vector corresponding to the shared knowledge of the project service procurement contract drafting of the PRJ-202506 project. The similarity of the vectors of the project documents in the project shared knowledge base, such as the vectors of the project proposal and the meeting minutes, is calculated, and the results associated with the project context are returned, such as the risk terms of the similar project contract. The output includes the document ID (such as sha_prj202506_012), the similarity score (such as 0.85), and the associated project node (such as the contract drafting stage). The keyword exact retrieval is to input the project-specific keywords extracted from the search instruction, such as PRJ-202506, R&D department, and service procurement contract. The project index of the project shared knowledge base is searched, and the documents containing the project ID and the department name are accurately matched, such as the contract template revision record in the project shared folder. The output includes the document ID (such as sha_prj202506_008), the keyword matching score (such as 0.90), and the matching field (such as project ID = PRJ-202506).

[0052] Then, the two retrieval results are de-duplicated and sorted according to the keyword score x 0.5 + vector score x 0.5 (balanced weight in the project collaboration scenario), and the retrieval results of the project shared knowledge base are obtained (such as TOP10 results).

[0053] The vector semantic retrieval of the user personal knowledge base is a semantic vector of the input search instruction, such as the vector corresponding to the historical operation knowledge of user Zhang3 in the service procurement contract drafting. The similarity of the vectors of the user historical records, such as the vectors of the user's past contract modification records and approval preferences, in the user personal knowledge base is calculated, and the personalized knowledge associated with the user's habits is returned (such as the supplementary terms added by the user). The output includes the document ID (such as pri_user_zhang3_015), the similarity score (such as 0.88), and the associated user behavior (such as 2025-05 similar operation). The keyword exact retrieval is to input the user-specific keywords extracted from the search instruction (such as user_zhang3, contract drafting history, and the last 3 months). The text index of the user personal knowledge base is searched, and the records containing the user ID and the operation time (such as the user's past saved "contract draft template") are accurately matched. The output includes the document ID (such as pri_user_zhang3_019), the keyword matching score (such as 0.85), and the operation timestamp (such as 2025-06-10).

[0054] Then, the two retrieval results are de-duplicated and sorted according to the keyword score x 0.4 + vector score x 0.6 (weight in the personalized scenario), and the retrieval results of the user personal knowledge base are obtained (such as TOP5 results).

[0055] Step S104, the different levels of retrieval results are de-duplicated and comprehensively sorted, and the LIM model is used to generate a natural language answer matched with the current page information.

[0056] The steps S101 to S104 are implemented, the current page data is acquired by responding to the trigger instruction, the original environment feature vector is generated, the business scenario is accurately mapped without manual input, the defect that the implicit demand in the dynamic operation environment is difficult to capture due to the over-reliance on manual input of the user to input the context information in the prior art is solved, the different levels of retrieval instructions corresponding to the different levels of knowledge bases are generated based on the original environment feature vector, the semantic correlation between the retrieval results and the current operation of the user can be effectively improved, the vector semantic retrieval and the keyword accurate retrieval are performed in parallel in the knowledge base corresponding to the level based on the different levels of retrieval instructions, the different levels of retrieval results corresponding to the different levels of knowledge bases are obtained, the defect of the conflict between the universality and the individuality caused by the single knowledge base retrieval is solved, the retrieval range is effectively expanded, and the accuracy of the retrieval is improved, on the basis of improving the accuracy of the retrieval, the parallel retrieval is realized, and the retrieval efficiency is effectively improved, the different levels of retrieval results are de-duplicated and comprehensively sorted, and the LIM model is used to generate a natural language answer matched with the current page information, and the accuracy of the retrieval results can be further improved.

[0057] In another exemplary embodiment of the present application, in order to reduce the retrieval time and improve the response speed, the method can further include the following steps S201 to S203. Wherein:

[0058] Step S201, whether there is a pre-generated record in the cache database corresponding to the different levels of retrieval instructions based on the different levels of retrieval instructions;

[0059] Step S202, if there is a pre-generated record in the cache database corresponding to the different levels, the pre-generated retrieval results cached by the cache database corresponding to the different levels are returned to the user terminal;

[0060] Step S203, if there is no pre-generated record in the cache database corresponding to the different levels, the vector semantic retrieval and the keyword accurate retrieval are performed in parallel in the knowledge base corresponding to the level based on the retrieval instructions corresponding to the different levels, the different levels of retrieval results corresponding to the different levels of knowledge bases are obtained, the different levels of retrieval results are de-duplicated and comprehensively sorted, and the LIM model is used to generate a natural language answer matched with the current page information.

[0061] It should be noted that the embodiments of the present application in terms of search accuracy, with the help of browser automation tools, real-time capture Web page DOM structure, user operation path and other environmental data, the original Prompt generated by the system does not need manual input to accurately map the business scenario, combined with the three-level search instruction of the hierarchical Prompt library (including enterprise-level knowledge base / project shared knowledge base / user personal knowledge base), the semantic correlation degree of the search results and the current operation of the user is improved, solving the low correlation degree caused by the deviation of manual input in traditional RAG, significantly reducing the interference of irrelevant information.

[0062] In terms of response efficiency, the two-stage LLM collaborative architecture pre-cleanses noise and optimizes search instructions through the LowLLM model (lightweight model), reduces the computational load of the main LLM model, and reduces response delay; the cache mechanism of the hierarchical PromptGraph library (different levels of cache database) further improves the real-time request response speed, solving the delay problem caused by repeated calling of the LLM model in traditional RAG.

[0063] In terms of balancing individualization and universality, the three-level library collaborative mechanism meets the enterprise standardization needs through the enterprise-level knowledge base, adapts to project collaboration scenarios through the project shared knowledge base, and covers user individualization habits through the user personal knowledge base, avoiding the pain points of universality and individualization conflict of single library RAG, and through fine-grained permission control (such as AES-256 encryption of user personal knowledge base), data security is guaranteed, and the search result adaptation degree of different role users (such as managers and employees) is improved.

[0064] In terms of engineering adaptation capability, the automatic Prompt generation and dynamic maintenance mechanism shortens the Prompt adaptation period of new business scenarios from weeks to hours, combined with vector and keyword hybrid search and four-dimensional solid indexing, greatly reducing the deployment and maintenance cost of enterprise-level systems, providing efficient, accurate and secure technical support for intelligent assistance of ERP, CRM and other complex business systems.

[0065] Based on the same inventive concept, the embodiments of the present application also provide a RAG technology-based enterprise question and answer enhancement device for implementing the above-mentioned RAG technology-based enterprise question and answer enhancement method. The implementation scheme of the device for solving the problem is similar to the implementation scheme described in the above method, so the specific limitations in one or more RAG technology-based enterprise question and answer enhancement device embodiments provided below can refer to the limitations of the RAG technology-based enterprise question and answer enhancement method in the above, which will not be repeated here.

[0066] In one exemplary embodiment, as Figure 2As shown, an enterprise question answering enhancement device based on RAG technology is provided, and the enterprise question answering enhancement device 200 based on RAG technology comprises a response generation module 201, an instruction generation module 202, a retrieval generation module 203, and a result generation module 204, wherein:

[0067] The response generation module 201 is configured to acquire current page data in response to a trigger instruction, and generate an original environment feature vector;

[0068] The instruction generation module 202 is configured to generate different-level retrieval instructions corresponding to different-level knowledge bases based on the original environment feature vector;

[0069] The retrieval generation module 203 is configured to perform vector semantic retrieval and keyword exact retrieval in parallel in the corresponding-level knowledge base based on the different-level retrieval instructions, to obtain different-level retrieval results corresponding to the different-level knowledge bases;

[0070] The result generation module 204 is configured to perform deduplication and comprehensive sorting on the different-level retrieval results, and generate a natural language answer matching the current page information by using a LIM model.

[0071] As an optional implementation, the enterprise question answering enhancement device 200 based on RAG technology further comprises a cache module, which is configured to determine whether there is a pre-generated record in a cache database corresponding to a query based on the different-level retrieval instructions; if there is a pre-generated record in the cache database corresponding to the query, return the pre-generated retrieval result cached by the cache database to the user terminal; if there is no pre-generated record in the cache database corresponding to the query, perform vector semantic retrieval and keyword exact retrieval in parallel in the corresponding-level knowledge base based on the different-level retrieval instructions, to obtain different-level retrieval results corresponding to the different-level knowledge bases; perform deduplication and comprehensive sorting on the different-level retrieval results, and generate a natural language answer matching the current page information by using a LIM model.

[0072] As an optional implementation, the response generation module 201 is specifically configured to monitor a DOM tree of a current page in response to a trigger instruction input by a user terminal, capture an element state and a user operation path of the current page, and generate an original environment feature vector; the original environment feature vector comprises a page structure feature, a business data feature, a user interaction feature, a permission and role feature.

[0073] As an optional implementation, the instruction generation module 202 is specifically configured to parse the original environment feature vector into a public library retrieval instruction, a shared library retrieval instruction, and a private library retrieval instruction based on a domain ontology library; the public library retrieval instruction corresponds to an enterprise-level knowledge base, the shared library retrieval instruction corresponds to a project shared knowledge base, and the private library retrieval instruction corresponds to a user personal knowledge base.

[0074] As an optional implementation, the enterprise question answering enhancement device 200 based on the RAG technology further comprises an optimization module, which is configured to perform noise purification, intent decoupling and term alignment on the public library retrieval instruction, the shared library retrieval instruction and the private library retrieval instruction based on the LowLLM model, and generate an optimized public library retrieval instruction, an optimized shared library retrieval instruction and an optimized private library retrieval instruction.

[0075] As an optional implementation, the retrieval generation module 203 is specifically configured to perform vector semantic retrieval and keyword exact retrieval on the enterprise-level knowledge base based on the optimized public library retrieval instruction, and preliminarily fuse the results of the vector semantic retrieval and the keyword exact retrieval to generate a public library retrieval result corresponding to the enterprise-level knowledge base; perform vector semantic retrieval and keyword exact retrieval on the project shared knowledge base based on the optimized shared library retrieval instruction, and preliminarily fuse the results of the vector semantic retrieval and the keyword exact retrieval to generate a shared library retrieval result corresponding to the project shared knowledge base; and perform vector semantic retrieval and keyword exact retrieval on the user personal knowledge base based on the optimized private library retrieval instruction, and preliminarily fuse the results of the vector semantic retrieval and the keyword exact retrieval to generate a private library retrieval result corresponding to the user personal knowledge base.

[0076] In this implementation, the current page data is obtained in response to the trigger instruction to generate the original environment feature vector, which can accurately map the business scenario without manual input, thereby solving the defect that it is difficult to capture the implicit demand in the dynamic operation environment due to excessive dependence on user manual input of context information in the prior art. The original environment feature vector is used to generate different levels of retrieval instructions corresponding to different levels of knowledge bases, which can effectively improve the semantic correlation between the retrieval result and the current operation of the user. The vector semantic retrieval and the keyword exact retrieval are performed in parallel in the corresponding level of the knowledge base through the different levels of retrieval instructions to obtain different levels of retrieval results corresponding to different levels of knowledge bases, which can not only solve the defect of conflict between universality and individualization caused by single knowledge base retrieval, effectively expand the retrieval range and improve the accuracy of retrieval, but also improve the retrieval efficiency on the basis of improving the accuracy of retrieval. The different levels of retrieval results are de-duplicated and comprehensively sorted, and the LLM model is used to generate a natural language answer matched with the current page information, which can further improve the accuracy of the retrieval result.

[0077] In an exemplary embodiment, a computer device, which can be a server or a terminal, is provided, and an internal structure diagram of the computer device can be as shown in Figure 3As shown in the figure. The computer device includes a processor, a memory, an Input / Output (I / O) interface and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store enterprise question and answer enhancement data based on RAG technology. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement a RAG technology-based enterprise question and answer enhancement method.

[0078] Those skilled in the art can understand that, Figure 3 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0079] In an exemplary embodiment, a computer device is also provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in each of the method embodiments described above.

[0080] In an exemplary embodiment, a computer readable storage medium is provided, storing a computer program, which is executed by a processor to implement the steps in each of the method embodiments described above.

[0081] In an exemplary embodiment, a computer program product is provided, including a computer program, which is executed by a processor to implement the steps in each of the method embodiments described above.

[0082] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.

[0083] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0084] The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a blockchain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0085] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.

[0086] The principles and implementation modes of the present application are described by applying specific examples herein. The above description of the embodiments is only used to help understand the method and its core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range can be changed. In conclusion, the content of the present application should not be understood as a limitation.

Claims

1. A method for enhancing enterprise question answering based on RAG technology, characterized in that, The enterprise question-answering enhancement method based on RAG technology includes: The system monitors the DOM tree of the current page in response to trigger commands input from the user terminal, captures the element states of the current page and the user's operation path, and generates an original environment feature vector. The original environment feature vector includes page structure features, business data features, user interaction features, and permission and role features. Based on the original environmental feature vector, different retrieval instructions corresponding to different levels of knowledge base are generated; Based on the search instructions at different levels, vector semantic search and keyword precision search are performed in parallel in the knowledge base at the corresponding level to obtain search results at different levels corresponding to the knowledge base at different levels. The search results at different levels are deduplicated and sorted, and a natural language response matching the current page information is generated using the LIM model. The step of generating different level retrieval instructions corresponding to different levels of knowledge base based on the original environmental feature vector includes: Based on the domain ontology, the original environmental feature vector is parsed into public library retrieval instructions, shared library retrieval instructions, and private library retrieval instructions; the public library retrieval instructions correspond to enterprise-level knowledge bases, the shared library retrieval instructions correspond to project-shared knowledge bases, and the private library retrieval instructions correspond to user-specific knowledge bases.

2. The enterprise question-answering enhancement method based on RAG technology according to claim 1, characterized in that, The method further includes: Based on the different level retrieval instructions, query the cache database at different levels to see if there are any pre-generated records; If pre-generated records exist in different levels of cache databases, the pre-generated retrieval results cached in different levels of cache databases are returned to the user terminal. If no pre-generated records exist in the cache databases at different levels, then based on the retrieval instructions at different levels, vector semantic retrieval and keyword precision retrieval are performed in parallel in the knowledge base at the corresponding level to obtain retrieval results at different levels corresponding to the knowledge bases at different levels; the retrieval results at different levels are deduplicated and comprehensively sorted, and a natural language answer matching the information on the current page is generated using the LIM model.

3. The enterprise question-answering enhancement method based on RAG technology according to claim 1, characterized in that, After generating different level retrieval instructions corresponding to different levels of knowledge base based on the original environmental feature vector, the method further includes: Based on the LowLLM model, noise reduction, intent decoupling, and terminology alignment are performed on the public library retrieval instructions, the shared library retrieval instructions, and the private library retrieval instructions to generate optimized public library retrieval instructions, optimized shared library retrieval instructions, and optimized private library retrieval instructions.

4. The enterprise question-answering enhancement method based on RAG technology according to claim 3, characterized in that, The search instructions based on the different levels perform vector semantic search and keyword precision search in parallel within the corresponding level of the knowledge base, obtaining search results for different levels of the knowledge base, including: Based on the optimized public library retrieval instructions, vector semantic retrieval and keyword precise retrieval are performed on the enterprise-level knowledge base, and the results of vector semantic retrieval and keyword precise retrieval are initially fused to generate public library retrieval results corresponding to the enterprise-level knowledge base. Based on the optimized shared library retrieval instructions, vector semantic retrieval and keyword precise retrieval are performed on the project shared knowledge base, and the results of vector semantic retrieval and keyword precise retrieval are initially fused to generate shared library retrieval results corresponding to the project shared knowledge base; Based on the optimized private library retrieval instructions, vector semantic retrieval and keyword precision retrieval are performed on the user's personal knowledge base. The results of vector semantic retrieval and keyword precision retrieval are then initially fused to generate private library retrieval results corresponding to the user's personal knowledge base.

5. An enterprise question-answering enhancement device based on RAG technology, characterized in that, The RAG-based enterprise question-answering enhancement device includes: The response generation module is used to monitor the DOM tree of the current page in response to the trigger command input by the user terminal, capture the element state of the current page and the user operation path, and generate the original environment feature vector; the original environment feature vector includes page structure features, business data features, user interaction features, and permission and role features. The instruction generation module is used to generate different level retrieval instructions corresponding to different levels of knowledge bases based on the original environment feature vector; specifically, it is used to parse the original environment feature vector into public library retrieval instructions, shared library retrieval instructions, and private library retrieval instructions based on the domain ontology library; the public library retrieval instructions correspond to enterprise-level knowledge bases, the shared library retrieval instructions correspond to project shared knowledge bases, and the private library retrieval instructions correspond to user personal knowledge bases; The retrieval generation module is used to perform vector semantic retrieval and keyword precise retrieval in parallel in the knowledge base of the corresponding level based on the retrieval instructions of the different levels, so as to obtain different level retrieval results corresponding to different levels of knowledge base; The results generation module is used to deduplicate and sort the search results at different levels, and use the LIM model to generate natural language answers that match the information on the current page.

6. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of the enterprise question-answering enhancement method based on RAG technology as described in any one of claims 1-4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the enterprise question-answering enhancement method based on RAG technology as described in any one of claims 1-4.

8. 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 enterprise question-answering enhancement method based on RAG technology as described in any one of claims 1-4.

Citation Information

Patent Citations

  • RAG-based multi-source heterogeneous data fusion system

    CN120450024A

  • Token optimization in generative large language model learning (LLM) interactions

    US20250238616A1