Knowledge service method combining vector database and graph retrieval technology

By combining vector database and graph search technology, a knowledge network is built and a fine-tuned large language model is used to search knowledge, which solves the shortcomings of the existing system in multiple rounds of dialogue support, response time and user query optimization, and achieves efficient and accurate professional knowledge acquisition.

CN119807477APending Publication Date: 2025-04-11WUXI URBAN BLOCKCHAIN ADVANCED RES CENT +1
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411855903.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The existing knowledge retrieval system has shortcomings in multiple rounds of dialogue support, model response time and user query optimization, and cannot effectively solve the information blind spot problem, resulting in limited efficiency and accuracy of users in obtaining professional knowledge.

Method used

Combining vector database and graph retrieval technology, by collecting and cleaning data in specific fields, vectorized processing and storing it in vector database, a real-time updated knowledge network is built and stored in graph database, and a graph-rag system is built to expand user questions and match keywords. The fine-tuned large language model is used to blend the results of vector database and graph database to output professional and accurate answers.

Benefits of technology

It improves the knowledge retrieval ability of large language models in specific fields, improves the efficiency and accuracy of user information retrieval, solves the problem of information blind spots, and realizes the need to quickly and efficiently acquire professional knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807477A_ABST
    Figure CN119807477A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge service method combining a vector database and a graph retrieval technology. Comprising the following steps; the method comprises the following steps: S1, collecting internal data and external data in a specific field; s2, performing fine adjustment on the open source large language model through industry corpora in a specific field or starting to train from zero; s3, storing the vectorized data information in a vector database, and storing the knowledge network in a graph database; s4, establishing a graph-rag system which is used for carrying out more comprehensive expansion on questions of the user; s5, automatically matching nodes and edges in the knowledge network according to the extracted keywords; s6, fusing a vector result from the vector database and the knowledge network in the graph database; s7, updating and optimizing at regular intervals; according to the method, the efficiency and accuracy of user information retrieval are improved, the problem of information blind areas is solved, and the requirement of the user for quickly and efficiently obtaining professional knowledge is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence and knowledge retrieval technology, and more specifically, particularly relates to a knowledge service method combining vector database and graph retrieval technology. Background Art

[0002] In recent years, with the rapid development of artificial intelligence technology, especially the widespread application of large language models, the research and application of knowledge retrieval systems have become increasingly important. Existing knowledge retrieval methods mainly rely on traditional keyword matching technology, which usually cannot meet users' needs for in-depth information acquisition. In addition, many large language models often face the problem of knowledge blind spots when processing professional domain knowledge, that is, the model cannot give accurate or complete answers in specific fields or specific problems.

[0003] To improve this situation, vector databases and graph retrieval technologies have been introduced into knowledge retrieval systems. Vector databases can achieve more efficient similarity searches by converting information into vector form, thereby improving retrieval accuracy. Graph retrieval technology can better handle the relationship between information and provide a richer and more accurate knowledge network.

[0004] Nevertheless, the current system still has some limitations, including insufficient support for multi-round dialogue, long model response time, and insufficient optimization capabilities for user queries. Therefore, there is an urgent need for a new type of knowledge service system that can effectively combine these technologies to improve the accuracy and response speed of knowledge retrieval to meet users' needs for acquiring professional knowledge. Summary of the invention

[0005] In view of the problems existing in the prior art, the purpose of the present invention is to provide a knowledge service method that combines vector database and graph retrieval technology, which improves the efficiency and accuracy of user information retrieval by enhancing the knowledge retrieval capability of large language models in specific fields, solves the problem of information blind spots, and promotes users' needs for fast and efficient acquisition of professional knowledge.

[0006] To achieve the above-mentioned purpose, the present invention provides the following technical solutions: a knowledge service method combining vector database and graph retrieval technology, comprising the following steps;

[0007] S1. Collect internal and external data in specific fields, and clean and standardize the collected internal and external data;

[0008] S2. Collect industry corpora in specific fields, and fine-tune the open source large language model or train the large language model from scratch through the industry corpora in specific fields;

