Module capability index and intention reverse retrieval method on whole chain
By storing index and verification information on the blockchain and storing high-dimensional vector data in an off-chain database, the centralization problem of the RAG system is solved, enabling on-chain trusted governance and efficient off-chain retrieval, thereby improving the credibility and performance of the AI system.
Patent Information
- Application Number
- CN202511112253.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-11-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing RAG system relies on a centralized vector database, lacks on-chain verification mechanisms and traceability capabilities, cannot support large-scale retrieval, and index updates cannot respond to on-chain events in real time, resulting in delayed or invalid retrieval results.
The embedding index and verification information are stored on the ICP Canister chain, while high-dimensional vector data is stored in an off-chain vector database. By combining on-chain trusted governance with off-chain high-performance retrieval, on-chain index verification and off-chain efficient retrieval are achieved through dynamic hash generation and real-time monitoring of index updates.
It ensures the trustworthiness and integrity of on-chain data, supports high-performance retrieval of large-scale knowledge bases, has real-time dynamic index update capabilities, and improves the trustworthiness and efficiency of AI systems.
Smart Images

Figure CN120994703A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of artificial intelligence, blockchain and decentralized AI computing technology, and relates to an AI enhanced memory reasoning method combining on-chain index management and off-chain vector retrieval mechanism. BACKGROUND
[0002] The full-chain module capability index is a high-order form of evolution of blockchain data indexing technology, aiming to realize real-time and efficient retrieval and state verification of multi-chain data through a modular, verifiable and decentralized indexing architecture. The existing technology such as the workflow-based data reverse retrieval method disclosed in CN118820245A improves retrieval efficiency by establishing a mapping relationship between data references and workflow definitions. However, the index update of this scheme relies on periodic manual feedback, making it difficult to automatically respond to real-time state changes on the chain, and only updating the index when a file change event is triggered, which cannot perceive dynamic on-chain events such as smart contract upgrades and node service state changes. In a decentralized AI system, module capabilities are updated in real time with on-chain events such as governance voting and contract upgrades, and static indexes will cause the retrieval results to lag or fail.
[0003] The existing RAG system also has defects: it relies on centralized vector database storage of embedding, lacks on-chain verification mechanism and traceability; and full-chain storage is limited by high-dimensional vector calculation and storage costs, and cannot support large-scale retrieval. Therefore, there is an urgent need for a RAG architecture that combines on-chain governance and off-chain efficient retrieval to achieve the credibility and performance balance of AI long-term memory reasoning through on-chain index verification and off-chain vector storage and retrieval. SUMMARY
[0004] The existing technology has the following deficiencies: first, RAG systems generally rely on centralized vector databases, lack on-chain verification mechanisms and traceability, and cannot ensure data credibility; second, existing full-chain storage solutions have high-dimensional vector calculation and storage overheads, making it difficult to support large-scale retrieval; third, index updates usually rely on manual or periodic triggers, and cannot respond to on-chain events in real time. Therefore, the present application provides an AI enhanced memory reasoning method based on on-chain indexing and off-chain vector retrieval, which stores embedding indexes and verification information on the ICP Canister chain and stores high-dimensional vector data in an off-chain vector database, realizing the combination of on-chain credible governance and off-chain high-performance retrieval.
[0005] To solve the problems in the prior art, the present application provides an AI-enhanced memory inference method based on on-chain index and off-chain vector retrieval, aiming to solve the problems of lack of on-chain verification, difficulty in supporting large-scale retrieval and inability to realize real-time dynamic index updating in the existing RAG system. The present application realizes the combination of on-chain trusted governance and off-chain high-performance retrieval by storing embedding index and verification information on the ICPCanister chain and storing high-dimensional vector data in an off-chain vector database.
[0006] To achieve the above-mentioned purpose, the present application proposes the following technical solutions:
[0007] Preferably, in response to the addition and update events of the AI knowledge base, embedding is dynamically generated and its hash (vector_hash) is calculated to ensure that the off-chain data is verifiable.
[0008] Preferably, the embedding vector is stored in an off-chain vector database (such as Weaviate, Milvus), and a unique vector storage address (vector_uri) is generated.
[0009] Preferably, the hash, storage address and metadata of the embedding are recorded on the chain ICP Canister to realize on-chain index verification and call log management.
[0010] Preferably, the user's natural language query is parsed, and the RAG MCP module is called to retrieve the off-chain vector database through the LangChain framework to obtain Top-K related memory fragments.
[0011] Preferably, the retrieval results are spliced into context prompts, input into the LLM to perform enhanced inference, and the inference results and call traces are written back to the on-chain to support incentive allocation and auditing.
[0012] Further, the on-chain index updating step of the present application includes: listening to the document upload event of the MCP service, extracting the embedding metadata and writing it into the on-chain index table in real time; index changes are audited by the DAO governance contract to prevent malicious updates.
[0013] Further, the RAG MCP supports dynamic calling of multiple agents, can generate an optimal memory combination path based on on-chain index information, and ensures the consistency and credibility of the inference context.
[0014] Compared with the prior art, the present application has the following advantages:
[0015] 1. The on-chain index verification mechanism realizes the integrity and traceability of the embedding data, and improves the credibility of the RAG system.
[0016] 2. Combining off-chain high-performance ANN retrieval and on-chain governance, achieving a balance between high performance and decentralized trust, supporting large-scale knowledge base;
[0017] 3. Provide long-term memory enhancement support for Univoice and AIO-2030 ecology, enable AI to have real-time and verifiable memory reasoning ability. BRIEF DESCRIPTION OF DRAWINGS
[0018] The accompanying drawings are included to provide a further understanding of the application, and constitute a part of the specification, illustrate the application, and are used to explain the application together with the embodiments of the application, and do not constitute a limitation on the application. In the drawings:
[0019] Figure 1 Index update flowchart of the application;
[0020] Figure 2 Intention retrieval flowchart of the application;
[0021] Figure 3 Flowchart of the application;
[0022] Figure 4 Flowchart of the application. DETAILED DESCRIPTION
[0023] The technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only a part of the embodiments of the application, not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the application.
[0024] Embodiment one: Univoice voice AI scene
[0025] Please refer to Figures 1-2 The embodiment provides the following technical solutions: when a user issues a voice instruction through a Univoice terminal, the system first calls the Whisper model to transcribe the voice into text. Specifically, the text is processed by an embedding model to generate a high-dimensional vector, and then the vector is stored in the Weaviate vector database off-chain, and vector_hash and vector_uri are calculated and generated. These metadata are registered on the ICP Canister chain simultaneously, realizing the trusted synchronization of on-chain state and off-chain data.
[0026] When the user issues a query again, the RAG MCP first reads the on-chain index to verify the authenticity of the target vector, and then calls the off-chain database to perform Top-K similarity retrieval. The relevant memory fragments retrieved are integrated into the context prompt input into the LLM, which generates accurate answers under the enhanced context support. By recording the reasoning results and calling logs on the chain, the traceability and credible audit of the results are achieved.
[0027] Embodiment Two: Multi-agent Collaboration Scenario
[0028] Queen Agent calls RAG MCP to generate context memory → Agent performs reasoning based on trusted memory → Call on-chain storage of trajectory.
[0029] Please refer to Figures 3-4 In this embodiment, the complete interaction process of AI reasoning tasks in the AIO-2030 multi-agent ecosystem is demonstrated. When a complex task is initiated, the Queen Agent, as the scheduling hub, first receives the user's natural language request and generates the task context. The specific steps are as follows:
[0030] The Queen Agent disassembles the task and calls the RAG MCP interface to read the on-chain index from the ICP Canister to confirm the authenticity and availability of the required memory fragments;
[0031] RAG MCP uses the off-chain vector database (such as Weaviate / Milvus) to perform efficient Top-K retrieval, and returns the retrieval results after hash verification;
[0032] The Queen Agent splices the trusted memory obtained through retrieval into enhanced context and distributes it to each Agent involved in reasoning;
[0033] Each Agent performs reasoning tasks after obtaining trusted context, which may involve speech recognition, data analysis, strategy planning, and other capability modules;
[0034] The intermediate results of all Agents are summarized back to the Queen Agent, which integrates and reasons to generate the final output;
[0035] The calling trajectory during reasoning, the hash of the memory fragments used, and the final results are all stored on the chain through the ICP Canister, achieving transparency, verifiability, and efficient execution of the entire multi-agent collaboration process.
[0036] Finally, it should be noted that the above only describes the preferred embodiments of the present application and is not intended to limit the present application. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art will appreciate that the technical solutions described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalent ones. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. An AI-enhanced memory reasoning method based on on-chain indexing and off-chain vector retrieval, characterized in that: include: Step 1: Vectorize the user's input speech or text using an embedding model; Step 2: Store the embedding in an off-chain vector database, calculate the embedding hash, and generate the vector storage address; Step 3: Store the vector hash, storage address, and metadata onto the ICP Canister chain; Step 4: During AI inference, read on-chain index information through RAG MCP, call the off-chain vector database to perform similarity retrieval, and return Top-K memory fragments; Step 5: Concatenate the search results into context-enhanced hints for LLM to generate inference results, and record the call chain and verification results on the chain.
2. The method according to claim 1, characterized in that: The vector_hash is generated by calculating the embedding serialization result using the SHA-256 algorithm to ensure the integrity of off-chain data. Step 1: Serialize the embedding vector; Step 2: Calculate the hash value of the serialized result using the SHA-256 algorithm; Step 3: The generated vector_hash is used to ensure the integrity of off-chain data.
3. The method according to claim 1, characterized in that: The steps for determining the vector_uri include: Step 1: Assign a unique doc_id to each embedding; Step 2: Generate a vector storage address using the unified format protocol: / / namespace / doc_id; Step 3: This format supports compatibility with various vector storage backends.
4. The method according to claim 1, characterized in that: The implementation steps of the RAG MCP include: Step 1: Arrange the reasoning and retrieval process using the LangChain framework; Step 2: Expose a JSON-RPC interface, providing the rag.upload_doc and rag.query methods for document uploading and querying.
5. The method according to claim 1, characterized in that: The functions of the on-chain ICP Canister include: Step 1: Implement access control and verify the caller's permissions; Step 2: Record the call log for each retrieval and inference; Step 3: Manage incentive allocation to achieve trustworthy governance.
Citation Information
Patent Citations
Reverse retrieval method and device for workflow basic data, equipment and medium
CN118820245A