Unified knowledge base retrieval method and system for multi-scene RAG

By adopting a unified knowledge base search method and system of multi-scene RAG in a high-performance search engine, using shard dynamic scaling and multi-slicing and multi-replica strategies, the performance bottlenecks and data security problems of massive vector data retrieval are solved, and efficient and secure support for diversified application scenarios is achieved.

CN119598024APending Publication Date: 2025-03-11FUJIAN FUJITSU COMM SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411724686.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

When facing massive vector data, existing high-performance search engines have problems such as performance bottlenecks, high costs, technical challenges, diversified application scenarios, and data security and privacy protection, which are difficult to meet users' continuous improvement requirements for high-performance search.

Method used

Using a unified knowledge base search method and system of multi-scene RAG, a storage structure and high-performance retrieval of massive vectors are constructed through dynamic scaling, configurable multi-slicing multi-replica strategy and distributed vector high-availability guarantee mechanism.

Benefits of technology

It realizes efficient storage and retrieval of massive vector data, improves the performance and scalability of the search engine, enhances data security and privacy protection measures, and meets the needs of diverse application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119598024A_ABST
    Figure CN119598024A_ABST
Patent Text Reader

Abstract

The invention discloses a unified knowledge base retrieval method and system for a multi-scene RAG. The method comprises the steps that a vector extraction service provides a picture steering quantity interface for a business platform; the vector adapter provides a vector operation edge tool for the service side; the configuration center configures application configuration and user configuration of each service, monitors online registration discovery of the distributed service in the vector atomic cluster, and receives a heartbeat monitoring service state of the distributed service; the vector management service is in butt joint with an actual service request of a service layer, and vector fragmentation management is achieved according to a preset fragmentation strategy; a distributed service operation vector addition, deletion, modification and retrieval function is directly connected; the vector atomic service of multiple copies of the vector atomic cluster is used for constructing a bottom-layer vector computing node internally, carrying out SDK (Software Development Kit) adaptation and externally providing a basic vector operation capability; the vector atomic cluster is internally provided with a data management module, locally caches data, and realizes data synchronization and data accident recovery capability. According to the method, storage structure and high-performance retrieval of massive vectors are facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a unified knowledge base retrieval method and system for multi-scenario RAG. Background Art

[0002] High-performance search engines have been widely used in many industries, including but not limited to image search, speech recognition, recommendation systems, medical image analysis, financial risk control, etc. In these fields, the engine provides users with an efficient and convenient way to obtain information by quickly and accurately retrieving massive vector data. The introduction of deep learning technology enables the engine to better understand the semantic information of vector data, further improving the intelligent level of retrieval. At the same time, with the continuous expansion of the market and the intensification of competition, more companies have begun to increase their R&D investment and market promotion efforts to compete for market share.

[0003] The industry pain points of high-performance search engines for massive vectors mainly include performance bottlenecks, high costs, technical challenges, diverse application scenarios, and data security and privacy protection. In order to solve these problems, it is necessary to continuously develop new technologies and algorithms to optimize the performance and scalability of search engines, while strengthening the construction of data security and privacy protection measures.

[0004] With the continuous advancement of technology and the continuous expansion of application scenarios, the amount of data generated by various industries is growing exponentially. These data include not only traditional structured data, but also a large amount of unstructured and semi-structured data. With the continuous increase in data volume and the complexity of retrieval requirements, users have higher and higher performance requirements for retrieval engines. In the next few years, with the acceleration of digital transformation and the popularization of AI technology, the demand for high-performance retrieval engines for massive vectors will continue to grow. Especially in data-intensive industries such as finance, medical care, education, and e-commerce, the growth potential of this market will be even greater. Summary of the invention

[0005] The purpose of the present invention is to provide a unified knowledge base retrieval method and system for multi-scenario RAG, which constructs a storage structure and high-performance retrieval of massive vectors through dynamic expansion and contraction of shards, configurable multi-shard multi-copy strategy and distributed vector high availability guarantee mechanism.