[0009] S3, vectorizing the collected internal data and external data, including text vectorization, image vectorization and graph data vectorization, storing the vectorized data information in a vector database, generating a knowledge network from the internal data and external data, and storing the knowledge network in a graph database;

[0010] S4, build the graph-rag system to expand the user's questions more comprehensively;

[0011] S5. Extract keywords from the user's questions through a large language model, and automatically match nodes and edges in the knowledge network based on the extracted keywords to achieve fast and accurate knowledge retrieval;

[0012] S6. Process the retrieved knowledge through the fine-tuned large language model, merge the vector results from the vector database and the knowledge network in the graph database, discover the potential knowledge and relationships through reasoning capabilities, and output professional and accurate answers;

[0013] S7. Ensure that the vector database is always kept up to date and accurate through regular updates and optimizations.

[0014] Specifically, the specific steps of S1 are:

[0015] S101. Select and collect domain-specific data from a variety of sources, including documents, knowledge bases, and meeting records of internal data, industry reports, open data sets, and API interface data of external data, and ensure the reliability and diversity of data sources;

[0016] S102. Extract data from multiple sources through the ETL process, clean and standardize the data, and store it in the database or data warehouse to ensure data consistency and accuracy;

[0017] S103. Use automated testing, manual review and stage verification to ensure data quality, and perform version control to ensure that the data is always up to date during the update process.

[0018] Specifically, the processing steps of data cleaning and standardization are as follows:

[0019] Data cleaning: remove duplication, process null values, and standardize formats;

[0020] Data conversion: change the data format or unit, convert field type, and convert date string to date type;

[0021] Data integration: merging data from multiple data sources into a unified format;

[0022] Data aggregation: summarize and group data for statistical operations;

[0023] Data filtering: Filter data based on business rules or conditions.

[0024] Specifically, the training steps of the open source large language model in S2 are:

[0025] S201, collect industry corpus in specific fields through various sources and perform data cleaning on the industry corpus;

[0026] S202, grouping the collected industry corpus in a specific field into a model group and a verification group;

[0027] S203, fine-tuning the open source large language model through the industry corpus in the specific field in the model group or training the large language model from scratch;

[0028] S204. The open source large language model is verified by using the industry corpus in the specific field in the verification group to verify the trained large language model. Only when the verification accuracy is above 99% can it be used to analyze the questions.

[0029] Specifically, the steps for fine-tuning or training the open source large language model from scratch in S2 are:

[0030] S211. Select an open source large language model as the basic model and fine-tune the open source large language model by collecting industry corpora in specific fields;

[0031] S212. If the open source large language model cannot be fine-tuned, train the large language model from scratch, use industry corpus in specific fields to train the open source large language model, and use a distributed computing framework to improve training efficiency;

[0032] S213. Combine supervised learning and self-supervised learning to ensure that the open source large language model achieves the expected performance in specific fields.

[0033] Specifically, the text vectorization uses a large language model to convert text data into vector representations to capture semantic information in the text;

[0034] The image vectorization uses a convolutional neural network or other visual models to convert image data into a feature vector;

[0035] The graph data vectorization converts the nodes and edges in the graph into embedded vectors, and uses a neural network to learn the embedded representation of the nodes and edges in the graph.

[0036] Specifically, the steps for setting the vector database in S3 are as follows:

[0037] S301, selecting a suitable vector database to store data in a specific field;

[0038] S302, the collected internal data and external data are vectorized, and then the vectorized text vectorization, image vectorization and graph data vectorization are stored in a vector database to support efficient similarity search;

[0039] S303, through approximate nearest neighbor search and multimodal indexing; approximate nearest neighbor search calculates similarity through vector space to achieve semantic or content-based retrieval; multimodal indexing supports joint indexing and searching of different data types such as text and images.

[0040] Specifically, the specific implementation steps of S4 are as follows:

[0041] S401. Build a graph-rag system, construct a knowledge network based on a graph database, and use nodes and edges to represent knowledge points and their relationships;

[0042] S402. By combining the graph database and the vector database, more comprehensive knowledge expansion is supported, semantic search based on the graph structure is realized, and the system's ability to answer user questions is improved;

