Requirement document intelligent agent implementation method based on GraphRAG knowledge graph retrieval enhancement

By combining GraphRAG knowledge graphs with large models, the problem of parsing accuracy in enterprise-level requirements documents was solved. This approach enabled efficient fusion of structured and unstructured data and multi-dimensional information mining, thereby improving the parsing accuracy and recall rate of requirements documents.

CN121009876APending Publication Date: 2025-11-25FUJIAN NEWLAND SOFTWARE ENGINEERING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510935376.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-08
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

Existing document question-answering systems suffer from problems such as insufficient semantic understanding, complex and varied structures, inconsistent formats, and deep mixing of structured and unstructured content when processing enterprise-level requirement documents, resulting in low parsing accuracy and recall rate.

Method used

By constructing an agent based on the GraphRAG knowledge graph, using rules and Few-shot learning to extract triples from tables and unstructured documents, combining them with a large model to generate pre-answers, and achieving accurate parsing of requirement documents through multi-directional retrieval and weight optimization rearrangement.

Benefits of technology

It improves the accuracy and recall of parsing requirement documents, can efficiently integrate structured and unstructured data, quickly locate the content needed by users, output high-quality answers, and significantly improve work efficiency and system capability reusability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121009876A_ABST
    Figure CN121009876A_ABST
Patent Text Reader

Abstract

The invention provides a GraphRAG knowledge graph retrieval enhancement-based demand document intelligent agent implementation method in the technical field of intelligent questions and answers and knowledge management, and the method comprises the following steps: S1, obtaining a large number of historical demand documents, and analyzing each historical demand document to construct a knowledge graph and a vector database; s2, acquiring an input demand document query request, and based on the demand document query request, guiding a pre-trained large model to generate a pre-answer in combination with the knowledge graph; s3, performing multidirectional retrieval based on the demand document query request and the pre-answer to obtain initial retrieval results, and rearranging and filtering the initial retrieval results to obtain a carefully selected retrieval result; and S4, inputting the selected retrieval result and the demand document query request into the large model, and outputting a formal answer. The method has the advantage that the analysis accuracy of the demand document is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent question answering and knowledge management, and particularly discloses a demand document intelligent agent implementation method based on GraphRAG knowledge graph retrieval enhancement. BACKGROUND

[0002] In the development process of a software product, a demand document is a core carrier for demand communication and system design. Efficient management and utilization of the demand document play a key role in improving development efficiency, promoting capability reuse, and ensuring system design quality. In the face of a large number of accumulated historical demand documents (usually hundreds to thousands of documents), product managers and developers urgently need a technical means that can quickly and accurately obtain related demand content, upstream and downstream dependency relationships, and reusable capability modules through natural language questioning.

[0003] To this end, the industry is exploring an artificial intelligence (AI)-based document question answering system to address technical challenges such as accurate information extraction from demand documents, deep understanding of document semantics, and automatic question answering. The current implementation of the document question answering system mainly includes the following three types:

[0004] The first type is a method based on keyword matching or full-text retrieval.

[0005] This method relies on the inverted index technology to locate the target document or paragraph through matching of text keywords. Its advantage is convenient deployment and rapid response. However, this method lacks semantic understanding ability, and when faced with user natural language expression diversity (such as synonyms, entity transformations, complex sentence patterns, etc.), it is prone to matching failure or mis-matching problems, making it difficult to guarantee recall rate and accuracy.

[0006] The second type is a method based on semantic vector retrieval and large model generation (Retrieval-Augmented Generation, RAG).

[0007] This method encodes user questions and document segments into high-dimensional semantic vectors, retrieves relevant document segments through vector space similarity calculation, and uses a large language model (Large Language Model, LLM) to generate the final answer. This method has shown certain effectiveness in handling encyclopedias, financial reports, legal regulations, and other general texts, but in the context of enterprise-level demand documents, due to the presence of a large number of structured tables, entities within specific numbering systems, and domain-specific business terminology in demand documents, semantic vector expression often deviates, leading to incomplete retrieval results or low relevance.