[0006] The technical solution adopted by the present invention is: A unified knowledge base retrieval system for multi-scenario RAG, comprising: Vector extraction service: provides an image-to-vector interface for the business platform, with an internal integration of an image detection model and a vector extraction model. The business layer inputs the image address or the base64 encoding of the image, and the vector extraction service processes the data internally to convert it into a feature vector that can be received by the model and the parameters are called by each model. Furthermore, the vector extraction service internally integrates image detection models and vector extraction models for portraits and vehicles.

[0007] Vector adapter: provides vector operation edge tools for the business side; Furthermore, the vector operation edge tool includes a batch import function, a function of comparing the differences between different vector libraries, and a function of synchronizing the same-volume libraries.

[0008] Specifically, for example, batch image-oriented vector libraries, difference comparison and synchronization of different vector libraries and other capabilities.

[0009] Configuration Center: It is used as the unified configuration center for all services in the whole system, configures the application configuration and user configuration of each service, monitors the online registration and discovery of distributed services in the Vector Atomic Cluster, and receives the heartbeat monitoring service status of distributed services. Vector Management Service: It is the central management module in the system. It connects to the actual business requests of the business layer. The vector management service contains a shard management module to implement vector shard management according to the predetermined shard strategy. It directly connects to the distributed service operation vector addition, deletion, modification and retrieval functions. Specifically, the vector management service implements vector sharding management by classifying tenants, large libraries, small libraries, and micro libraries, and directly connects to distributed service operations such as vector addition, deletion, modification, and retrieval.

[0010] Vector Atomic Cluster: includes distributed vector atomic services with multiple copies. The vector atomic service is responsible for the architecture and SDK adaptation of the underlying vector computing nodes internally, and provides basic vector operation capabilities (such as addition, deletion, and batch retrieval capabilities) externally. The vector atomic cluster has a built-in data management module, caches data locally, and uses queues to operate DB data through atomic capabilities to achieve data synchronization and accidental data recovery capabilities.

[0011] A unified knowledge base retrieval method for multi-scenario RAG includes the following steps: Step 1, vector extraction service: decode the uploaded image based on the vector extraction request of the business layer to obtain the image extraction features; Furthermore, step 1 specifically includes the following steps: Step 1-1: The business layer initiates a vector extraction request and uploads the image address of a file stored in the same network segment or the image base64 encoding to the service layer; Step 1-2: The service layer obtains the image content and extracts the target classification, and converts it into the input parameters required by the detection and extraction model service model to call the corresponding model service; Steps 1-3: Model service decodes the image and extracts features Step 2: Vector adaptation: The service layer compares the vectors of image extraction features according to business requirements and performs vector addition operations through atomic clusters. Furthermore, step 2 specifically includes the following steps: Step 2-1: asynchronous operation to meet the business customization requirements, and initiate a request to the service layer through tenant, library information, and feature information; Step 2-2: The service layer records business request tasks according to business requirements, asynchronously processes requests such as batch import, and initiates operation requests to the atomic cluster; Step 2-3: The asynchronous callback operation result is returned to the business layer.

[0012] Step 3, vector library creation: obtain the configuration table of the newly created vector library and generate the library number according to the generator after dynamic verification is successful, and dynamically generate the library name, library shard and other configuration information through shard management; then the atomic cluster stores the binding information in the database; Furthermore, step 3 specifically includes the following steps: Step 3-1, the business layer initiates a request to create a new vector library, notifying the library ID, library type, vector type and other information; Step 3-2, the service layer performs dynamic verification according to the configuration table, such as library ID uniqueness verification, library type verification, scale verification, and library quantity verification, etc. After the verification is successful, the library number and other information are generated according to the generator; Step 3-3, the shard management dynamically generates the library name, library shard and other configuration information; Step 3-4: Initiate a new library request to the appropriate atomic cluster and store the binding information in the database.

[0013] Step 4, vector library deletion and automatic cleaning: Check whether the library ID in the library deletion request exists; if it exists, delete the corresponding database through the atomic cluster and release the corresponding binding information; at the same time, the shard management regularly cleans and deletes the corresponding portrait library according to the cleaning strategy to release resources; Furthermore, step 4 specifically includes the following steps: Step 4-1: The business layer initiates a library deletion request through the tenant and library ID; Step 4-2: After the service layer verifies whether the library ID exists, it obtains the binding relationship and requests the atomic cluster to delete the corresponding database, and notifies the shard management module to release the corresponding binding information; Furthermore, in the shard management, according to the cleaning strategy, such as empty library for N days, etc., the corresponding portrait library is cleaned and deleted regularly. After the resources are released, the service layer calls back to notify the business layer.