[0043] S403. Combine real-time data streaming and batch data processing to ensure that the knowledge network remains up-to-date and continuously optimized.

[0044] Specifically, the calculation of keyword extraction by the large language model in S5 is as follows:

[0045]

[0046] Among them, TF(x i ,d) reflects the importance of a word in the data information. The more frequently it appears, the higher the TF value, x i represents the word for calculation, and d represents the word x i The number of times it appears in the data information, It is used to measure the prevalence of a word in the entire corpus. The higher the value, the less common the word is in the corpus, expressed as the total number of texts in the corpus, DF(x i ) means that it contains word x i The number of texts;

[0047] If a word appears frequently in the data information to be detected and calculated, but appears less frequently in other texts, TF(x i ,The value of d) will be very high, indicating the importance of the word to the data information that needs to be detected and calculated;

[0048] On the contrary, if the word frequency is low or the word appears in many texts, then TF(x i,The value of d) will be low, indicating that the word is not important to the data information that needs to be detected and calculated.

[0049] Specifically, the multimodal retrieval combines the characteristics of different data such as text, image and graph data. When querying, it processes multiple inputs, including text input and image input, and selects the corresponding database for retrieval according to the query mode. For text data, it uses a vector database for semantic similarity matching; for graph structure data, it uses a graph database for structured query;

[0050] And based on the structure of nodes and edges, as well as reasoning capabilities, potential knowledge and relationships are discovered, and new knowledge is derived from existing nodes during path reasoning;

[0051] By fusion, the text vector results and image vector results in the self-vector database are fused into more professional and accurate answers.

[0052] Technical effects and advantages of the present invention:

[0053] The present invention ensures the accuracy and consistency of data by integrating data in specific fields from multiple sources; uses a vector database to optimize knowledge data storage, and builds a real-time updated knowledge network through a graph database to store the collected data. The graph structure can capture the complex relationship between the data, and the vector database can efficiently process high-dimensional data. The combination of the two can simultaneously consider the similarity and structured relationship of the data, thereby improving the accuracy and diversity of retrieval; the vector database can process multimodal data such as images, texts, and audio, and graph retrieval can provide additional information for the relationship between these modalities; the combination of the two can realize multimodal retrieval and enhance the capabilities of the system; the combination of graphs and vectors can flexibly respond to different data types and complex application scenarios; at the same time, the efficient storage and retrieval capabilities of the vector database itself make the system have good scalability and adapt to the retrieval needs of large-scale data;

[0054] The large language model is used to semantically decompose user input, match nodes and edges in the knowledge network, and perform precise retrieval. Finally, the large language model is fine-tuned to enable it to have professional conversation capabilities and output professional retrieval results. This can effectively solve the application bottleneck of large models in professional fields and enhance users' knowledge retrieval experience.

[0055] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a schematic diagram of the steps provided by the present invention;

[0057] Figure 2It is a schematic diagram of the data collection process provided by the present invention;

[0058] Figure 3 It is a schematic diagram of the training process of the open source large language model provided by the present invention;

[0059] Figure 4 It is a flowchart of fine-tuning or training from scratch of an open source large language model provided by the present invention;

[0060] Figure 5 It is a schematic diagram of the setting process of the vector database provided by the present invention;

[0061] Figure 6 It is a schematic diagram of the process of building a graph-rag system provided by the present invention. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0063] like Figures 1 to 6 As shown, an embodiment of the present invention provides a knowledge service method combining a vector database and a graph retrieval technology, comprising the following steps:

[0064] S1. Collect internal and external data in specific fields, and clean and standardize the collected internal and external data;

[0065] S2. Collect industry corpora in specific fields, and fine-tune the open source large language model or train the large language model from scratch through the industry corpora in specific fields;

[0066] S3, vectorizing the collected internal data and external data, including text vectorization, image vectorization and graph data vectorization, storing the vectorized data information in a vector database, generating a knowledge network from the internal data and external data, and storing the knowledge network in a graph database;

[0067] S4, build the graph-rag system to expand the user's questions more comprehensively;