[0008] The third type is a method based on a knowledge graph (Knowledge Graph, KG).

[0009] The method constructs a knowledge graph based on triples by extracting entities, attributes and relations from the document, and the question and answer process relies on structured query language (such as SPARQL) for accurate retrieval. The advantage of this method is that the answer is highly interpretable and has traceability. However, the process of constructing the knowledge graph usually relies heavily on manual annotation rules or specific domain corpus training, making it difficult to effectively deal with the complex and variable structure, non-uniform format, and deep mixing of structured and unstructured content in actual demand documents. In addition, this method has limitations in integrating the semantic understanding and generation capabilities of large language models.

[0010] In summary, the existing various document question and answer technologies have significant shortcomings in processing complex demand documents of enterprises. Therefore, how to provide a demand document intelligent agent implementation method based on GraphRAG knowledge graph retrieval enhancement to improve the accuracy of demand document parsing has become a technical problem to be solved. SUMMARY

[0011] The technical problem to be solved by the present application is to provide a demand document intelligent agent implementation method based on GraphRAG knowledge graph retrieval enhancement to improve the accuracy of demand document parsing.

[0012] The present application is implemented as follows: a demand document intelligent agent implementation method based on GraphRAG knowledge graph retrieval enhancement, comprising the following steps:

[0013] Step S1, a large number of historical demand documents are obtained, and each of the historical demand documents is parsed to construct a knowledge graph and a vector database;

[0014] Step S2, an input demand document query request is obtained, and a pre-answer is generated based on the demand document query request and combined with the knowledge graph guided pre-training of a large model;

[0015] Step S3, based on the demand document query request and the pre-answer, multi-directional retrieval is performed to obtain initial retrieval results, each of the initial retrieval results is rearranged and filtered, and selected retrieval results are obtained;

[0016] Step S4, the selected retrieval results and the demand document query request are input into a large model, and a formal answer is output.

[0017] Further, in step S1, the parsing of each of the historical demand documents to construct a knowledge graph is specifically:

[0018] For the historical requirement documents of the table type, knowledge triples are extracted from each of the historical requirement documents based on preset cell merging processing rules and entity column determination rules; for the historical requirement documents of the non-table type, a pre-trained large language model is combined with a few-shot learning strategy to understand and reason the historical requirement documents to extract knowledge triples;

[0019] Each of the knowledge triples is subjected to knowledge fusion including at least entity alignment and relationship mapping, and a knowledge graph is constructed based on each of the fused knowledge triples.

[0020] Further, the step S1 further comprises:

[0021] Based on the requirement numbers of each of the historical requirement documents, the relationships of each entity of the knowledge graph are updated.

[0022] Further, in the step S1, the parsing of each of the historical requirement documents to construct a vector database is specifically:

[0023] The vector database is created, each of the historical requirement documents is parsed and split to obtain a plurality of text blocks, and each of the text blocks is stored in the vector database.

[0024] Further, the step S2 is specifically:

[0025] An input requirement document query request is obtained, a set of keywords is extracted from the requirement document query request through natural language processing technology, similar entities and entity relationships of the similar entities are retrieved from the knowledge graph based on the set of keywords, and first-level neighbor entities are obtained by expanding the retrieval of the similar entities based on the entity relationships;

[0026] The cosine similarity of each of the first-level neighbor entities and each of the keywords in the set of keywords is calculated, and each of the first-level neighbor entities is screened based on the cosine similarity;

[0027] The set of keywords, the similar entities, the entity relationships, the first-level neighbor entities, and the requirement document query request are assembled into a prompt template, and a plurality of pre-answers are generated by a pre-trained large model through the prompt template.

[0028] Further, in the step S3, the multi-directional retrieval based on the requirement document query request and the pre-answers to obtain an initial retrieval result is specifically:

[0029] New keywords are extracted from the requirement document query request and the pre-answers, the new keywords, the requirement document query request, and the pre-answers are vectorized to obtain keyword vectors, request vectors, and answer vectors;

[0030] The knowledge graph is searched in multiple directions through the keyword vector, the vector database is searched in multiple directions through the request vector and the answer vector, and initial search results are obtained.

[0031] Further, in the step S3, the initial search results are rearranged and filtered to obtain selected search results.

[0032] The structural anchor strength, keyword definiteness and ambiguity of the requirement document query request are calculated, and the structural channel weight and semantic channel weight are calculated based on the structural anchor strength, keyword definiteness and ambiguity.

[0033] The semantic similarity score, keyword matching score and structural path score of each initial search result are calculated, the comprehensive score is calculated based on the semantic similarity score, keyword matching score, structural path score, structural channel weight and semantic channel weight, and the initial search results are rearranged and filtered based on the comprehensive score to obtain selected search results.

[0034] The advantages of the present application are:

[0035] 1. A large number of historical requirement documents are obtained, each historical requirement document is parsed to construct a knowledge graph and a vector database, then an input requirement document query request is obtained, a pre-answer is generated based on the requirement document query request and a pre-trained large model guided by the knowledge graph, the initial search results are obtained by multi-directional retrieval based on the requirement document query request and the pre-answer, the initial search results are rearranged and filtered to obtain selected search results, and finally the selected search results and the requirement document query request are input into the large model to output the formal answer; that is, firstly, the rules and Few-shot learning are used to extract the triples of tables and unstructured documents according to different types, and a precise knowledge graph is automatically constructed to capture the requirement number system, entity dependency and other key structures in the requirement document; then in the retrieval stage, the knowledge graph entity relationship is used to expand the query semantics (such as first-level neighbor entities), the pre-answer is dynamically corrected through multi-round vectorization retrieval, and the rearrangement is optimized based on the structural anchor strength and semantic ambiguity weight; finally, the structured constraint of the knowledge graph and the contextual understanding of the large model are complementary, effectively solving the analysis deviation of traditional methods for complex tables, domain terms and mixed content, realizing the accurate positioning of deep dependency relationship and reuse module in the requirement document, and greatly improving the accuracy of requirement document analysis.

[0036] 2. The innovative knowledge graph construction method realizes efficient fusion of structured data and unstructured data, accurately represents the knowledge of the requirement document, and provides a solid foundation for question answering; the enhanced retrieval mechanism based on LLM pre-answer, multi-dimensional mining of knowledge base information, significantly improves the accuracy and recall rate of retrieval, quickly locates the content required by the user; the retrieval rearrangement and filtering mechanism for different problem types, through the score calculation model (calculate the comprehensive score), fully consider various practical factors, can more flexibly and accurately respond to various user problems, output high-quality answers, and greatly improve work efficiency and system capability reuse. BRIEF DESCRIPTION OF DRAWINGS

[0037] The application will be further described below with reference to the accompanying drawings and embodiments.

[0038] Figure 1 is a flowchart of a requirement document intelligent agent implementation method based on GraphRAG knowledge graph retrieval enhancement of the application. DETAILED DESCRIPTION

[0039] The technical solution in the embodiment of the application has the following general idea: first, use rules and Few-shot learning to extract triples from tables and unstructured documents by type, automatically construct an accurate knowledge graph to capture the requirement number system, entity dependency and other key structures in the requirement document; then, in the retrieval stage, expand the query semantics based on the entity relationship of the knowledge graph, dynamically correct the pre-answer through multiple rounds of vectorization retrieval, and jointly optimize the rearrangement based on the structure anchor strength and the semantic ambiguity weight; finally, the structured constraints of the knowledge graph and the context understanding of the large model are complementary, effectively solving the analysis deviation of traditional methods for complex tables, domain terminology and mixed content, realizing the accurate positioning of deep dependency relationships and reusable modules in the requirement document, and improving the accuracy of requirement document analysis.