[0014] Step 5, vector addition: The vector management service obtains the feature vector and calculates the shards according to the sharding strategy. After the shard data is processed, the atomic capability inserts the vector data into the corresponding vector database. Furthermore, step 5 specifically includes the following steps: Step 5-1: The business layer obtains the feature vector through the vector extraction service and initiates a request to the vector management service by specifying the ID added to the vector library; Step 5-2: The vector management service calculates the shards according to the sharding strategy, and after the shard data is processed, a batch addition request is initiated to the vector atomic capability; Step 5-3, the atomic capability cache data is saved to the cache middleware, and then the vector data is inserted into the corresponding vector database; Step 5-4: Persist the sharded data in the persistent database according to the persistence requirements within the atomic capability.

[0015] Step 6, vector update: the vector management service searches for the storage shard based on the vector ID to be updated, and after processing the shard data, the atomic capability updates the vector data stored in the vector database; Furthermore, step 6 specifically includes the following steps: Step 6-1, the business layer provides the feature vector and corresponding ID to initiate an update request; Step 6-2: The vector management service searches for the storage shard by the vector ID, and after processing the shard data, initiates a batch update request to the vector atomic capability; Step 6-3, the atomic capability cache data is saved to the cache middleware, and then the vector data stored in the vector database is updated; Step 6-4: Persist the sharded data in the persistent database according to the persistence requirements within the atomic capability.

[0016] Step 7, vector search: Based on the vector to be searched, the shard list is calculated to obtain all the shards that need to be searched, and the shards are traversed to search according to the search conditions and combined into MvN searches. The search results are obtained and associated with the local cache for verification; after the search results of each shard are aggregated, the top k with the highest similarity are selected and returned as the final search results.

[0017] Furthermore, step 7 specifically includes the following steps: Step 7-1, the business layer initiates a vector search request using the vector to be searched and its configuration; Step 7-2: The vector management service calculates the shard list, calculates all shards that need to be retrieved by the search request, and traverses the shards for retrieval; Step 7-3: The vector atomic capability is combined into MvN search batches according to search conditions such as searching the portrait library, topK and other search parameters, and the search results are associated with the local cache for verification; In step 7-4, the vector management service aggregates the search results of each shard, selects the top k with the highest similarity and returns them as the final search results.

[0018] The present invention adopts the above technical scheme, and uses the statistical data information and resource utilization information reported by the distributed atomic capability cluster of each shard recorded in the registration center to realize the dynamic expansion and contraction function of the shard; the sharding strategy of the present invention adopts tenant differentiation, and when a new user feature library is created, it is determined whether the shard already exists, and the existing one continues to determine whether to open a new shard based on the resource utilization rate and capacity limit. The present invention monitors the capacity information and resource information of each shard in real time through capacity monitoring, dynamically expands new shards for shards whose utilization rate or capacity exceeds a certain threshold, and merges shards according to the strategy to reduce the number of shards for shards with low utilization rate and capacity. The vector atomic service of the present invention is started in a multi-copy mode, and each service has an internal static configuration file to configure the basic configuration information such as the vector library type, the vector library version number, and the graphics card type and graphics card capacity. The vector library atomic service of the present invention contains a status monitoring function, which monitors whether the current status of the service is normal or abnormal, as well as the utilization rate of various resources, and also contains a statistical monitoring function, which actually monitors the number of vector libraries and the size of vector data to report to the registration module, and the registration module registers the service information to a certain shard in the registration center. The shard management of the present invention dynamically caches the available status of each shard and each copy, selects available copies of available shards according to the load balancing strategy, reports danger warnings in real time according to the warning threshold dimension strategy, and distributes the traffic of the vector management service to other shards in the same group. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments; Figure 1 A schematic diagram of the principle architecture of a unified knowledge base retrieval system for multi-scenario RAG of the present invention; Figure 2 A schematic diagram of the workflow of the vector extraction service of the present invention; Figure 3 Schematic diagram of the working process of the vector adapter of the present invention; Figure 4 A schematic diagram of a newly created workflow for the vector library of the present invention; Figure 5 Schematic diagram of the workflow of vector library deletion and automatic cleaning of the present invention; Figure 6 A schematic diagram of the newly added workflow of the vector of the present invention; Figure 7 A schematic diagram of the workflow of vector updating of the present invention; Figure 8 Schematic diagram of the workflow of vector retrieval of the present invention. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0021] A vector database is a database system designed for storing and retrieving high-dimensional vector data, aiming to provide efficient vector retrieval and similarity query. In a vector database, data is stored in the form of vectors, and the database provides efficient methods to calculate and compare the similarity between these vectors. Vector databases usually use special indexing and query algorithms to speed up retrieval and query operations on high-dimensional vector data. Vectorization allows operations to be performed on multiple elements in an array or data set at the same time. This technology can significantly improve performance when processing large amounts of data or repetitive operations; vectorization of a knowledge base refers to the process of converting data in a knowledge base (such as text, images, sounds, etc.) into numerical vectors. These numerical vectors usually contain more dimensions, each of which represents a certain feature or attribute of the data. It can improve the accuracy and efficiency of retrieval, so that the knowledge base can better support information retrieval, content recommendation, and other AI applications. The Top-K problem is a class of algorithmic and data processing problems. The task is to find the top K most important or highest-ranked elements from a set containing a large number of data items.