[0068] S5. Extract keywords from the user's questions through a large language model, and automatically match nodes and edges in the knowledge network based on the extracted keywords to achieve fast and accurate knowledge retrieval;

[0069] S6. Process the retrieved knowledge through the fine-tuned large language model, integrate the vector results from the vector database and the knowledge network in the graph database, and discover the potential knowledge and relationships through reasoning capabilities to output professional and accurate answers;

[0070] S7. Ensure that the vector database is always kept up to date and accurate through regular updates and optimizations.

[0071] In this embodiment, preferably, the specific steps of S1 are:

[0072] S101. Select and collect domain-specific data from a variety of sources, including documents, knowledge bases, and meeting records of internal data, industry reports, open data sets, and API interface data of external data, and ensure the reliability and diversity of data sources;

[0073] S102. Extract data from multiple sources through the ETL process, clean and standardize the data, and store it in the database or data warehouse to ensure data consistency and accuracy;

[0074] S103. Use automated testing, manual review and phased verification to ensure data quality, and perform version control to ensure that data is always up to date during the update process;

[0075] It should be noted that according to the design requirements analysis, data sources are identified, data is collected using tools such as crawlers and APIs, multi-source data processing is achieved, and data is cleaned to maintain data consistency and accuracy. For the security of data, data security is guaranteed through data encryption and access control, and rationality checks are carried out in compliance with regulations such as GDPR.

[0076] In this embodiment, preferably, the data cleaning and standardization processing steps are:

[0077] Data cleaning: remove duplication, process null values, and standardize formats;

[0078] Data conversion: change the data format or unit, convert field type, and convert date string to date type;

[0079] Data integration: merging data from multiple data sources into a unified format;

[0080] Data aggregation: summarize and group data for statistical operations;

[0081] Data filtering: Filter data based on business rules or conditions;

[0082] It should be noted that in order to maintain data consistency and accuracy, data cleaning and standardization are implemented;

[0083] The calculation of data cleaning is as follows:

[0084] The calculation of outlier detection is as follows:

[0085]

[0086] Among them, F is the outlier factor, D is the collected data information, and N j is the number of samples in the jth cluster group, d(x i ,c j ) is the data information x i The distance to the jth cluster center, and c j is the jth cluster center;

[0087] For the distance away from the cluster center, it is set to average the distance of the data information from the center position, and the data results processed by the cluster analysis algorithm are calculated:

[0088] That is Among them, c j is the jth cluster center,

[0089] If the distance of the data information is greater than 3d, it is judged as abnormal data information;

[0090] Normalization converts data to the same scale:

[0091]

[0092] Among them, X min Represented as the minimum value in the data information, X max It is represented as the maximum value in the data information, and X represents the data information.

[0093] In this embodiment, preferably, the training steps of the open source large language model in S2 are:

[0094] S201, collect industry corpus in specific fields through various sources and perform data cleaning on the industry corpus;

[0095] S202, grouping the collected industry corpus in a specific field into a model group and a verification group;

[0096] S203, fine-tuning the open source large language model through the industry corpus in the specific field in the model group or training the large language model from scratch;

[0097] S204. Verify the open source large language model through the industry corpus in the specific field in the verification group, which is used to verify the trained large language model. Only when the verification accuracy is above 99%, can it be used to analyze the questions;

[0098] It should be noted that the open source big language model is trained by collecting industry corpus in a specific field, so that the open source big language model can analyze the technical language in a specific field.

[0099] In this embodiment, preferably, the step of fine-tuning or training the open source large language model from scratch in S2 is:

[0100] S211. Select an open source large language model as the basic model and fine-tune the open source large language model by collecting industry corpora in specific fields;

[0101] S212. If the open source large language model cannot be fine-tuned, train the large language model from scratch, use industry corpus in specific fields to train the open source large language model, and use a distributed computing framework to improve training efficiency;

[0102] S213. Combine supervised learning and self-supervised learning to ensure that the performance of the open source large language model in a specific field reaches the expected effect;