[0040] Please refer to Figure 1 The preferred embodiment of the requirement document intelligent agent implementation method based on GraphRAG knowledge graph retrieval enhancement of the application is shown in the figure, which includes the following steps:

[0041] Step S1, a large number of historical requirement documents are obtained, and each of the historical requirement documents is parsed to construct a knowledge graph and a vector database;

[0042] Step S2, an input requirement document query request is obtained, and based on the requirement document query request, a pre-trained large model is guided to generate a pre-answer in combination with the knowledge graph;

[0043] Step S3, multi-directional retrieval is performed based on the requirement document query request and the pre-answer to obtain initial retrieval results, each of the initial retrieval results is rearranged and filtered to obtain selected retrieval results;

[0044] Step S4, input the selected search results and the demand document query request into the large model, and output the formal answer.

[0045] The present application is divided into two stages, the first stage is knowledge base construction, and the second stage is query and answer. In the knowledge base construction stage, first, the demand document is parsed, and the structures such as tables, paragraphs, titles in the demand document are identified and segmented. Secondly, a knowledge graph and a vector database are constructed respectively, the knowledge graph stores the triples extracted from the demand document, and the vector database stores the text blocks after the demand document is parsed and segmented. In the query and answer stage, first, the knowledge graph and the prompting project are combined to guide the large model to generate the pre-answer of the demand document query request. Secondly, based on the demand document query request and the pre-answer, multi-directional retrieval is carried out, and then the selected search results and the demand document query request are input into the large model to generate the final formal answer. The present application improves in the aspects of knowledge graph construction, enhanced retrieval, retrieval rearrangement and filtering.

[0046] In the step S1, the parsing of each of the historical demand documents to construct a knowledge graph is specifically:

[0047] For the historical demand documents of the table type, knowledge triples are extracted from each of the historical demand documents based on preset cell merging processing rules and entity column determination rules; for the historical demand documents of the non-table type, a pre-trained large language model is used to understand and reason the historical demand documents to extract knowledge triples by combining a few-shot learning strategy;

[0048] For a table T with m rows and n columns, denoted as T=(t ij ), where i=1, 2, …, m, j=1, 2, …, n. First, determine the entity column in the table: starting from the first column, for the jth column, let the marking function of the cell merging condition be M(j), when there is no cell merging, M(j)=0, and when there is merging, M(j)=1; let the cell content repetition judgment function be R(j), if the content of each row in the jth column is not repeated, R(j)=0, and if there is repetition, R(j)=1. When M(j)=0 and R(j)=0 are satisfied, the jth column is determined as the entity column, denoted as j entity .

[0049] In the processing of the cell merging condition, for the column with merged cells, the content of the merged cells is expanded to all the cells covered by the merged cells. Let the merged cell region be [i1:i2,j] (representing the jth column from the i1th row to the i2th row), and its content be c, then t ij =c, where i=i1, i1+1, …, i2.

[0050] After determining the entity column, the value of the entity column is taken as an entity, the column name of other columns is taken as a relation, and the value of other columns is taken as an attribute value to perform triple extraction. Let the column name set of the table be C = {c1, c2, …, c n}, for any column j other than the entity column other , and the i-th row data in the table, the extracted triple is In this way, the structured data in the table can be efficiently converted into knowledge triples meeting the requirements of knowledge graph construction.

[0051] For the historical demand documents of the non-table type, a small amount of representative text segments are first selected from the historical demand documents as examples, and entities, relations and attributes are explicitly labeled for these examples to form a small amount of labeled samples; these entities cover various key objects in the demand document, such as function modules, technical indicators, user roles, etc.; the relations represent the connections between entities, such as “dependence”, “containment”, “association”, etc.; and the attributes are used to describe the characteristics and states of the entities. Secondly, the unstructured text is split into text blocks to obtain a text sequence S = {s1, s2, …, s k}; then a prompt word template is constructed, the labeled samples and the text sequence are input into a large language model, and the entities, relations and attributes in the text are extracted in parallel.