[0022] like Figures 1 to 8 As shown in one, the present invention discloses a unified knowledge base retrieval system for multi-scenario RAG, which includes: Vector extraction service: provides an image-to-vector interface for the business platform, with an internal integration of an image detection model and a vector extraction model. The business layer inputs the image address or the base64 encoding of the image, and the vector extraction service processes the data internally to convert it into a feature vector that can be received by the model and the parameters are called by each model. Furthermore, the vector extraction service internally integrates image detection models and vector extraction models for portraits and vehicles.

[0023] Vector adapter: provides vector operation edge tools for the business side; Furthermore, the vector operation edge tool includes a batch import function, a function of comparing the differences between different vector libraries, and a function of synchronizing the same-volume libraries.

[0024] Specifically, for example, batch image-oriented vector libraries, difference comparison and synchronization of different vector libraries and other capabilities.

[0025] Configuration Center: It is used as the unified configuration center for all services in the whole system, configures the application configuration and user configuration of each service, monitors the online registration and discovery of distributed services in the Vector Atomic Cluster, and receives the heartbeat monitoring service status of distributed services. Vector Management Service: It is the central management module in the system. It connects to the actual business requests of the business layer. The vector management service contains a shard management module to implement vector shard management according to the predetermined shard strategy. It directly connects to the distributed service operation vector addition, deletion, modification and retrieval functions. Specifically, the vector management service implements vector sharding management by classifying tenants, large libraries, small libraries, and micro libraries, and directly connects to distributed service operations such as vector addition, deletion, modification, and retrieval.

[0026] Vector Atomic Cluster: includes distributed vector atomic services with multiple copies. The vector atomic service is responsible for the architecture and SDK adaptation of the underlying vector computing nodes internally, and provides basic vector operation capabilities (such as addition, deletion, and batch retrieval capabilities) externally. The vector atomic cluster has a built-in data management module, caches data locally, and uses queues to operate DB data through atomic capabilities to achieve data synchronization and accidental data recovery capabilities.

[0027] A unified knowledge base retrieval method for multi-scenario RAG includes the following steps: Step 1, vector extraction service: decode the uploaded image based on the vector extraction request of the business layer to obtain the image extraction features; Furthermore, step 1 specifically includes the following steps: Step 1-1: The business layer initiates a vector extraction request and uploads the image address of a file stored in the same network segment or the image base64 encoding to the service layer; Step 1-2: The service layer obtains the image content and extracts the target classification, and converts it into the input parameters required by the detection and extraction model service model to call the corresponding model service; Steps 1-3: Model service decodes the image and extracts features Step 2: Vector adaptation: The service layer compares the vectors of image extraction features according to business requirements and performs vector addition operations through atomic clusters. Furthermore, step 2 specifically includes the following steps: Step 2-1: asynchronous operation to meet the business customization requirements, and initiate a request to the service layer through tenant, library information, and feature information; Step 2-2: The service layer records business request tasks according to business requirements, asynchronously processes requests such as batch import, and initiates operation requests to the atomic cluster; Step 2-3: The asynchronous callback operation result is returned to the business layer.