[0103] It should be noted that fine-tuning training or training from scratch is selected according to the training status of the open source large language model to improve the accuracy of training, and a distributed computing framework is used to improve the training efficiency, and the open source large language model is supervised to improve the accuracy of training.

[0104] In this embodiment, preferably, the text vectorization uses a large language model to convert text data into vector representation to capture semantic information in the text;

[0105] The image vectorization uses a convolutional neural network or other visual models to convert image data into a feature vector;

[0106] The graph data vectorization converts the nodes and edges in the graph into embedded vectors, and uses a neural network to learn the embedded representation of the nodes and edges in the graph;

[0107] It should be noted that by performing vector conversion on text, images and image data, it is convenient to store text vectorization, image vectorization and graph data vectorization, so as to facilitate the storage of vector data in a vector database.

[0108] In this embodiment, preferably, the steps of setting the vector database in S3 are as follows:

[0109] S301, selecting a suitable vector database to store data in a specific field;

[0110] S302, the collected internal data and external data are vectorized, and then the vectorized text vectorization, image vectorization and graph data vectorization are stored in a vector database to support efficient similarity search;

[0111] S303, through approximate nearest neighbor search and multimodal indexing; approximate nearest neighbor search calculates similarity through vector space to achieve semantic or content-based retrieval; multimodal indexing supports joint indexing and searching of different data types such as text and images;

[0112] It should be noted that by storing vector data, it is convenient to support efficient similarity search, and multimodal indexing supports joint indexing and searching of different data types such as text and images, thereby improving the diversity of indexes;

[0113] The vector database is built based on the ANN index framework, and common implementations include FAISS and HNSW. FAISS is suitable for fast retrieval of large-scale, high-dimensional data, while HNSW has high precision and real-time update capabilities to meet the needs of dynamic data scenarios;

[0114] Before storing the data in the vector database, the system cleans and preprocesses the data, uses natural language processing (NLP) technology to clean up invalid content, and converts the text into a vector representation; for non-text data such as images and audio, specific feature extractors (such as CNN networks) are used to convert the data into feature vectors to ensure unified processing of multi-source heterogeneous data.

[0115] In this embodiment, preferably, the specific implementation steps of S4 are as follows:

[0116] S401. Build a graph-rag system, construct a knowledge network based on a graph database, and use nodes and edges to represent knowledge points and their relationships;

[0117] S402. By combining the graph database and the vector database, more comprehensive knowledge expansion is supported, semantic search based on the graph structure is realized, and the system's ability to answer user questions is improved;

[0118] S403, combine real-time data streams and batch data processing to ensure that the knowledge network remains up-to-date and continuously optimized;

[0119] It should be noted that building a knowledge network through a graph database facilitates connection through the relationship between nodes and edges, and facilitates knowledge expansion;

[0120] Neo4j is selected as the core graph database to build a complex knowledge network with its powerful graph modeling and real-time query capabilities. An architecture combining real-time data stream processing (such as Apache Kafka) and batch data processing (such as Apache Spark) is designed to support real-time data updates and periodic optimization; the collected data is preprocessed using data cleaning tools (such as Pandas) to ensure consistent data format and high quality; the processed data is imported using Neo4j's Cypher query language and Neo4j ETL tools, and converted into a graph model of nodes and relationships and stored in the database; the Kafka Connect plug-in is configured to import real-time data streams into Neo4j for continuous updates; Apache Kafka or other stream processing frameworks are integrated to receive real-time data streams, and the nodes and edges of the graph structure in Neo4j are updated in real time through a custom data stream processor to keep the knowledge network real-time; Kafka Streams or Flink is used for complex event processing and data conversion; combined with Apache Spark or other batch processing frameworks are used to periodically analyze and optimize data in Neo4j in batches, and perform batch processing tasks such as relationship merging, duplicate node elimination, or graph path analysis to improve the efficiency and structural optimization of the knowledge network. Through transaction management and ACID features, the consistency of data updates in Neo4j is ensured. Rollback and retry mechanisms are configured to deal with failed update operations, and data backup strategies are used to ensure data security. Neo4j Bloom or Graph Data Science Library is used to visualize and analyze knowledge networks in order to explore and display complex structural relationships and achieve better data-driven decision-making.