[0052] The knowledge fusion of each knowledge triple includes at least entity alignment and relation mapping, and a knowledge graph is constructed based on the fused knowledge triples.

[0053] The step S1 further includes:

[0054] Based on the demand numbers of each historical demand document, the relations of each entity of the knowledge graph are updated.

[0055] In order to answer the questions based on the demand numbers, the entities mined in the same demand document are all associated with the demand numbers to create an association edge (relation), which effectively solves the shortcomings of traditional methods in data processing and significantly improves the efficiency and accuracy of knowledge graph construction, thereby providing a solid knowledge foundation for subsequent demand document question answering based on the knowledge graph.

[0056] In the step S1, the parsing of each historical demand document to construct a vector database is specifically:

[0057] A vector database is created, and each historical demand document is parsed and split to obtain a plurality of text blocks, and each text block is stored in the vector database.

[0058] The step S2 is specifically:

[0059] obtaining an input requirement document query request, extracting a keyword set from the requirement document query request through natural language processing technology, retrieving similar entities and entity relationships of the similar entities from a knowledge graph based on the keyword set, and performing extended retrieval on the similar entities based on the entity relationships to obtain first neighbor entities;

[0060] calculating the cosine similarity of each first neighbor entity and each keyword in the keyword set, and screening each first neighbor entity based on the cosine similarity; the calculation formula of the cosine similarity is:

[0061]

[0062] wherein Sim() represents a cosine similarity function; E neighbor represents a first neighbor entity; k i represents the i-th keyword in the keyword set;

[0063] Assembling a prompt template based on the keyword set, the similar entities, the entity relationships, the first neighbor entities and the requirement document query request, and guiding a pre-trained large model to generate a plurality of pre-answers through the prompt template. The formula of the prompt template is:

[0064] T = {E, R, E neighbor , K, Q} ;

[0065] wherein T represents a prompt template; E represents a similar entity; R represents an entity relationship; E neighbor represents a first neighbor entity; K represents a keyword set; and Q represents a requirement document query request.

[0066] The existing RAG method relies on a vector database to recall the original query, however, for complex queries with ambiguous semantics, short texts, and containing fuzzy references, vector matching often cannot accurately recall relevant paragraphs or knowledge points, resulting in inaccurate answers. In addition, the knowledge graph may contain indirect or implicit relationship chains, which are difficult to trigger through the user's original question. Therefore, the present application designs a "pre-answer + extended retrieval" mechanism based on a large model, which generates possible pre-answers using LLM, and extracts keywords in reverse for multi-round extended retrieval, not only covering potential entity relationships in the graph, but also enhancing the recall ability of deep meanings in text paragraphs.

[0067] In the step S3, the multi-directional retrieval based on the requirement document query request and the pre-answer to obtain the initial retrieval result is specifically:

[0068] extracting new keywords from the requirement document query request and the pre-answer, vectorizing the new keywords, the requirement document query request and the pre-answer to obtain keyword vectors, request vectors and answer vectors;

[0069] The knowledge graph is searched in multiple directions through the keyword vector, and the vector database is searched in multiple directions through the request vector and the answer vector, to obtain initial search results.

[0070] In the requirement document-oriented question answering system, the types of user questions are significantly different. Some questions have clear structural anchors (such as "REQ20240123 involves which modules"), and the system is expected to return structure-related entities around a certain number; another part of the question is biased towards semantic generalization (such as "which requirements involve permission management"), and relies on language expression and vector matching for reasoning and recall. The existing question answering system often uses fixed ranking weights to fuse structure and semantic information, ignoring the differences in anchor point, explicitness, and fuzziness of different questions, resulting in inaccurate recall results and unreasonable ranking for some questions. Therefore, the present application proposes a reordering mechanism combining question type recognition, structural path analysis, and rule-driven dynamic weighting, to improve the adaptability and accuracy of answering different questions.