[0028] Step 3, vector library creation: obtain the configuration table of the newly created vector library and generate the library number according to the generator after dynamic verification is successful, and dynamically generate the library name, library shard and other configuration information through shard management; then the atomic cluster stores the binding information in the database; Furthermore, step 3 specifically includes the following steps: Step 3-1, the business layer initiates a request to create a new vector library, notifying the library ID, library type, vector type and other information; Step 3-2, the service layer performs dynamic verification according to the configuration table, such as library ID uniqueness verification, library type verification, scale verification, and library quantity verification, etc. After the verification is successful, the library number and other information are generated according to the generator; Step 3-3, the shard management dynamically generates the library name, library shard and other configuration information; Step 3-4: Initiate a new library request to the appropriate atomic cluster and store the binding information in the database.

[0029] Step 4, vector library deletion and automatic cleaning: Check whether the library ID in the library deletion request exists; if it exists, delete the corresponding database through the atomic cluster and release the corresponding binding information; at the same time, the shard management regularly cleans and deletes the corresponding portrait library according to the cleaning strategy to release resources; Furthermore, step 4 specifically includes the following steps: Step 4-1: The business layer initiates a library deletion request through the tenant and library ID; Step 4-2: After the service layer verifies whether the library ID exists, it obtains the binding relationship and requests the atomic cluster to delete the corresponding database, and notifies the shard management module to release the corresponding binding information; Furthermore, in the shard management, according to the cleaning strategy, such as empty library for N days, etc., the corresponding portrait library is cleaned and deleted regularly. After the resources are released, the service layer calls back to notify the business layer.

[0030] Step 5, vector addition: The vector management service obtains the feature vector and calculates the shards according to the sharding strategy. After the shard data is processed, the atomic capability inserts the vector data into the corresponding vector database. Step 5-1: The business layer obtains the feature vector through the vector extraction service and initiates a request to the vector management service by specifying the ID added to the vector library; Step 5-2: The vector management service calculates the shards according to the sharding strategy, and after the shard data is processed, a batch addition request is initiated to the vector atomic capability; Step 5-3, the atomic capability cache data is saved to the cache middleware, and then the vector data is inserted into the corresponding vector database; Step 5-4: Persist the sharded data in the persistent database according to the persistence requirements within the atomic capability.

[0031] Step 6, vector update: the vector management service searches for the storage shard based on the vector ID to be updated, and after processing the shard data, the atomic capability updates the vector data stored in the vector database; Step 6-1, the business layer provides the feature vector and corresponding ID to initiate an update request; Step 6-2: The vector management service searches for the storage shard by the vector ID, and after processing the shard data, initiates a batch update request to the vector atomic capability; Step 6-3, the atomic capability cache data is saved to the cache middleware, and then the vector data stored in the vector database is updated; Step 6-4: Persist the sharded data in the persistent database according to the persistence requirements within the atomic capability.

[0032] Step 7, vector search: Based on the vector to be searched, the shard list is calculated to obtain all the shards that need to be searched, and the shards are traversed to search according to the search conditions and combined into MvN searches. The search results are obtained and associated with the local cache for verification; after the search results of each shard are aggregated, the top k with the highest similarity are selected and returned as the final search results.

[0033] Furthermore, step 7 specifically includes the following steps: Step 7-1, the business layer initiates a vector search request using the vector to be searched and its configuration; Step 7-2: The vector management service calculates the shard list, calculates all shards that need to be retrieved by the search request, and traverses the shards for retrieval; Step 7-3: The vector atomic capability is combined into MvN search batches according to search conditions such as searching the portrait library, topK and other search parameters, and the search results are associated with the local cache for verification; In step 7-4, the vector management service aggregates the search results of each shard, selects the top k with the highest similarity and returns them as the final search results.