[0121] In this embodiment, preferably, the calculation of keyword extraction performed by the large language model in S5 is as follows:

[0122]

[0123] Among them, TF(x i ,d) reflects the importance of a word in the data information. The more frequently it appears, the higher the TF value, x i represents the word for calculation, and d represents the word x i The number of times it appears in the data information, It is used to measure the prevalence of a word in the entire corpus. The higher the value, the less common the word is in the corpus, expressed as the total number of texts in the corpus, DF(x i ) means that it contains word x i The number of texts;

[0124] If a word appears frequently in the data information to be detected and calculated, but appears less frequently in other texts, TF(x i ,The value of d) will be very high, indicating the importance of the word to the data information that needs to be detected and calculated;

[0125] On the contrary, if the word frequency is low or the word appears in many texts, then TF(x i ,The value of ,d) will be low, indicating that the word is not very important to the data information that needs to be detected and calculated;

[0126] It should be noted that the large language model is used to extract keywords from the index to improve the accuracy of data indexing.

[0127] In this embodiment, preferably, the multimodal retrieval combines the characteristics of different data such as text, image and graph data. When querying, multiple inputs are processed, including text input and image input, and the corresponding database is selected for retrieval according to the query mode. For text data, a vector database is used for semantic similarity matching; for graph structure data, a graph database is used for structured query;

[0128] And based on the structure of nodes and edges, as well as reasoning capabilities, potential knowledge and relationships are discovered, and new knowledge is derived from existing nodes during path reasoning;

[0129] By fusing the text vector results and image vector results in the self-vector database into a more professional and accurate answer;

[0130] It should be noted that in order to improve the richness of data information after retrieval, potential knowledge and relationships are discovered through reasoning capabilities, new knowledge is derived from existing nodes during path reasoning, and then the text vector results and image vector results in the self-vector database are fused into more professional and accurate answers through fusion;

[0131] The user input is processed in chunks, and a large language model (such as GPT-4) is used to semantically decompose the input text into meaningful phrases or sets of keywords; the input is ensured to be chunked into content suitable for matching with nodes and edges in the knowledge network; the nodes and edges in the pre-built knowledge network (stored in graph databases such as Neo4j) are encoded as vectors; these nodes and edges represent the core knowledge and concepts in the field and are embedded in the vector database; the user input vector is matched with the node and edge vectors in the knowledge network through cosine similarity calculation or other vector matching methods to identify the most relevant content; the relevant nodes and edges in the knowledge network are extracted based on the matching results, and they are used as keywords for further vector retrieval, and semantically extended searches are performed on these keywords to cover associated paths and contextual information, thereby achieving deep retrieval and expansion of knowledge; the matching results are integrated, and the information of relevant nodes and edges is formed into a structured knowledge response through graph path analysis; the large language model is used to generate natural language for the retrieval results, and complex graph structure information is converted into easy-to-read output to provide users with comprehensive and contextual answers.

[0132] Select a basic general-purpose large language model (such as GPT-3, GPT-4, LLaMA, etc.) as the basic model for fine-tuning; collect and organize high-quality conversation data covering the customer service field, including common problems, solutions, customer feedback, and historical chat records to ensure the diversity and authenticity of the model training data; clean the collected customer service data, remove sensitive information and irrelevant content, and format the data into an input-output conversation format suitable for model training; use NLP preprocessing tools (such as NLTK, spaCy) for text normalization, such as removing extra spaces, unifying terminology, and spelling checking; use a distributed training platform (such as PyTorch or TensorFlow) to fine-tune the selected large language model. Configure training hyperparameters (such as learning rate, batch size, number of training rounds) and use mixed precision training to improve efficiency; to ensure the professionalism and coverage of the data, apply supervised fine-tuning methods, and add data enhancement techniques to improve model robustness; use monitoring tools (such as Weights&Biases) to track the model's training loss and performance indicators during training. Use a dedicated validation set for regular evaluation to test the model's accuracy, naturalness, and contextual understanding of responses to different customer questions; perform post-optimization on the fine-tuned model, such as quantization and pruning, to reduce the model size and increase the inference speed; deploy the model to a production environment, and use containerization technology (such as Docker) and cloud platforms (such as AWS and Azure) for expansion; combine server-side load balancing and caching strategies to ensure the stability of the model under high concurrency; collect user interaction data and feedback after deployment, and obtain conversation logs between real users and the model through automated data collection tools. Use this data regularly for retraining or continuous learning to further improve the professionalism and response accuracy of the model.

