RAG 系统优化实战:从 60% 到 95% 的检索准确率提升之路

RAG System Optimization: Journey from 60% to 95% Retrieval Accuracy

| Liu Ming | 2026-08-02T14:00:00

分享 iDev 知识库 RAG 系统的优化历程,通过混合检索、重排序和查询改写等技术将检索准确率从60%提升至95%。

Sharing iDev knowledge base RAG system optimization journey, improving retrieval accuracy from 60% to 95% through hybrid retrieval, reranking, and query rewriting.

问题背景iDev 内部知识库使用标准 RAG 架构(文档切片 + 向量检索 + LLM 生成),初期检索准确率仅约60%,用户反馈"找不到想要的答案"。我们通过系统性优化将准确率提升至95%。优化策略1. 文档处理优化语义切片替代固定长度切片(基于标题、段落结构)保留父子文档关系,检索时返回上下文窗口为每个切片生成假设性问题(HyDE 思路)2. 混合检索向量检索(语义相似度)+ BM25(关键词匹配)使用 RRF(Reciprocal Rank Fusion)合并排序结果对代码类文档额外启用 AST 结构化检索3. 重排序(Reranking)使用 Cross-Encoder 模型对 Top-20 结果重排序模型选择:bge-reranker-v2-m3,支持中英双语4. 查询改写LLM 将模糊查询改写为精确查询多角度查询扩展(生成3个不同表述的查询)效果对比阶段检索准确率用户满意度基础版60%45%+混合检索75%62%+重排序88%78%+查询改写95%91%


Problem BackgroundiDev's internal knowledge base used a standard RAG architecture (document chunking + vector retrieval + LLM generation). Initial retrieval accuracy was only about 60%, with users reporting "can't find the answers I want." Through systematic optimization, we improved accuracy to 95%.Optimization Strategies1. Document Processing OptimizationSemantic chunking instead of fixed-length (based on headings and paragraph structure)Preserve parent-child document relationships, return context windows during retrievalGenerate hypothetical questions for each chunk (HyDE approach)2. Hybrid RetrievalVector retrieval (semantic similarity) + BM25 (keyword matching)Use RRF (Reciprocal Rank Fusion) to merge ranking resultsEnable additional AST-based structured retrieval for code documents3. RerankingUse Cross-Encoder model to rerank Top-20 resultsModel choice: bge-reranker-v2-m3 with bilingual Chinese-English support4. Query RewritingLLM rewrites vague queries into precise queriesMulti-angle query expansion (generate 3 differently worded queries)Results ComparisonStageRetrieval AccuracyUser SatisfactionBaseline60%45%+Hybrid Retrieval75%62%+Reranking88%78%+Query Rewriting95%91%

← Back to News