[0034] The present invention adopts the above technical scheme, and uses the statistical data information and resource utilization information reported by the distributed atomic capability cluster of each shard recorded in the registration center to realize the dynamic expansion and contraction function of the shard; the sharding strategy of the present invention adopts tenant differentiation, and when a new user feature library is created, it is determined whether the shard already exists, and the existing one continues to determine whether to open a new shard based on the resource utilization rate and capacity limit. The present invention monitors the capacity information and resource information of each shard in real time through capacity monitoring, dynamically expands new shards for shards whose utilization rate or capacity exceeds a certain threshold, and merges shards according to the strategy to reduce the number of shards for shards with low utilization rate and capacity. The vector atomic service of the present invention is started in a multi-copy mode, and each service has an internal static configuration file to configure the basic configuration information such as the vector library type, the vector library version number, and the graphics card type and graphics card capacity. The vector library atomic service of the present invention contains a status monitoring function, which monitors whether the current status of the service is normal or abnormal, as well as the utilization rate of various resources, and also contains a statistical monitoring function, which actually monitors the number of vector libraries and the size of vector data to report to the registration module, and the registration module registers the service information to a certain shard in the registration center. The shard management of the present invention dynamically caches the available status of each shard and each copy, selects available copies of available shards according to the load balancing strategy, reports danger warnings in real time according to the warning threshold dimension strategy, and distributes the traffic of the vector management service to other shards in the same group.

[0035] Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of the present application is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians of the art without making creative work are within the scope of protection of the present application.

Claims

1. A unified knowledge base retrieval method for multi-scenario RAG, characterized by: It includes: Vector extraction service: provides an image-to-vector interface for the business platform, integrating image detection models and vector extraction models internally; The business layer inputs the image address or the image base64 encoding, and the vector extraction service processes the data internally and converts it into a feature vector that can be received by the model and the parameters are called by each model to obtain the feature vector; Vector adapter: provides vector operation edge tools for the business side; Configuration Center: It is used as the unified configuration center for all services in the whole system, configures the application configuration and user configuration of each service, monitors the online registration and discovery of distributed services in the Vector Atomic Cluster, and receives the heartbeat monitoring service status of distributed services. Vector management service: It is the central management module in the system; The actual business request of the business layer is connected to the vector management service. The vector management service contains a shard management module, which implements vector shard management according to the predetermined shard strategy. Directly connect to the distributed service operation vector addition, deletion, modification and retrieval functions; Vector Atomic Cluster: includes distributed vector atomic services with multiple replicas; The vector atomic service is responsible for the architecture and SDK adaptation of the underlying vector computing nodes internally, and provides basic vector operation capabilities externally. The Vector Atomic Cluster has a built-in data management module that caches data locally. It uses atomic capabilities to operate DB data using queues to achieve data synchronization and accidental data recovery capabilities.

2. According to claim 1, a unified knowledge base retrieval system for multi-scenario RAG is characterized in that: The vector extraction service integrates the image detection model and vector extraction model of portraits and vehicles; the vector operation edge tools include batch import function, difference comparison function of different vector libraries and synchronization function of the same quantity library.

3. A unified knowledge base retrieval method for multi-scenario RAG, applied to a unified knowledge base retrieval system for multi-scenario RAG as claimed in any one of claims 1 or 2, characterized in that: The method comprises the following steps: Step 1, vector extraction service: decode the uploaded image based on the vector extraction request of the business layer to obtain the image extraction features; Step 2: Vector adaptation: The service layer compares the vectors of image extraction features according to business requirements and performs vector addition operations through atomic clusters. Step 3, vector library creation: obtain the configuration table of the newly created vector library and generate the library number according to the generator after dynamic verification is successful, and dynamically generate the library name, library shard and other configuration information through shard management; then the atomic cluster stores the binding information in the database; Step 4, vector library deletion and automatic cleaning: Check whether the library ID in the library deletion request exists; if it exists, delete the corresponding database through the atomic cluster and release the corresponding binding information; at the same time, the shard management regularly cleans and deletes the corresponding portrait library according to the cleaning strategy to release resources; Step 5, vector addition: The vector management service obtains the feature vector and calculates the shards according to the sharding strategy. After the shard data is processed, the atomic capability inserts the vector data into the corresponding vector database. Step 6, vector update: the vector management service searches for the storage shard based on the vector ID to be updated, and after processing the shard data, the atomic capability updates the vector data stored in the vector database; Step 7, vector search: Based on the vector to be searched, the shard list is calculated to obtain all the shards that need to be searched, and the shards are traversed to search according to the search conditions and combined into MvN searches. The search results are obtained and associated with the local cache for verification; after the search results of each shard are aggregated, the top k with the highest similarity are selected and returned as the final search results.