[0133] The application process steps:

[0134] Step 1: Collect internal and external data in a specific field, and clean and standardize the collected internal and external data;

[0135] Step 2: Collect industry corpora in specific fields, and use them to fine-tune the open source large language model or train the large language model from scratch.

[0136] Step 3: vectorize the collected internal data and external data, including text vectorization, image vectorization and graph data vectorization, and store the vectorized data information in a vector database, generate a knowledge network from the internal data and external data, and store the knowledge network in a graph database;

[0137] Step 4: Build the graph-rag system to expand the user's questions more comprehensively;

[0138] Step 5: Extract keywords from the user's questions through a large language model, and automatically match nodes and edges in the knowledge network based on the extracted keywords to achieve fast and accurate knowledge retrieval;

[0139] Step 6: Process the retrieved knowledge through the fine-tuned large language model, merge the vector results from the vector database and the knowledge network in the graph database, discover the potential knowledge and relationships through reasoning capabilities, and output professional and accurate answers;

[0140] Step 7: Ensure that the vector database is always kept up to date and accurate through regular updates and optimizations.

[0141] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A knowledge service method combining vector database and graph retrieval technology, characterized in that: The method comprises the following steps: S1. Collect internal and external data in specific fields, and clean and standardize the collected internal and external data; S2. Collect industry corpora in specific fields, and fine-tune the open source large language model or train the large language model from scratch through the industry corpora in specific fields; S3, vectorizing the collected internal data and external data, including text vectorization, image vectorization and graph data vectorization, storing the vectorized data information in a vector database, generating a knowledge network from the internal data and external data, and storing the knowledge network in a graph database; S4, build the graph-rag system to expand the user's questions more comprehensively; S5. Extract keywords from the user's questions through a large language model, and automatically match nodes and edges in the knowledge network based on the extracted keywords to achieve fast and accurate knowledge retrieval; S6. Process the retrieved knowledge through the fine-tuned large language model, merge the vector results from the vector database and the knowledge network in the graph database, discover the potential knowledge and relationships through reasoning capabilities, and output professional and accurate answers; S7. Ensure that the vector database is always kept up to date and accurate through regular updates and optimizations.

2. A knowledge service method combining vector database and graph retrieval technology according to claim 1, characterized in that: The specific steps of S1 are: S101. Select and collect domain-specific data from a variety of sources, including documents, knowledge bases, and meeting records of internal data, industry reports, open data sets, and API interface data of external data, and ensure the reliability and diversity of data sources; S102. Extract data from multiple sources through the ETL process, clean and standardize the data, and store it in the database or data warehouse to ensure data consistency and accuracy; S103. Use automated testing, manual review and stage verification to ensure data quality, and perform version control to ensure that the data is always up to date during the update process.

3. A knowledge service method combining vector database and graph retrieval technology according to claim 2, characterized in that: The processing steps of data cleaning and standardization are: Data cleaning: remove duplication, process null values, and standardize formats; Data conversion: change the data format or unit, convert field type, and convert date string to date type; Data integration: merging data from multiple data sources into a unified format; Data aggregation: summarize and group data for statistical operations; Data filtering: Filter data based on business rules or conditions.

4. The knowledge service method combining vector database and graph retrieval technology according to claim 1, characterized in that: The training steps of the open source large language model in S2 are: S201, collect industry corpus in specific fields through various sources and perform data cleaning on the industry corpus; S202, grouping the collected industry corpus in a specific field into a model group and a verification group; S203, fine-tuning the open source large language model through the industry corpus in the specific field in the model group or training the large language model from scratch; S204. The open source large language model is verified by using the industry corpus in the specific field in the verification group to verify the trained large language model. Only when the verification accuracy is above 99% can it be used to analyze the questions.