[0071] In the step S3, the initial search results are rearranged and filtered to obtain selected search results, specifically:

[0072] The structural anchor strength, keyword explicitness, and fuzziness of the requirement document query request are calculated, and the structural channel weight and the semantic channel weight are calculated based on the structural anchor strength, the keyword explicitness, and the fuzziness.

[0073] The definition of the structural anchor strength is:

[0074]

[0075] The definition of the keyword explicitness is:

[0076]

[0077] The definition of the fuzziness is:

[0078]

[0079] Among them, the strong directional keywords are "belongs to", "contains", "module", etc.; the fuzzy words are "whether", "what", "related", etc.

[0080] The calculation formula of the structural channel weight is:

[0081]

[0082] The calculation formula of the semantic channel weight is: 1-alpha.

[0083] The semantic similarity score, the keyword matching score and the structure path score of each initial search result are calculated, the comprehensive score is calculated based on the semantic similarity score, the keyword matching score, the structure path score, the structure channel weight and the semantic channel weight, the initial search results are reordered and filtered based on the comprehensive score, and the selected search results are obtained.

[0084] The calculation formula of the semantic similarity score, the keyword matching score and the structure path score is respectively:

[0085]

[0086] Wherein, n represents the path quantity; p is included in P(e Q →e i ) represents the atlas path set; len(p) represents the path length; Deg(e i ) represents the out-degree of the candidate entity in the atlas.

[0087] The calculation formula of the comprehensive score is:

[0088]

[0089] In summary, the advantages of the present application are:

[0090] 1. A large number of historical demand documents are acquired, each historical demand document is parsed to construct a knowledge graph and a vector database; then an input demand document query request is acquired, a pre-answer is generated based on the demand document query request and guided by the pre-training large model based on the knowledge graph, the initial search results are obtained by multi-directional retrieval based on the demand document query request and the pre-answer, the selected search results are obtained by reordering and filtering each initial search result, and finally the selected search results and the demand document query request are input into the large model to output the formal answer; that is, firstly, the triples of the table and the unstructured document are extracted by using the rules and Few-shot learning, the precise knowledge graph is automatically constructed to capture the demand number system, entity dependency and other key structures in the demand document; then in the retrieval stage, the knowledge graph entity relationship is used to expand the query semantics (such as first-level neighbor entity), the pre-answer is dynamically corrected by multi-round vectorization retrieval, and the reordering is optimized based on the structure anchor strength and the semantic ambiguity weight; finally, the structured constraint of the knowledge graph and the context understanding of the large model are complementary, the analysis deviation of the traditional method to the complex table, the field term and the mixed content is effectively solved, the precise positioning of the deep dependency relationship and the reuse module in the demand document is realized, and the accuracy of the demand document analysis is greatly improved.

[0091] 2. Through the innovative knowledge graph construction method, efficient fusion of structured data and unstructured data is realized, the knowledge of the demand document is completely and accurately represented, a solid foundation is provided for the question and answer; based on the enhanced retrieval mechanism of LLM pre-answer, the information of the knowledge base is mined in multiple dimensions, the precision and recall rate of the retrieval are significantly improved, and the required content of the user is quickly positioned; the retrieval rearrangement and filtering mechanism for different problem types, through the score calculation model (calculate the comprehensive score), fully consider various practical factors, can more flexibly and accurately respond to various user problems, output high-quality answers, and greatly improve the work efficiency and system capability reuse degree.

[0092] Although the specific embodiments of the present application are described above, those skilled in the art should understand that the specific examples described are only illustrative, and are not intended to limit the scope of the present application, and equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present application should be covered within the scope of the claims of the present application.

Claims