4. The unified knowledge base retrieval method for multi-scenario RAG according to claim 3 is characterized in that: Step 1 specifically includes the following steps: Step 1-1: The business layer initiates a vector extraction request and uploads the image address of a file stored in the same network segment or the image base64 encoding to the service layer; Step 1-2: The service layer obtains the image content and extracts the target classification, and converts it into the input parameters required by the detection and extraction model service model to call the corresponding model service; Steps 1-3: Model service decodes the image to extract features.

5. According to claim 3, a unified knowledge base retrieval method for multi-scenario RAG is characterized in that: Step 2 specifically includes the following steps: Step 2-1: asynchronous operation to meet business customization requirements, and initiate a request to the service layer through tenant, library information and feature information; Step 2-2: The service layer records the business request tasks according to business requirements, processes the requests asynchronously, and initiates operation requests to the atomic cluster; Step 2-3: The asynchronous callback operation result is returned to the business layer.

6. The unified knowledge base retrieval method of multi-scenario RAG according to claim 3 is characterized in that: Step 3 specifically includes the following steps: Step 3-1, the business layer initiates a request to create a new vector library, notifying the library ID, library type and vector type information; Step 3-2, the service layer performs dynamic verification according to the configuration table. After the verification is successful, the library number and other information are generated according to the generator; Step 3-3, the shard management dynamically generates the library name, library shard and other configuration information; Step 3-4: Initiate a new library request to the appropriate atomic cluster and store the binding information in the database.

7. The unified knowledge base retrieval method for multi-scenario RAG according to claim 3 is characterized in that: Step 4 specifically includes the following steps: Step 4-1: The business layer initiates a library deletion request through the tenant and library ID; Step 4-2: After the service layer verifies whether the library ID exists, it obtains the binding relationship and requests the atomic cluster to delete the corresponding database, and notifies the shard management module to release the corresponding binding information; Step 4-3: In the shard management, the corresponding portrait database is cleaned and deleted regularly according to the cleaning strategy. After the resources are released, the service layer calls back to notify the business layer.

8. The unified knowledge base retrieval method for multi-scenario RAG according to claim 3 is characterized in that: Step 5 specifically includes the following steps: Step 5-1: The business layer obtains the feature vector through the vector extraction service and initiates a request to the vector management service by specifying the id added to the vector library; Step 5-2: The vector management service calculates the shards according to the sharding strategy, and after the shard data is processed, a batch addition request is initiated to the vector atomic capability; Step 5-3, the atomic capability cache data is saved to the cache middleware, and then the vector data is inserted into the corresponding vector database; Step 5-4: Persist the sharded data in the persistent database according to the persistence requirements within the atomic capability.

9. The unified knowledge base retrieval method of multi-scenario RAG according to claim 3 is characterized in that: Step 6 specifically includes the following steps: Step 6-1, the business layer provides the feature vector and corresponding id to initiate an update request; Step 6-2: The vector management service searches for the storage shard by the vector ID, and after processing the shard data, initiates a batch update request to the vector atomic capability; Step 6-3, the atomic capability cache data is saved to the cache middleware, and then the vector data stored in the vector database is updated; Step 6-4: Persist the sharded data in the persistent database according to the persistence requirements within the atomic capability.

10. The unified knowledge base retrieval method of multi-scenario RAG according to claim 3, characterized in that: Step 7 specifically includes the following steps: Step 7-1: The business layer initiates a vector search request using the vector to be searched and its configuration; Step 7-2: The vector management service calculates the shard list, calculates all shards that need to be retrieved by the quantity search request, and traverses the shards for retrieval; Step 7-3, the vector atomic capability performs batch retrieval according to the retrieval parameters of the retrieval condition to form an MvN search, and the retrieval results are associated with the local cache for verification; In step 7-4, the vector management service aggregates the search results of each shard, selects the top k with the highest similarity and returns them as the final search results.