5. The knowledge service method combining vector database and graph retrieval technology according to claim 1, characterized in that: The steps for fine-tuning or training a large open source language model from scratch in S2 are: S211. Select an open source large language model as the basic model and fine-tune the open source large language model by collecting industry corpora in specific fields; S212. If the open source large language model cannot be fine-tuned, train the large language model from scratch, use industry corpus in specific fields to train the open source large language model, and use a distributed computing framework to improve training efficiency; S213. Combine supervised learning and self-supervised learning to ensure that the open source large language model achieves the expected performance in specific fields.

6. The knowledge service method combining vector database and graph retrieval technology according to claim 1, characterized in that: The text vectorization uses a large language model to convert text data into vector representations to capture semantic information in the text; The image vectorization uses a convolutional neural network or other visual models to convert image data into a feature vector; The graph data vectorization converts the nodes and edges in the graph into embedded vectors, and uses a neural network to learn the embedded representation of the nodes and edges in the graph.

7. The knowledge service method combining vector database and graph retrieval technology according to claim 1, characterized in that: The steps for setting the vector database in S3 are as follows: S301, selecting a suitable vector database to store data in a specific field; S302, the collected internal data and external data are vectorized, and then the vectorized text vectorization, image vectorization and graph data vectorization are stored in a vector database to support efficient similarity search; S303, through approximate nearest neighbor search and multimodal indexing; approximate nearest neighbor search calculates similarity through vector space to achieve semantic or content-based retrieval; multimodal indexing supports joint indexing and searching of different data types such as text and images.

8. The knowledge service method combining vector database and graph retrieval technology according to claim 1, characterized in that: The specific implementation steps of S4 are as follows: S401. Build a graph-rag system, construct a knowledge network based on a graph database, and use nodes and edges to represent knowledge points and their relationships; S402. By combining the graph database and the vector database, more comprehensive knowledge expansion is supported, semantic search based on the graph structure is realized, and the system's ability to answer user questions is improved; S403. Combine real-time data streaming and batch data processing to ensure that the knowledge network remains up-to-date and continuously optimized.

9. The knowledge service method combining vector database and graph retrieval technology according to claim 1, characterized in that: The calculation of keyword extraction by the large language model in S5 is as follows: Among them, TF(x i ,d) reflects the importance of a word in the data information. The more frequently it appears, the higher the TF value, x i represents the word for calculation, and d represents the word x i The number of times it appears in the data information, It is used to measure the prevalence of a word in the entire corpus. The higher the value, the less common the word is in the corpus, expressed as the total number of texts in the corpus, DF(x i ) means that it contains word x i The number of texts; If a word appears frequently in the data information to be detected and calculated, but appears less frequently in other texts, TF(x i ,The value of d) will be very high, indicating the importance of the word to the data information that needs to be detected and calculated; On the contrary, if the word frequency is low or the word appears in many texts, then TF(x i ,The value of d) will be low, indicating that the word is not important to the data information that needs to be detected and calculated.

10. The knowledge service method combining vector database and graph retrieval technology according to claim 7, characterized in that: The multimodal retrieval combines the characteristics of different data such as text, image and graph data. When querying, it processes multiple inputs, including text input and image input, and selects the corresponding database for retrieval according to the query mode. For text data, it uses a vector database for semantic similarity matching; for graph structure data, it uses a graph database for structured query. And based on the structure of nodes and edges, as well as reasoning capabilities, potential knowledge and relationships are discovered, and new knowledge is derived from existing nodes during path reasoning; By fusion, the text vector results and image vector results in the self-vector database are fused into more professional and accurate answers.

Citation Information

Cited By

  • Key node vector data vectorization and spatial perception method based on graph neural network

    CN120407773A

  • Flink and large model collaborative data identification task completion method and device, equipment and medium

    CN120596843A

  • Smart city similar complaint event recognition method based on graph database and semantic recognition

    CN120821843A

  • MaaS multi-model release management method and system and storage medium

    CN120872616A