1. A method for implementing a demand document intelligent agent based on GraphRAG knowledge graph retrieval enhancement, characterized in that: Comprising the following steps: ​ Step S1, obtaining a large number of historical demand documents, parsing each of the historical demand documents to construct a knowledge graph and a vector database; Step S2, obtaining an input demand document query request, based on the demand document query request, combining the knowledge graph to guide the pre-training of the large model to generate a pre-answer; Step S3, based on the demand document query request and the pre-answer, performing multi-directional retrieval to obtain initial retrieval results, rearranging and filtering each of the initial retrieval results to obtain selected retrieval results; Step S4, inputting the selected retrieval results and the demand document query request into the large model to output a formal answer.

2. The method of claim 1, wherein the method is based on a GraphRAG knowledge graph retrieval enhanced requirement document agent implementation method. In the step S1, the parsing of each of the historical demand documents to construct a knowledge graph specifically comprises: For the historical demand documents of the table type, based on the preset cell merging processing rules and entity column determination rules, knowledge triples are extracted from each of the historical demand documents; for the historical demand documents of the non-table type, through the pre-training of the large language model combined with the few-shot learning strategy, the historical demand documents are understood and reasoned to extract knowledge triples; Each of the knowledge triples is subjected to knowledge fusion including at least entity alignment and relationship mapping, and a knowledge graph is constructed based on each of the fused knowledge triples.

3. The method of claim 1, wherein the method is based on a GraphRAG knowledge graph retrieval enhanced requirement document agent implementation method. The step S1 further comprises: Based on the demand number of each of the historical demand documents, updating the relationship of each entity of the knowledge graph.

4. The method of claim 1, wherein the method is based on a GraphRAG knowledge graph retrieval enhanced requirement document agent implementation method. In the step S1, the parsing of each of the historical demand documents to construct a vector database specifically comprises: A vector database is created, each of the historical demand documents is parsed and split to obtain a plurality of text blocks, and each of the text blocks is stored in the vector database.

5. The method of claim 1, wherein the method is based on a GraphRAG knowledge graph retrieval enhanced requirement document agent implementation method. The step S2 specifically comprises: An input demand document query request is obtained, a set of keywords is extracted from the demand document query request through natural language processing technology, similar entities and entity relationships of similar entities are retrieved from the knowledge graph based on the set of keywords, and first neighbor entities are obtained through extended retrieval of similar entities based on the entity relationships; The cosine similarity of each of the first neighbor entities and each of the keywords in the set of keywords is calculated, and each of the first neighbor entities is screened based on the cosine similarity; Based on the set of keywords, similar entities, entity relationships, first neighbor entities, and demand document query request, a prompt template is assembled, and a pre-training large model is guided to generate a plurality of pre-answers through the prompt template.

6. The method of claim 1, wherein the method is based on a GraphRAG knowledge graph retrieval enhanced requirement document agent implementation method. In the step S3, the multi-directional retrieval based on the demand document query request and the pre-answer to obtain the initial retrieval results specifically comprises: New keywords are extracted from the demand document query request and the pre-answer, and the new keywords, the demand document query request, and the pre-answer are vectorized to obtain keyword vectors, request vectors, and answer vectors; The knowledge graph is subjected to multi-directional retrieval through the keyword vectors, and the vector database is subjected to multi-directional retrieval through the request vectors and the answer vectors to obtain the initial retrieval results.

7. The method of claim 1, wherein the method is based on a GraphRAG knowledge graph retrieval enhanced requirement document agent implementation method. In the step S3, the rearrangement and filtering of each of the initial retrieval results to obtain the selected retrieval results specifically comprises: calculating structure anchor point strength, keyword explicitness and ambiguity of the requirement document query request, calculating structure channel weight and semantic channel weight based on the structure anchor point strength, keyword explicitness and ambiguity; calculating semantic similarity score, keyword matching score and structure path score of each initial retrieval result, calculating comprehensive score based on the semantic similarity score, keyword matching score, structure path score, structure channel weight and semantic channel weight, rearranging and filtering each initial retrieval result based on the comprehensive score to obtain the selected retrieval result.