此语言仍有 26 条内容或界面任务待翻译;未完成部分显示中文原文。
Reference SolutionLarge Models & Software Services

Zhipu AI Contextual Retrieval: Rebuilding Context for Knowledge Chunks to Improve RAG Recall

To address the problems of traditional RAG—lost context after document splitting, semantic drift, and metadata retrieval failures—Zhipu AI has launched a contextual retrieval feature in its knowledge base product: automatically generating a summary card for each chunk and binding it to the original text, then performing hybrid retrieval with a dual index (vector index + BM25) and weighted RRF fusion ranking. Official evaluations show recall rate improvements of 12 to 23 percentage points across three scenarios, with average cache hit rates above 85%. The solution suits long structured documents and high-accuracy Q&A, with limited benefits for FAQ-style short knowledge bases.

Content Correction
Zhipu AI Contextual Retrieval: Rebuilding Context for Knowledge Chunks to Improve RAG Recall品类示意

Issues and Approaches

Challenges Faced

Traditional RAG splits long documents into independent knowledge fragments, causing three types of problems: missing context leads to semantic drift, as the AI cannot determine what "the system" refers to; key metadata such as document names and section titles is not contained within the chunk text, causing retrieval failures; and a single retrieval mode has capability gaps—vector retrieval is weak at matching exact keywords and model numbers, while BM25 keyword retrieval cannot understand synonyms and hypernym/hyponym concepts.

Solutions and Approaches

Zhipu AI has launched a "Contextual Retrieval" feature in its knowledge base product: an automated process generates a contextual summary card (Contextual Text) for each knowledge chunk, including source information, topic summary, key entities, disambiguation, and style preservation, which is bound to the original chunk and participates in retrieval together. The backend adopts a triple architecture: first, a dual-index structure, where the "original text + contextual description" is vectorized as a whole and stored in a vector index (Vector DB) for semantic understanding, while a text inverted index (Elasticsearch BM25) handles precise matching of keywords, years, and product model numbers; second, at query time, both indexes are searched simultaneously, with results merged and ranked via a weighted RRF fusion algorithm or a reranking model, and users can adjust the weights of vector and keyword retrieval according to their business needs; third, a caching mechanism avoids redundant computation and reduces token consumption costs. This feature relies on the Zhipu AI knowledge base product and requires no self-built retrieval pipeline, making it suitable for knowledge bases of long structured documents such as research reports, technical manuals, financial statements, and insurance contracts.

Delivery results

The official documentation provides lab evaluation data (not specific customer deployments): token-level recall rates improved across all three evaluation scenarios—academic paper scenario rose from 33% to 56.25% (+23.25%, failure rate down 34.75%), car manual Q&A scenario rose from 68% to 80% (+12%, failure rate down 37.5%), and insurance policy scenario rose from 53.60% to 71.43% (+17.83%, failure rate down 38.4%). On engineering metrics, cache hit rates are generally above 80%, averaging above 85%; each document takes about 100 seconds to process on average, while overly long documents with more than 200 chunks average about 300 seconds.

System Composition

Implementation Checklist

  1. The knowledge base consists primarily of long structured documents such as research reports, technical manuals, financial statements, and insurance contracts, with cross-references between sections—enable this first (Source: Scenario 1). Suitable when users frequently ask situational questions that require context to answer (e.g., cross-year comparisons) (Source: Scenario 2). Suitable for scenarios with high accuracy requirements such as intelligent customer service, technical support, and enterprise training (Source: Scenario 3). When the knowledge base consists mainly of short, independent FAQs or standalone clauses, traditional RAG may already suffice, with relatively limited benefits (Source). Indexing time needs to be evaluated for large-scale document ingestion: ordinary documents take about 100 seconds, while documents with more than 200 chunks take about 300 seconds. Weights of vector and keyword retrieval should be adjusted according to business needs to achieve optimal ranking.

Editorial Analysis Inferred from source information

Judging from the solution structure, the core cost of this feature is front-loaded to the indexing phase: generating context cards for each chunk increases token consumption, but the caching mechanism (hit rate above 85%) and the absence of additional model calls at query time mean that for enterprise Q&A scenarios with frequent queries and relatively stable knowledge bases, marginal costs remain manageable; conversely, if the knowledge base is rebuilt frequently, the 300 seconds-per-document generation time and repeated computation need to be factored into planning. Dual indexing with fusion ranking is a mature hybrid search paradigm whose value lies in compensating for vector retrieval's weakness in precise matching of model numbers and proper nouns—particularly critical for technical documentation containing product model numbers. The evaluation uses token-level recall with a 0.8 threshold for judgment, which is a substitute metric given the difficulty of directly judging chunk-level recall; readers should note this metric discrepancy when comparing horizontally with other RAG solutions. The applicability inference is based on the scenario recommendations in Section 4 of the documentation and represents vendor recommendations rather than third-party validation.

  • The performance data are self-tested results from Zhipu AI's official documentation, with no third-party validation or specific customer deployment cases provided; the solution is organized as a reference solution.
  • The evaluation set size, document language distribution, and chunking strategy details are not given as sources, making it impossible to assess result generalizability.
  • The test environment (model version, hardware, concurrency) for cache hit rates and generation time is not specified.
  • The documentation states that further evaluations on additional test sets will be conducted and data updated, so current metrics may change with versions.
  • The specific model used for context card generation is not specified.

Sources 智谱AI开放文档

Compilation Notes 内容由 AI 根据公开资料整理;事实与推断分开呈现。

Content Correction
Product Selection Assistant

让需求变成可修改的筛选条件

依据已录入参数生成条件,结果可查看和修改。帧率与性能需核对实测,不能仅凭算力数值保证。