[{"data":1,"prerenderedAt":3530},["ShallowReactive",2],{"content-/topics/engineering/rag-with-your-own-data-guide":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"category":5,"tags":11,"author":17,"featured":18,"series":19,"seriesOrder":20,"readingTime":21,"image":22,"body":23,"_type":3524,"_id":3525,"_source":3526,"_file":3527,"_stem":3528,"_extension":3529},"/topics/engineering/rag-with-your-own-data-guide","engineering",false,"","RAG 实战完全指南：用你自己的数据喂 AI，别再迷信微调","很多 AI 产品真正需要的不是把模型重新训练一遍，而是让它在回答前先读懂你的知识库。本文从检索链路、分块策略、向量索引、召回排序、上下文拼装到评测方法，系统讲清 RAG 怎么落地。","2026-03-08",[12,13,14,15,16],"RAG","向量数据库","AI检索","知识库","LLM应用","小明",true,"ai-integration-and-intelligent-applications",3,18,"/images/articles/rag-with-your-own-data-guide-cover.jpg",{"type":24,"children":25,"toc":3458},"root",[26,34,40,45,54,59,67,72,77,102,115,125,158,163,175,218,223,227,241,251,256,268,273,285,290,313,318,341,353,376,382,387,410,415,423,428,431,444,456,479,484,496,544,549,568,573,576,589,601,606,611,634,646,652,658,676,681,699,705,710,733,739,1348,1353,1356,1362,1368,1373,1378,1391,1396,1402,1407,1412,1435,1440,1463,1469,1474,1502,1514,1517,1530,1535,1553,1558,1576,1582,1587,1605,1610,1615,1633,1639,1881,1886,1904,1909,1912,1925,1930,1935,1940,1946,1951,1956,1964,1970,2298,2303,2309,2332,2335,2341,2353,2358,2364,2382,2388,2648,2653,2671,2676,2679,2692,2697,2702,2720,2732,2755,2761,2766,2779,2784,2802,2805,2811,2821,2826,2832,2838,2856,2862,2885,2891,2896,2914,2919,2937,2943,2948,2971,2983,2986,2992,2998,3003,3021,3026,3039,3045,3050,3055,3061,3066,3071,3089,3101,3104,3117,3127,3132,3155,3160,3173,3176,3189,3194,3229,3234,3274,3279,3310,3315,3346,3349,3354,3366,3421,3426,3439,3444,3452],{"type":27,"tag":28,"props":29,"children":31},"element","h1",{"id":30},"rag-实战完全指南用你自己的数据喂-ai别再迷信微调",[32],{"type":33,"value":8},"text",{"type":27,"tag":35,"props":36,"children":37},"p",{},[38],{"type":33,"value":39},"很多团队第一次做企业 AI，都会经历一个非常相似的阶段。",{"type":27,"tag":35,"props":41,"children":42},{},[43],{"type":33,"value":44},"业务方说：",{"type":27,"tag":46,"props":47,"children":48},"blockquote",{},[49],{"type":27,"tag":35,"props":50,"children":51},{},[52],{"type":33,"value":53},"我们有很多内部知识，能不能让模型学会？",{"type":27,"tag":35,"props":55,"children":56},{},[57],{"type":33,"value":58},"工程师脑子里马上浮现四个字：",{"type":27,"tag":46,"props":60,"children":61},{},[62],{"type":27,"tag":35,"props":63,"children":64},{},[65],{"type":33,"value":66},"微调模型。",{"type":27,"tag":35,"props":68,"children":69},{},[70],{"type":33,"value":71},"这很正常。因为“训练一下让它学会”听起来很符合直觉。",{"type":27,"tag":35,"props":73,"children":74},{},[75],{"type":33,"value":76},"但真实项目很快会告诉你，这条路没有想象中那么顺：",{"type":27,"tag":78,"props":79,"children":80},"ul",{},[81,87,92,97],{"type":27,"tag":82,"props":83,"children":84},"li",{},[85],{"type":33,"value":86},"数据不一定足够干净",{"type":27,"tag":82,"props":88,"children":89},{},[90],{"type":33,"value":91},"更新太频繁，根本不可能每次都重训",{"type":27,"tag":82,"props":93,"children":94},{},[95],{"type":33,"value":96},"你真正要解决的不是“模型不会说话”，而是“模型不知道你的资料放在哪”",{"type":27,"tag":82,"props":98,"children":99},{},[100],{"type":33,"value":101},"很多场景下，问题根本不是模型能力不够，而是上下文没给对",{"type":27,"tag":35,"props":103,"children":104},{},[105,107,113],{"type":33,"value":106},"这也是为什么过去两年里，真正落地最多的方案，不是盲目 fine-tune，而是 ",{"type":27,"tag":108,"props":109,"children":111},"code",{"className":110},[],[112],{"type":33,"value":12},{"type":33,"value":114},"。",{"type":27,"tag":35,"props":116,"children":117},{},[118,123],{"type":27,"tag":108,"props":119,"children":121},{"className":120},[],[122],{"type":33,"value":12},{"type":33,"value":124}," 这个词现在很热，但也很容易被讲得太玄。很多文章一上来就丢出一长串术语：",{"type":27,"tag":78,"props":126,"children":127},{},[128,133,138,143,148,153],{"type":27,"tag":82,"props":129,"children":130},{},[131],{"type":33,"value":132},"Embedding",{"type":27,"tag":82,"props":134,"children":135},{},[136],{"type":33,"value":137},"Chunking",{"type":27,"tag":82,"props":139,"children":140},{},[141],{"type":33,"value":142},"Vector DB",{"type":27,"tag":82,"props":144,"children":145},{},[146],{"type":33,"value":147},"Recall",{"type":27,"tag":82,"props":149,"children":150},{},[151],{"type":33,"value":152},"Rerank",{"type":27,"tag":82,"props":154,"children":155},{},[156],{"type":33,"value":157},"Context Window",{"type":27,"tag":35,"props":159,"children":160},{},[161],{"type":33,"value":162},"看完以后你大概率知道“这个东西挺复杂”，但还是不知道到底该怎么做。",{"type":27,"tag":35,"props":164,"children":165},{},[166,168,173],{"type":33,"value":167},"所以这篇文章不打算讲一堆漂亮概念，而是从工程落地角度，把 ",{"type":27,"tag":108,"props":169,"children":171},{"className":170},[],[172],{"type":33,"value":12},{"type":33,"value":174}," 拆成一条真正可操作的链路：",{"type":27,"tag":176,"props":177,"children":178},"ol",{},[179,191,196,201,206],{"type":27,"tag":82,"props":180,"children":181},{},[182,184,189],{"type":33,"value":183},"为什么很多知识型场景更适合 ",{"type":27,"tag":108,"props":185,"children":187},{"className":186},[],[188],{"type":33,"value":12},{"type":33,"value":190}," 而不是微调",{"type":27,"tag":82,"props":192,"children":193},{},[194],{"type":33,"value":195},"文档怎么切、索引怎么建、召回怎么做",{"type":27,"tag":82,"props":197,"children":198},{},[199],{"type":33,"value":200},"为什么“检索到了”不等于“回答就会变好”",{"type":27,"tag":82,"props":202,"children":203},{},[204],{"type":33,"value":205},"如何做重排、上下文拼装、引用溯源",{"type":27,"tag":82,"props":207,"children":208},{},[209,211,216],{"type":33,"value":210},"怎样评估一个 ",{"type":27,"tag":108,"props":212,"children":214},{"className":213},[],[215],{"type":33,"value":12},{"type":33,"value":217}," 系统到底是真的提升了准确率，还是只是在自我感动",{"type":27,"tag":35,"props":219,"children":220},{},[221],{"type":33,"value":222},"如果你准备做企业知识库、客服助手、内部问答、文档搜索，这篇会很实用。",{"type":27,"tag":224,"props":225,"children":226},"hr",{},[],{"type":27,"tag":228,"props":229,"children":231},"h2",{"id":230},"一先统一认知rag-解决的不是训练模型而是给模型找对材料",[232,234,239],{"type":33,"value":233},"一、先统一认知：",{"type":27,"tag":108,"props":235,"children":237},{"className":236},[],[238],{"type":33,"value":12},{"type":33,"value":240}," 解决的不是“训练模型”，而是“给模型找对材料”",{"type":27,"tag":35,"props":242,"children":243},{},[244,249],{"type":27,"tag":108,"props":245,"children":247},{"className":246},[],[248],{"type":33,"value":12},{"type":33,"value":250}," 的全称是 Retrieval-Augmented Generation，也就是“检索增强生成”。",{"type":27,"tag":35,"props":252,"children":253},{},[254],{"type":33,"value":255},"把它翻译成人话，核心其实就一句：",{"type":27,"tag":46,"props":257,"children":258},{},[259],{"type":27,"tag":35,"props":260,"children":261},{},[262],{"type":27,"tag":263,"props":264,"children":265},"strong",{},[266],{"type":33,"value":267},"在模型回答之前，先从你的资料库里把最相关的内容找出来，再交给模型回答。",{"type":27,"tag":35,"props":269,"children":270},{},[271],{"type":33,"value":272},"这件事的重要性在于，它绕开了很多“让模型自己记住一切”的幻想。",{"type":27,"tag":274,"props":275,"children":277},"h3",{"id":276},"_11-为什么很多场景更适合-rag",[278,280],{"type":33,"value":279},"1.1 为什么很多场景更适合 ",{"type":27,"tag":108,"props":281,"children":283},{"className":282},[],[284],{"type":33,"value":12},{"type":27,"tag":35,"props":286,"children":287},{},[288],{"type":33,"value":289},"比如你想做一个公司内部知识助手，它需要回答：",{"type":27,"tag":78,"props":291,"children":292},{},[293,298,303,308],{"type":27,"tag":82,"props":294,"children":295},{},[296],{"type":33,"value":297},"报销政策是什么？",{"type":27,"tag":82,"props":299,"children":300},{},[301],{"type":33,"value":302},"某个 API 的鉴权方式怎么接？",{"type":27,"tag":82,"props":304,"children":305},{},[306],{"type":33,"value":307},"退款流程有哪些特殊规则？",{"type":27,"tag":82,"props":309,"children":310},{},[311],{"type":33,"value":312},"去年版本的 SLA 承诺是多少？",{"type":27,"tag":35,"props":314,"children":315},{},[316],{"type":33,"value":317},"这些问题最大的特点不是“模型不会推理”，而是：",{"type":27,"tag":78,"props":319,"children":320},{},[321,326,331,336],{"type":27,"tag":82,"props":322,"children":323},{},[324],{"type":33,"value":325},"答案散落在你的文档里",{"type":27,"tag":82,"props":327,"children":328},{},[329],{"type":33,"value":330},"文档会不断更新",{"type":27,"tag":82,"props":332,"children":333},{},[334],{"type":33,"value":335},"你希望回答能引用来源",{"type":27,"tag":82,"props":337,"children":338},{},[339],{"type":33,"value":340},"你不能接受模型编一个“很像真的”答案",{"type":27,"tag":35,"props":342,"children":343},{},[344,346,351],{"type":33,"value":345},"这时候 ",{"type":27,"tag":108,"props":347,"children":349},{"className":348},[],[350],{"type":33,"value":12},{"type":33,"value":352}," 的价值就非常明显：",{"type":27,"tag":78,"props":354,"children":355},{},[356,361,366,371],{"type":27,"tag":82,"props":357,"children":358},{},[359],{"type":33,"value":360},"不需要频繁训练模型",{"type":27,"tag":82,"props":362,"children":363},{},[364],{"type":33,"value":365},"文档更新后，重新索引即可",{"type":27,"tag":82,"props":367,"children":368},{},[369],{"type":33,"value":370},"可以保留来源引用",{"type":27,"tag":82,"props":372,"children":373},{},[374],{"type":33,"value":375},"更容易控制回答依据",{"type":27,"tag":274,"props":377,"children":379},{"id":378},"_12-那微调什么时候有价值",[380],{"type":33,"value":381},"1.2 那微调什么时候有价值？",{"type":27,"tag":35,"props":383,"children":384},{},[385],{"type":33,"value":386},"微调并不是没用，它更适合：",{"type":27,"tag":78,"props":388,"children":389},{},[390,395,400,405],{"type":27,"tag":82,"props":391,"children":392},{},[393],{"type":33,"value":394},"固定输出风格",{"type":27,"tag":82,"props":396,"children":397},{},[398],{"type":33,"value":399},"某类任务的专门模式学习",{"type":27,"tag":82,"props":401,"children":402},{},[403],{"type":33,"value":404},"结构化任务精度提升",{"type":27,"tag":82,"props":406,"children":407},{},[408],{"type":33,"value":409},"特定领域表达习惯适配",{"type":27,"tag":35,"props":411,"children":412},{},[413],{"type":33,"value":414},"但如果你当前的核心问题是：",{"type":27,"tag":46,"props":416,"children":417},{},[418],{"type":27,"tag":35,"props":419,"children":420},{},[421],{"type":33,"value":422},"模型不知道你的知识库里有什么",{"type":27,"tag":35,"props":424,"children":425},{},[426],{"type":33,"value":427},"那第一优先级通常不是微调，而是把检索链路先建好。",{"type":27,"tag":224,"props":429,"children":430},{},[],{"type":27,"tag":228,"props":432,"children":434},{"id":433},"二一个-rag-系统到底由哪些部分组成",[435,437,442],{"type":33,"value":436},"二、一个 ",{"type":27,"tag":108,"props":438,"children":440},{"className":439},[],[441],{"type":33,"value":12},{"type":33,"value":443}," 系统到底由哪些部分组成",{"type":27,"tag":35,"props":445,"children":446},{},[447,449,454],{"type":33,"value":448},"很多团队说自己做了 ",{"type":27,"tag":108,"props":450,"children":452},{"className":451},[],[453],{"type":33,"value":12},{"type":33,"value":455},"，实际只是：",{"type":27,"tag":78,"props":457,"children":458},{},[459,464,469,474],{"type":27,"tag":82,"props":460,"children":461},{},[462],{"type":33,"value":463},"把文档丢进向量库",{"type":27,"tag":82,"props":465,"children":466},{},[467],{"type":33,"value":468},"用户一问，就 top-k 检索",{"type":27,"tag":82,"props":470,"children":471},{},[472],{"type":33,"value":473},"把结果拼进 prompt",{"type":27,"tag":82,"props":475,"children":476},{},[477],{"type":33,"value":478},"然后祈祷模型答得准一点",{"type":27,"tag":35,"props":480,"children":481},{},[482],{"type":33,"value":483},"这当然能跑，但距离“可用系统”还差很远。",{"type":27,"tag":35,"props":485,"children":486},{},[487,489,494],{"type":33,"value":488},"一个比较完整的 ",{"type":27,"tag":108,"props":490,"children":492},{"className":491},[],[493],{"type":33,"value":12},{"type":33,"value":495}," 链路至少包括：",{"type":27,"tag":176,"props":497,"children":498},{},[499,504,509,514,519,524,529,534,539],{"type":27,"tag":82,"props":500,"children":501},{},[502],{"type":33,"value":503},"文档采集",{"type":27,"tag":82,"props":505,"children":506},{},[507],{"type":33,"value":508},"清洗与切块",{"type":27,"tag":82,"props":510,"children":511},{},[512],{"type":33,"value":513},"向量化",{"type":27,"tag":82,"props":515,"children":516},{},[517],{"type":33,"value":518},"索引存储",{"type":27,"tag":82,"props":520,"children":521},{},[522],{"type":33,"value":523},"召回",{"type":27,"tag":82,"props":525,"children":526},{},[527],{"type":33,"value":528},"重排",{"type":27,"tag":82,"props":530,"children":531},{},[532],{"type":33,"value":533},"上下文拼装",{"type":27,"tag":82,"props":535,"children":536},{},[537],{"type":33,"value":538},"回答生成",{"type":27,"tag":82,"props":540,"children":541},{},[542],{"type":33,"value":543},"引用与评测",{"type":27,"tag":35,"props":545,"children":546},{},[547],{"type":33,"value":548},"你可以把它理解成两段能力：",{"type":27,"tag":78,"props":550,"children":551},{},[552,560],{"type":27,"tag":82,"props":553,"children":554},{},[555],{"type":27,"tag":263,"props":556,"children":557},{},[558],{"type":33,"value":559},"先找对材料",{"type":27,"tag":82,"props":561,"children":562},{},[563],{"type":27,"tag":263,"props":564,"children":565},{},[566],{"type":33,"value":567},"再基于材料说对话",{"type":27,"tag":35,"props":569,"children":570},{},[571],{"type":33,"value":572},"真正影响质量最大的，很多时候反而在第一段。",{"type":27,"tag":224,"props":574,"children":575},{},[],{"type":27,"tag":228,"props":577,"children":579},{"id":578},"三文档切块rag-第一个最容易被低估的问题",[580,582,587],{"type":33,"value":581},"三、文档切块：",{"type":27,"tag":108,"props":583,"children":585},{"className":584},[],[586],{"type":33,"value":12},{"type":33,"value":588}," 第一个最容易被低估的问题",{"type":27,"tag":35,"props":590,"children":591},{},[592,594,599],{"type":33,"value":593},"很多人做 ",{"type":27,"tag":108,"props":595,"children":597},{"className":596},[],[598],{"type":33,"value":12},{"type":33,"value":600}," 时，第一反应是“把整篇文档直接向量化”。",{"type":27,"tag":35,"props":602,"children":603},{},[604],{"type":33,"value":605},"这通常不太好。",{"type":27,"tag":35,"props":607,"children":608},{},[609],{"type":33,"value":610},"因为一篇完整文档往往：",{"type":27,"tag":78,"props":612,"children":613},{},[614,619,624,629],{"type":27,"tag":82,"props":615,"children":616},{},[617],{"type":33,"value":618},"太长",{"type":27,"tag":82,"props":620,"children":621},{},[622],{"type":33,"value":623},"主题太多",{"type":27,"tag":82,"props":625,"children":626},{},[627],{"type":33,"value":628},"局部信息密度不均",{"type":27,"tag":82,"props":630,"children":631},{},[632],{"type":33,"value":633},"用户问题通常只需要其中一小段",{"type":27,"tag":35,"props":635,"children":636},{},[637,639,645],{"type":33,"value":638},"所以实际工程里，几乎都会做 ",{"type":27,"tag":108,"props":640,"children":642},{"className":641},[],[643],{"type":33,"value":644},"chunking",{"type":33,"value":114},{"type":27,"tag":274,"props":647,"children":649},{"id":648},"_31-切太大和切太小都不行",[650],{"type":33,"value":651},"3.1 切太大和切太小都不行",{"type":27,"tag":653,"props":654,"children":656},"h4",{"id":655},"切太大",[657],{"type":33,"value":655},{"type":27,"tag":78,"props":659,"children":660},{},[661,666,671],{"type":27,"tag":82,"props":662,"children":663},{},[664],{"type":33,"value":665},"召回不够精准",{"type":27,"tag":82,"props":667,"children":668},{},[669],{"type":33,"value":670},"上下文浪费窗口",{"type":27,"tag":82,"props":672,"children":673},{},[674],{"type":33,"value":675},"结果容易混入无关信息",{"type":27,"tag":653,"props":677,"children":679},{"id":678},"切太小",[680],{"type":33,"value":678},{"type":27,"tag":78,"props":682,"children":683},{},[684,689,694],{"type":27,"tag":82,"props":685,"children":686},{},[687],{"type":33,"value":688},"语义断裂",{"type":27,"tag":82,"props":690,"children":691},{},[692],{"type":33,"value":693},"上下文不完整",{"type":27,"tag":82,"props":695,"children":696},{},[697],{"type":33,"value":698},"模型拿到一段“半截话”很难稳定作答",{"type":27,"tag":274,"props":700,"children":702},{"id":701},"_32-一个更务实的切块原则",[703],{"type":33,"value":704},"3.2 一个更务实的切块原则",{"type":27,"tag":35,"props":706,"children":707},{},[708],{"type":33,"value":709},"不要按固定字数机械切，而要优先按“语义完整单元”切，比如：",{"type":27,"tag":78,"props":711,"children":712},{},[713,718,723,728],{"type":27,"tag":82,"props":714,"children":715},{},[716],{"type":33,"value":717},"标题 + 段落",{"type":27,"tag":82,"props":719,"children":720},{},[721],{"type":33,"value":722},"FAQ 问答对",{"type":27,"tag":82,"props":724,"children":725},{},[726],{"type":33,"value":727},"API 文档中的单个接口说明",{"type":27,"tag":82,"props":729,"children":730},{},[731],{"type":33,"value":732},"表格和其对应解释段落",{"type":27,"tag":274,"props":734,"children":736},{"id":735},"_33-示例基于标题段落切块",[737],{"type":33,"value":738},"3.3 示例：基于标题段落切块",{"type":27,"tag":740,"props":741,"children":745},"pre",{"className":742,"code":743,"language":744,"meta":7,"style":7},"language-ts shiki shiki-themes github-dark","type Chunk = {\n  id: string\n  title: string\n  content: string\n  source: string\n}\n\nexport function splitBySection(doc: string, source: string): Chunk[] {\n  const sections = doc.split(/\\n##\\s+/)\n\n  return sections\n    .map((section, index) => {\n      const [firstLine, ...rest] = section.split('\\n')\n      return {\n        id: `${source}:${index}`,\n        title: firstLine.trim(),\n        content: rest.join('\\n').trim(),\n        source,\n      }\n    })\n    .filter(item => item.content.length > 80)\n}\n","ts",[746],{"type":27,"tag":108,"props":747,"children":748},{"__ignoreMap":7},[749,778,799,815,832,849,858,867,941,1009,1017,1031,1078,1151,1164,1201,1220,1263,1271,1280,1289,1340],{"type":27,"tag":750,"props":751,"children":754},"span",{"class":752,"line":753},"line",1,[755,761,767,772],{"type":27,"tag":750,"props":756,"children":758},{"style":757},"--shiki-default:#F97583",[759],{"type":33,"value":760},"type",{"type":27,"tag":750,"props":762,"children":764},{"style":763},"--shiki-default:#B392F0",[765],{"type":33,"value":766}," Chunk",{"type":27,"tag":750,"props":768,"children":769},{"style":757},[770],{"type":33,"value":771}," =",{"type":27,"tag":750,"props":773,"children":775},{"style":774},"--shiki-default:#E1E4E8",[776],{"type":33,"value":777}," {\n",{"type":27,"tag":750,"props":779,"children":781},{"class":752,"line":780},2,[782,788,793],{"type":27,"tag":750,"props":783,"children":785},{"style":784},"--shiki-default:#FFAB70",[786],{"type":33,"value":787},"  id",{"type":27,"tag":750,"props":789,"children":790},{"style":757},[791],{"type":33,"value":792},":",{"type":27,"tag":750,"props":794,"children":796},{"style":795},"--shiki-default:#79B8FF",[797],{"type":33,"value":798}," string\n",{"type":27,"tag":750,"props":800,"children":801},{"class":752,"line":20},[802,807,811],{"type":27,"tag":750,"props":803,"children":804},{"style":784},[805],{"type":33,"value":806},"  title",{"type":27,"tag":750,"props":808,"children":809},{"style":757},[810],{"type":33,"value":792},{"type":27,"tag":750,"props":812,"children":813},{"style":795},[814],{"type":33,"value":798},{"type":27,"tag":750,"props":816,"children":818},{"class":752,"line":817},4,[819,824,828],{"type":27,"tag":750,"props":820,"children":821},{"style":784},[822],{"type":33,"value":823},"  content",{"type":27,"tag":750,"props":825,"children":826},{"style":757},[827],{"type":33,"value":792},{"type":27,"tag":750,"props":829,"children":830},{"style":795},[831],{"type":33,"value":798},{"type":27,"tag":750,"props":833,"children":835},{"class":752,"line":834},5,[836,841,845],{"type":27,"tag":750,"props":837,"children":838},{"style":784},[839],{"type":33,"value":840},"  source",{"type":27,"tag":750,"props":842,"children":843},{"style":757},[844],{"type":33,"value":792},{"type":27,"tag":750,"props":846,"children":847},{"style":795},[848],{"type":33,"value":798},{"type":27,"tag":750,"props":850,"children":852},{"class":752,"line":851},6,[853],{"type":27,"tag":750,"props":854,"children":855},{"style":774},[856],{"type":33,"value":857},"}\n",{"type":27,"tag":750,"props":859,"children":861},{"class":752,"line":860},7,[862],{"type":27,"tag":750,"props":863,"children":864},{"emptyLinePlaceholder":18},[865],{"type":33,"value":866},"\n",{"type":27,"tag":750,"props":868,"children":870},{"class":752,"line":869},8,[871,876,881,886,891,896,900,905,910,915,919,923,928,932,936],{"type":27,"tag":750,"props":872,"children":873},{"style":757},[874],{"type":33,"value":875},"export",{"type":27,"tag":750,"props":877,"children":878},{"style":757},[879],{"type":33,"value":880}," function",{"type":27,"tag":750,"props":882,"children":883},{"style":763},[884],{"type":33,"value":885}," splitBySection",{"type":27,"tag":750,"props":887,"children":888},{"style":774},[889],{"type":33,"value":890},"(",{"type":27,"tag":750,"props":892,"children":893},{"style":784},[894],{"type":33,"value":895},"doc",{"type":27,"tag":750,"props":897,"children":898},{"style":757},[899],{"type":33,"value":792},{"type":27,"tag":750,"props":901,"children":902},{"style":795},[903],{"type":33,"value":904}," string",{"type":27,"tag":750,"props":906,"children":907},{"style":774},[908],{"type":33,"value":909},", ",{"type":27,"tag":750,"props":911,"children":912},{"style":784},[913],{"type":33,"value":914},"source",{"type":27,"tag":750,"props":916,"children":917},{"style":757},[918],{"type":33,"value":792},{"type":27,"tag":750,"props":920,"children":921},{"style":795},[922],{"type":33,"value":904},{"type":27,"tag":750,"props":924,"children":925},{"style":774},[926],{"type":33,"value":927},")",{"type":27,"tag":750,"props":929,"children":930},{"style":757},[931],{"type":33,"value":792},{"type":27,"tag":750,"props":933,"children":934},{"style":763},[935],{"type":33,"value":766},{"type":27,"tag":750,"props":937,"children":938},{"style":774},[939],{"type":33,"value":940},"[] {\n",{"type":27,"tag":750,"props":942,"children":944},{"class":752,"line":943},9,[945,950,955,959,964,969,973,979,984,990,995,1000,1004],{"type":27,"tag":750,"props":946,"children":947},{"style":757},[948],{"type":33,"value":949},"  const",{"type":27,"tag":750,"props":951,"children":952},{"style":795},[953],{"type":33,"value":954}," sections",{"type":27,"tag":750,"props":956,"children":957},{"style":757},[958],{"type":33,"value":771},{"type":27,"tag":750,"props":960,"children":961},{"style":774},[962],{"type":33,"value":963}," doc.",{"type":27,"tag":750,"props":965,"children":966},{"style":763},[967],{"type":33,"value":968},"split",{"type":27,"tag":750,"props":970,"children":971},{"style":774},[972],{"type":33,"value":890},{"type":27,"tag":750,"props":974,"children":976},{"style":975},"--shiki-default:#9ECBFF",[977],{"type":33,"value":978},"/",{"type":27,"tag":750,"props":980,"children":981},{"style":795},[982],{"type":33,"value":983},"\\n",{"type":27,"tag":750,"props":985,"children":987},{"style":986},"--shiki-default:#DBEDFF",[988],{"type":33,"value":989},"##",{"type":27,"tag":750,"props":991,"children":992},{"style":795},[993],{"type":33,"value":994},"\\s",{"type":27,"tag":750,"props":996,"children":997},{"style":757},[998],{"type":33,"value":999},"+",{"type":27,"tag":750,"props":1001,"children":1002},{"style":975},[1003],{"type":33,"value":978},{"type":27,"tag":750,"props":1005,"children":1006},{"style":774},[1007],{"type":33,"value":1008},")\n",{"type":27,"tag":750,"props":1010,"children":1012},{"class":752,"line":1011},10,[1013],{"type":27,"tag":750,"props":1014,"children":1015},{"emptyLinePlaceholder":18},[1016],{"type":33,"value":866},{"type":27,"tag":750,"props":1018,"children":1020},{"class":752,"line":1019},11,[1021,1026],{"type":27,"tag":750,"props":1022,"children":1023},{"style":757},[1024],{"type":33,"value":1025},"  return",{"type":27,"tag":750,"props":1027,"children":1028},{"style":774},[1029],{"type":33,"value":1030}," sections\n",{"type":27,"tag":750,"props":1032,"children":1034},{"class":752,"line":1033},12,[1035,1040,1045,1050,1055,1059,1064,1069,1074],{"type":27,"tag":750,"props":1036,"children":1037},{"style":774},[1038],{"type":33,"value":1039},"    .",{"type":27,"tag":750,"props":1041,"children":1042},{"style":763},[1043],{"type":33,"value":1044},"map",{"type":27,"tag":750,"props":1046,"children":1047},{"style":774},[1048],{"type":33,"value":1049},"((",{"type":27,"tag":750,"props":1051,"children":1052},{"style":784},[1053],{"type":33,"value":1054},"section",{"type":27,"tag":750,"props":1056,"children":1057},{"style":774},[1058],{"type":33,"value":909},{"type":27,"tag":750,"props":1060,"children":1061},{"style":784},[1062],{"type":33,"value":1063},"index",{"type":27,"tag":750,"props":1065,"children":1066},{"style":774},[1067],{"type":33,"value":1068},") ",{"type":27,"tag":750,"props":1070,"children":1071},{"style":757},[1072],{"type":33,"value":1073},"=>",{"type":27,"tag":750,"props":1075,"children":1076},{"style":774},[1077],{"type":33,"value":777},{"type":27,"tag":750,"props":1079,"children":1081},{"class":752,"line":1080},13,[1082,1087,1092,1097,1101,1106,1111,1116,1121,1126,1130,1134,1139,1143,1147],{"type":27,"tag":750,"props":1083,"children":1084},{"style":757},[1085],{"type":33,"value":1086},"      const",{"type":27,"tag":750,"props":1088,"children":1089},{"style":774},[1090],{"type":33,"value":1091}," [",{"type":27,"tag":750,"props":1093,"children":1094},{"style":795},[1095],{"type":33,"value":1096},"firstLine",{"type":27,"tag":750,"props":1098,"children":1099},{"style":774},[1100],{"type":33,"value":909},{"type":27,"tag":750,"props":1102,"children":1103},{"style":757},[1104],{"type":33,"value":1105},"...",{"type":27,"tag":750,"props":1107,"children":1108},{"style":795},[1109],{"type":33,"value":1110},"rest",{"type":27,"tag":750,"props":1112,"children":1113},{"style":774},[1114],{"type":33,"value":1115},"] ",{"type":27,"tag":750,"props":1117,"children":1118},{"style":757},[1119],{"type":33,"value":1120},"=",{"type":27,"tag":750,"props":1122,"children":1123},{"style":774},[1124],{"type":33,"value":1125}," section.",{"type":27,"tag":750,"props":1127,"children":1128},{"style":763},[1129],{"type":33,"value":968},{"type":27,"tag":750,"props":1131,"children":1132},{"style":774},[1133],{"type":33,"value":890},{"type":27,"tag":750,"props":1135,"children":1136},{"style":975},[1137],{"type":33,"value":1138},"'",{"type":27,"tag":750,"props":1140,"children":1141},{"style":795},[1142],{"type":33,"value":983},{"type":27,"tag":750,"props":1144,"children":1145},{"style":975},[1146],{"type":33,"value":1138},{"type":27,"tag":750,"props":1148,"children":1149},{"style":774},[1150],{"type":33,"value":1008},{"type":27,"tag":750,"props":1152,"children":1154},{"class":752,"line":1153},14,[1155,1160],{"type":27,"tag":750,"props":1156,"children":1157},{"style":757},[1158],{"type":33,"value":1159},"      return",{"type":27,"tag":750,"props":1161,"children":1162},{"style":774},[1163],{"type":33,"value":777},{"type":27,"tag":750,"props":1165,"children":1167},{"class":752,"line":1166},15,[1168,1173,1178,1182,1187,1191,1196],{"type":27,"tag":750,"props":1169,"children":1170},{"style":774},[1171],{"type":33,"value":1172},"        id: ",{"type":27,"tag":750,"props":1174,"children":1175},{"style":975},[1176],{"type":33,"value":1177},"`${",{"type":27,"tag":750,"props":1179,"children":1180},{"style":774},[1181],{"type":33,"value":914},{"type":27,"tag":750,"props":1183,"children":1184},{"style":975},[1185],{"type":33,"value":1186},"}:${",{"type":27,"tag":750,"props":1188,"children":1189},{"style":774},[1190],{"type":33,"value":1063},{"type":27,"tag":750,"props":1192,"children":1193},{"style":975},[1194],{"type":33,"value":1195},"}`",{"type":27,"tag":750,"props":1197,"children":1198},{"style":774},[1199],{"type":33,"value":1200},",\n",{"type":27,"tag":750,"props":1202,"children":1204},{"class":752,"line":1203},16,[1205,1210,1215],{"type":27,"tag":750,"props":1206,"children":1207},{"style":774},[1208],{"type":33,"value":1209},"        title: firstLine.",{"type":27,"tag":750,"props":1211,"children":1212},{"style":763},[1213],{"type":33,"value":1214},"trim",{"type":27,"tag":750,"props":1216,"children":1217},{"style":774},[1218],{"type":33,"value":1219},"(),\n",{"type":27,"tag":750,"props":1221,"children":1223},{"class":752,"line":1222},17,[1224,1229,1234,1238,1242,1246,1250,1255,1259],{"type":27,"tag":750,"props":1225,"children":1226},{"style":774},[1227],{"type":33,"value":1228},"        content: rest.",{"type":27,"tag":750,"props":1230,"children":1231},{"style":763},[1232],{"type":33,"value":1233},"join",{"type":27,"tag":750,"props":1235,"children":1236},{"style":774},[1237],{"type":33,"value":890},{"type":27,"tag":750,"props":1239,"children":1240},{"style":975},[1241],{"type":33,"value":1138},{"type":27,"tag":750,"props":1243,"children":1244},{"style":795},[1245],{"type":33,"value":983},{"type":27,"tag":750,"props":1247,"children":1248},{"style":975},[1249],{"type":33,"value":1138},{"type":27,"tag":750,"props":1251,"children":1252},{"style":774},[1253],{"type":33,"value":1254},").",{"type":27,"tag":750,"props":1256,"children":1257},{"style":763},[1258],{"type":33,"value":1214},{"type":27,"tag":750,"props":1260,"children":1261},{"style":774},[1262],{"type":33,"value":1219},{"type":27,"tag":750,"props":1264,"children":1265},{"class":752,"line":21},[1266],{"type":27,"tag":750,"props":1267,"children":1268},{"style":774},[1269],{"type":33,"value":1270},"        source,\n",{"type":27,"tag":750,"props":1272,"children":1274},{"class":752,"line":1273},19,[1275],{"type":27,"tag":750,"props":1276,"children":1277},{"style":774},[1278],{"type":33,"value":1279},"      }\n",{"type":27,"tag":750,"props":1281,"children":1283},{"class":752,"line":1282},20,[1284],{"type":27,"tag":750,"props":1285,"children":1286},{"style":774},[1287],{"type":33,"value":1288},"    })\n",{"type":27,"tag":750,"props":1290,"children":1292},{"class":752,"line":1291},21,[1293,1297,1302,1306,1311,1316,1321,1326,1331,1336],{"type":27,"tag":750,"props":1294,"children":1295},{"style":774},[1296],{"type":33,"value":1039},{"type":27,"tag":750,"props":1298,"children":1299},{"style":763},[1300],{"type":33,"value":1301},"filter",{"type":27,"tag":750,"props":1303,"children":1304},{"style":774},[1305],{"type":33,"value":890},{"type":27,"tag":750,"props":1307,"children":1308},{"style":784},[1309],{"type":33,"value":1310},"item",{"type":27,"tag":750,"props":1312,"children":1313},{"style":757},[1314],{"type":33,"value":1315}," =>",{"type":27,"tag":750,"props":1317,"children":1318},{"style":774},[1319],{"type":33,"value":1320}," item.content.",{"type":27,"tag":750,"props":1322,"children":1323},{"style":795},[1324],{"type":33,"value":1325},"length",{"type":27,"tag":750,"props":1327,"children":1328},{"style":757},[1329],{"type":33,"value":1330}," >",{"type":27,"tag":750,"props":1332,"children":1333},{"style":795},[1334],{"type":33,"value":1335}," 80",{"type":27,"tag":750,"props":1337,"children":1338},{"style":774},[1339],{"type":33,"value":1008},{"type":27,"tag":750,"props":1341,"children":1343},{"class":752,"line":1342},22,[1344],{"type":27,"tag":750,"props":1345,"children":1346},{"style":774},[1347],{"type":33,"value":857},{"type":27,"tag":35,"props":1349,"children":1350},{},[1351],{"type":33,"value":1352},"这不是最高级的切法，但已经比“每 1000 字砍一刀”靠谱很多。",{"type":27,"tag":224,"props":1354,"children":1355},{},[],{"type":27,"tag":228,"props":1357,"children":1359},{"id":1358},"四embedding-和向量库别把它想成黑盒魔法",[1360],{"type":33,"value":1361},"四、Embedding 和向量库：别把它想成黑盒魔法",{"type":27,"tag":274,"props":1363,"children":1365},{"id":1364},"_41-embedding-在干什么",[1366],{"type":33,"value":1367},"4.1 Embedding 在干什么",{"type":27,"tag":35,"props":1369,"children":1370},{},[1371],{"type":33,"value":1372},"简单说，Embedding 会把一段文本映射成一个向量，让“语义相近”的内容在向量空间里也更靠近。",{"type":27,"tag":35,"props":1374,"children":1375},{},[1376],{"type":33,"value":1377},"这意味着：",{"type":27,"tag":78,"props":1379,"children":1380},{},[1381,1386],{"type":27,"tag":82,"props":1382,"children":1383},{},[1384],{"type":33,"value":1385},"用户问“退款多久到账”",{"type":27,"tag":82,"props":1387,"children":1388},{},[1389],{"type":33,"value":1390},"文档里写的是“退款预计在 3-5 个工作日原路返回”",{"type":27,"tag":35,"props":1392,"children":1393},{},[1394],{"type":33,"value":1395},"即使词面不完全一样，系统也有机会把它们匹配出来。",{"type":27,"tag":274,"props":1397,"children":1399},{"id":1398},"_42-向量库到底在解决什么",[1400],{"type":33,"value":1401},"4.2 向量库到底在解决什么",{"type":27,"tag":35,"props":1403,"children":1404},{},[1405],{"type":33,"value":1406},"当你有几百、几千甚至几十万段切块时，不可能每次全量比对。",{"type":27,"tag":35,"props":1408,"children":1409},{},[1410],{"type":33,"value":1411},"向量数据库的价值在于：",{"type":27,"tag":78,"props":1413,"children":1414},{},[1415,1420,1425,1430],{"type":27,"tag":82,"props":1416,"children":1417},{},[1418],{"type":33,"value":1419},"高效存储向量",{"type":27,"tag":82,"props":1421,"children":1422},{},[1423],{"type":33,"value":1424},"快速做相似度检索",{"type":27,"tag":82,"props":1426,"children":1427},{},[1428],{"type":33,"value":1429},"支持 metadata 过滤",{"type":27,"tag":82,"props":1431,"children":1432},{},[1433],{"type":33,"value":1434},"支持混合检索和扩展查询",{"type":27,"tag":35,"props":1436,"children":1437},{},[1438],{"type":33,"value":1439},"常见选项有：",{"type":27,"tag":78,"props":1441,"children":1442},{},[1443,1448,1453,1458],{"type":27,"tag":82,"props":1444,"children":1445},{},[1446],{"type":33,"value":1447},"Pinecone",{"type":27,"tag":82,"props":1449,"children":1450},{},[1451],{"type":33,"value":1452},"Weaviate",{"type":27,"tag":82,"props":1454,"children":1455},{},[1456],{"type":33,"value":1457},"Milvus",{"type":27,"tag":82,"props":1459,"children":1460},{},[1461],{"type":33,"value":1462},"pgvector",{"type":27,"tag":274,"props":1464,"children":1466},{"id":1465},"_43-选型时不要只看性能榜单",[1467],{"type":33,"value":1468},"4.3 选型时不要只看性能榜单",{"type":27,"tag":35,"props":1470,"children":1471},{},[1472],{"type":33,"value":1473},"你更应该关心：",{"type":27,"tag":78,"props":1475,"children":1476},{},[1477,1482,1487,1492,1497],{"type":27,"tag":82,"props":1478,"children":1479},{},[1480],{"type":33,"value":1481},"你的数据量多大",{"type":27,"tag":82,"props":1483,"children":1484},{},[1485],{"type":33,"value":1486},"是否需要 metadata 过滤",{"type":27,"tag":82,"props":1488,"children":1489},{},[1490],{"type":33,"value":1491},"是否已有 PostgreSQL 技术栈",{"type":27,"tag":82,"props":1493,"children":1494},{},[1495],{"type":33,"value":1496},"是否需要托管服务",{"type":27,"tag":82,"props":1498,"children":1499},{},[1500],{"type":33,"value":1501},"查询延迟和成本能否接受",{"type":27,"tag":35,"props":1503,"children":1504},{},[1505,1507,1512],{"type":33,"value":1506},"很多团队早期用 ",{"type":27,"tag":108,"props":1508,"children":1510},{"className":1509},[],[1511],{"type":33,"value":1462},{"type":33,"value":1513}," 就够了，不一定一上来就要专门的向量平台。",{"type":27,"tag":224,"props":1515,"children":1516},{},[],{"type":27,"tag":228,"props":1518,"children":1520},{"id":1519},"五召回不是-top-k-一把梭很多-rag-差就差在这里",[1521,1523,1528],{"type":33,"value":1522},"五、召回不是 top-k 一把梭：很多 ",{"type":27,"tag":108,"props":1524,"children":1526},{"className":1525},[],[1527],{"type":33,"value":12},{"type":33,"value":1529}," 差，就差在这里",{"type":27,"tag":35,"props":1531,"children":1532},{},[1533],{"type":33,"value":1534},"最常见的入门写法是：",{"type":27,"tag":176,"props":1536,"children":1537},{},[1538,1543,1548],{"type":27,"tag":82,"props":1539,"children":1540},{},[1541],{"type":33,"value":1542},"把用户问题 embedding",{"type":27,"tag":82,"props":1544,"children":1545},{},[1546],{"type":33,"value":1547},"查 top 5",{"type":27,"tag":82,"props":1549,"children":1550},{},[1551],{"type":33,"value":1552},"拼进 prompt",{"type":27,"tag":35,"props":1554,"children":1555},{},[1556],{"type":33,"value":1557},"这当然能跑，但质量经常不稳定。原因在于：",{"type":27,"tag":78,"props":1559,"children":1560},{},[1561,1566,1571],{"type":27,"tag":82,"props":1562,"children":1563},{},[1564],{"type":33,"value":1565},"纯向量召回不一定抓住关键词约束",{"type":27,"tag":82,"props":1567,"children":1568},{},[1569],{"type":33,"value":1570},"问题表达和文档表达方式可能差很多",{"type":27,"tag":82,"props":1572,"children":1573},{},[1574],{"type":33,"value":1575},"top-k 里常混进“有点像但不够准”的片段",{"type":27,"tag":274,"props":1577,"children":1579},{"id":1578},"_51-真实工程里更常见的是混合检索",[1580],{"type":33,"value":1581},"5.1 真实工程里更常见的是混合检索",{"type":27,"tag":35,"props":1583,"children":1584},{},[1585],{"type":33,"value":1586},"也就是把：",{"type":27,"tag":78,"props":1588,"children":1589},{},[1590,1595,1600],{"type":27,"tag":82,"props":1591,"children":1592},{},[1593],{"type":33,"value":1594},"关键词检索",{"type":27,"tag":82,"props":1596,"children":1597},{},[1598],{"type":33,"value":1599},"向量召回",{"type":27,"tag":82,"props":1601,"children":1602},{},[1603],{"type":33,"value":1604},"metadata 过滤",{"type":27,"tag":35,"props":1606,"children":1607},{},[1608],{"type":33,"value":1609},"结合起来。",{"type":27,"tag":35,"props":1611,"children":1612},{},[1613],{"type":33,"value":1614},"例如：",{"type":27,"tag":78,"props":1616,"children":1617},{},[1618,1623,1628],{"type":27,"tag":82,"props":1619,"children":1620},{},[1621],{"type":33,"value":1622},"先按知识域过滤：只查“财务制度”文档",{"type":27,"tag":82,"props":1624,"children":1625},{},[1626],{"type":33,"value":1627},"再做向量召回",{"type":27,"tag":82,"props":1629,"children":1630},{},[1631],{"type":33,"value":1632},"再做 BM25 关键词补充",{"type":27,"tag":274,"props":1634,"children":1636},{"id":1635},"_52-一个简化的检索流程",[1637],{"type":33,"value":1638},"5.2 一个简化的检索流程",{"type":27,"tag":740,"props":1640,"children":1642},{"className":742,"code":1641,"language":744,"meta":7,"style":7},"export async function retrieveDocs(query: string, domain?: string) {\n  const denseResults = await vectorStore.search(query, {\n    topK: 12,\n    filter: domain ? { domain } : undefined,\n  })\n\n  const sparseResults = await keywordSearch.search(query, { topK: 8, domain })\n\n  return mergeAndDeduplicate(denseResults, sparseResults)\n}\n",[1643],{"type":27,"tag":108,"props":1644,"children":1645},{"__ignoreMap":7},[1646,1707,1743,1760,1791,1799,1806,1850,1857,1874],{"type":27,"tag":750,"props":1647,"children":1648},{"class":752,"line":753},[1649,1653,1658,1662,1667,1671,1676,1680,1684,1688,1693,1698,1702],{"type":27,"tag":750,"props":1650,"children":1651},{"style":757},[1652],{"type":33,"value":875},{"type":27,"tag":750,"props":1654,"children":1655},{"style":757},[1656],{"type":33,"value":1657}," async",{"type":27,"tag":750,"props":1659,"children":1660},{"style":757},[1661],{"type":33,"value":880},{"type":27,"tag":750,"props":1663,"children":1664},{"style":763},[1665],{"type":33,"value":1666}," retrieveDocs",{"type":27,"tag":750,"props":1668,"children":1669},{"style":774},[1670],{"type":33,"value":890},{"type":27,"tag":750,"props":1672,"children":1673},{"style":784},[1674],{"type":33,"value":1675},"query",{"type":27,"tag":750,"props":1677,"children":1678},{"style":757},[1679],{"type":33,"value":792},{"type":27,"tag":750,"props":1681,"children":1682},{"style":795},[1683],{"type":33,"value":904},{"type":27,"tag":750,"props":1685,"children":1686},{"style":774},[1687],{"type":33,"value":909},{"type":27,"tag":750,"props":1689,"children":1690},{"style":784},[1691],{"type":33,"value":1692},"domain",{"type":27,"tag":750,"props":1694,"children":1695},{"style":757},[1696],{"type":33,"value":1697},"?:",{"type":27,"tag":750,"props":1699,"children":1700},{"style":795},[1701],{"type":33,"value":904},{"type":27,"tag":750,"props":1703,"children":1704},{"style":774},[1705],{"type":33,"value":1706},") {\n",{"type":27,"tag":750,"props":1708,"children":1709},{"class":752,"line":780},[1710,1714,1719,1723,1728,1733,1738],{"type":27,"tag":750,"props":1711,"children":1712},{"style":757},[1713],{"type":33,"value":949},{"type":27,"tag":750,"props":1715,"children":1716},{"style":795},[1717],{"type":33,"value":1718}," denseResults",{"type":27,"tag":750,"props":1720,"children":1721},{"style":757},[1722],{"type":33,"value":771},{"type":27,"tag":750,"props":1724,"children":1725},{"style":757},[1726],{"type":33,"value":1727}," await",{"type":27,"tag":750,"props":1729,"children":1730},{"style":774},[1731],{"type":33,"value":1732}," vectorStore.",{"type":27,"tag":750,"props":1734,"children":1735},{"style":763},[1736],{"type":33,"value":1737},"search",{"type":27,"tag":750,"props":1739,"children":1740},{"style":774},[1741],{"type":33,"value":1742},"(query, {\n",{"type":27,"tag":750,"props":1744,"children":1745},{"class":752,"line":20},[1746,1751,1756],{"type":27,"tag":750,"props":1747,"children":1748},{"style":774},[1749],{"type":33,"value":1750},"    topK: ",{"type":27,"tag":750,"props":1752,"children":1753},{"style":795},[1754],{"type":33,"value":1755},"12",{"type":27,"tag":750,"props":1757,"children":1758},{"style":774},[1759],{"type":33,"value":1200},{"type":27,"tag":750,"props":1761,"children":1762},{"class":752,"line":817},[1763,1768,1773,1778,1782,1787],{"type":27,"tag":750,"props":1764,"children":1765},{"style":774},[1766],{"type":33,"value":1767},"    filter: domain ",{"type":27,"tag":750,"props":1769,"children":1770},{"style":757},[1771],{"type":33,"value":1772},"?",{"type":27,"tag":750,"props":1774,"children":1775},{"style":774},[1776],{"type":33,"value":1777}," { domain } ",{"type":27,"tag":750,"props":1779,"children":1780},{"style":757},[1781],{"type":33,"value":792},{"type":27,"tag":750,"props":1783,"children":1784},{"style":795},[1785],{"type":33,"value":1786}," undefined",{"type":27,"tag":750,"props":1788,"children":1789},{"style":774},[1790],{"type":33,"value":1200},{"type":27,"tag":750,"props":1792,"children":1793},{"class":752,"line":834},[1794],{"type":27,"tag":750,"props":1795,"children":1796},{"style":774},[1797],{"type":33,"value":1798},"  })\n",{"type":27,"tag":750,"props":1800,"children":1801},{"class":752,"line":851},[1802],{"type":27,"tag":750,"props":1803,"children":1804},{"emptyLinePlaceholder":18},[1805],{"type":33,"value":866},{"type":27,"tag":750,"props":1807,"children":1808},{"class":752,"line":860},[1809,1813,1818,1822,1826,1831,1835,1840,1845],{"type":27,"tag":750,"props":1810,"children":1811},{"style":757},[1812],{"type":33,"value":949},{"type":27,"tag":750,"props":1814,"children":1815},{"style":795},[1816],{"type":33,"value":1817}," sparseResults",{"type":27,"tag":750,"props":1819,"children":1820},{"style":757},[1821],{"type":33,"value":771},{"type":27,"tag":750,"props":1823,"children":1824},{"style":757},[1825],{"type":33,"value":1727},{"type":27,"tag":750,"props":1827,"children":1828},{"style":774},[1829],{"type":33,"value":1830}," keywordSearch.",{"type":27,"tag":750,"props":1832,"children":1833},{"style":763},[1834],{"type":33,"value":1737},{"type":27,"tag":750,"props":1836,"children":1837},{"style":774},[1838],{"type":33,"value":1839},"(query, { topK: ",{"type":27,"tag":750,"props":1841,"children":1842},{"style":795},[1843],{"type":33,"value":1844},"8",{"type":27,"tag":750,"props":1846,"children":1847},{"style":774},[1848],{"type":33,"value":1849},", domain })\n",{"type":27,"tag":750,"props":1851,"children":1852},{"class":752,"line":869},[1853],{"type":27,"tag":750,"props":1854,"children":1855},{"emptyLinePlaceholder":18},[1856],{"type":33,"value":866},{"type":27,"tag":750,"props":1858,"children":1859},{"class":752,"line":943},[1860,1864,1869],{"type":27,"tag":750,"props":1861,"children":1862},{"style":757},[1863],{"type":33,"value":1025},{"type":27,"tag":750,"props":1865,"children":1866},{"style":763},[1867],{"type":33,"value":1868}," mergeAndDeduplicate",{"type":27,"tag":750,"props":1870,"children":1871},{"style":774},[1872],{"type":33,"value":1873},"(denseResults, sparseResults)\n",{"type":27,"tag":750,"props":1875,"children":1876},{"class":752,"line":1011},[1877],{"type":27,"tag":750,"props":1878,"children":1879},{"style":774},[1880],{"type":33,"value":857},{"type":27,"tag":35,"props":1882,"children":1883},{},[1884],{"type":33,"value":1885},"这类“混合召回”通常比纯向量检索更稳，尤其在：",{"type":27,"tag":78,"props":1887,"children":1888},{},[1889,1894,1899],{"type":27,"tag":82,"props":1890,"children":1891},{},[1892],{"type":33,"value":1893},"专有名词很多",{"type":27,"tag":82,"props":1895,"children":1896},{},[1897],{"type":33,"value":1898},"编号和术语重要",{"type":27,"tag":82,"props":1900,"children":1901},{},[1902],{"type":33,"value":1903},"文档格式结构化明显",{"type":27,"tag":35,"props":1905,"children":1906},{},[1907],{"type":33,"value":1908},"的场景里。",{"type":27,"tag":224,"props":1910,"children":1911},{},[],{"type":27,"tag":228,"props":1913,"children":1915},{"id":1914},"六重排rerankrag-提升质量最值钱的一步之一",[1916,1918,1923],{"type":33,"value":1917},"六、重排（Rerank）：",{"type":27,"tag":108,"props":1919,"children":1921},{"className":1920},[],[1922],{"type":33,"value":12},{"type":33,"value":1924}," 提升质量最值钱的一步之一",{"type":27,"tag":35,"props":1926,"children":1927},{},[1928],{"type":33,"value":1929},"很多人做完召回后直接把 top-k 塞给模型。",{"type":27,"tag":35,"props":1931,"children":1932},{},[1933],{"type":33,"value":1934},"问题是，召回的目标通常是“别漏掉”，而不是“顺序一定最准”。",{"type":27,"tag":35,"props":1936,"children":1937},{},[1938],{"type":33,"value":1939},"这时候就需要 rerank。",{"type":27,"tag":274,"props":1941,"children":1943},{"id":1942},"_61-为什么-rerank-很关键",[1944],{"type":33,"value":1945},"6.1 为什么 rerank 很关键",{"type":27,"tag":35,"props":1947,"children":1948},{},[1949],{"type":33,"value":1950},"因为生成模型上下文窗口有限。你不可能把 30 段都塞进去。",{"type":27,"tag":35,"props":1952,"children":1953},{},[1954],{"type":33,"value":1955},"所以你真正需要的是：",{"type":27,"tag":46,"props":1957,"children":1958},{},[1959],{"type":27,"tag":35,"props":1960,"children":1961},{},[1962],{"type":33,"value":1963},"从“可能相关”的候选里，再挑出“最值得进入上下文”的几段。",{"type":27,"tag":274,"props":1965,"children":1967},{"id":1966},"_62-一个简单的重排思路",[1968],{"type":33,"value":1969},"6.2 一个简单的重排思路",{"type":27,"tag":740,"props":1971,"children":1973},{"className":742,"code":1972,"language":744,"meta":7,"style":7},"type RetrievedDoc = {\n  id: string\n  content: string\n  score: number\n}\n\nexport async function rerank(query: string, docs: RetrievedDoc[]) {\n  return docs\n    .map(doc => ({\n      ...doc,\n      rerankScore: lexicalBoost(query, doc.content) + doc.score,\n    }))\n    .sort((a, b) => b.rerankScore - a.rerankScore)\n    .slice(0, 5)\n}\n",[1974],{"type":27,"tag":108,"props":1975,"children":1976},{"__ignoreMap":7},[1977,1997,2012,2027,2044,2051,2058,2116,2128,2156,2169,2196,2204,2257,2291],{"type":27,"tag":750,"props":1978,"children":1979},{"class":752,"line":753},[1980,1984,1989,1993],{"type":27,"tag":750,"props":1981,"children":1982},{"style":757},[1983],{"type":33,"value":760},{"type":27,"tag":750,"props":1985,"children":1986},{"style":763},[1987],{"type":33,"value":1988}," RetrievedDoc",{"type":27,"tag":750,"props":1990,"children":1991},{"style":757},[1992],{"type":33,"value":771},{"type":27,"tag":750,"props":1994,"children":1995},{"style":774},[1996],{"type":33,"value":777},{"type":27,"tag":750,"props":1998,"children":1999},{"class":752,"line":780},[2000,2004,2008],{"type":27,"tag":750,"props":2001,"children":2002},{"style":784},[2003],{"type":33,"value":787},{"type":27,"tag":750,"props":2005,"children":2006},{"style":757},[2007],{"type":33,"value":792},{"type":27,"tag":750,"props":2009,"children":2010},{"style":795},[2011],{"type":33,"value":798},{"type":27,"tag":750,"props":2013,"children":2014},{"class":752,"line":20},[2015,2019,2023],{"type":27,"tag":750,"props":2016,"children":2017},{"style":784},[2018],{"type":33,"value":823},{"type":27,"tag":750,"props":2020,"children":2021},{"style":757},[2022],{"type":33,"value":792},{"type":27,"tag":750,"props":2024,"children":2025},{"style":795},[2026],{"type":33,"value":798},{"type":27,"tag":750,"props":2028,"children":2029},{"class":752,"line":817},[2030,2035,2039],{"type":27,"tag":750,"props":2031,"children":2032},{"style":784},[2033],{"type":33,"value":2034},"  score",{"type":27,"tag":750,"props":2036,"children":2037},{"style":757},[2038],{"type":33,"value":792},{"type":27,"tag":750,"props":2040,"children":2041},{"style":795},[2042],{"type":33,"value":2043}," number\n",{"type":27,"tag":750,"props":2045,"children":2046},{"class":752,"line":834},[2047],{"type":27,"tag":750,"props":2048,"children":2049},{"style":774},[2050],{"type":33,"value":857},{"type":27,"tag":750,"props":2052,"children":2053},{"class":752,"line":851},[2054],{"type":27,"tag":750,"props":2055,"children":2056},{"emptyLinePlaceholder":18},[2057],{"type":33,"value":866},{"type":27,"tag":750,"props":2059,"children":2060},{"class":752,"line":860},[2061,2065,2069,2073,2078,2082,2086,2090,2094,2098,2103,2107,2111],{"type":27,"tag":750,"props":2062,"children":2063},{"style":757},[2064],{"type":33,"value":875},{"type":27,"tag":750,"props":2066,"children":2067},{"style":757},[2068],{"type":33,"value":1657},{"type":27,"tag":750,"props":2070,"children":2071},{"style":757},[2072],{"type":33,"value":880},{"type":27,"tag":750,"props":2074,"children":2075},{"style":763},[2076],{"type":33,"value":2077}," rerank",{"type":27,"tag":750,"props":2079,"children":2080},{"style":774},[2081],{"type":33,"value":890},{"type":27,"tag":750,"props":2083,"children":2084},{"style":784},[2085],{"type":33,"value":1675},{"type":27,"tag":750,"props":2087,"children":2088},{"style":757},[2089],{"type":33,"value":792},{"type":27,"tag":750,"props":2091,"children":2092},{"style":795},[2093],{"type":33,"value":904},{"type":27,"tag":750,"props":2095,"children":2096},{"style":774},[2097],{"type":33,"value":909},{"type":27,"tag":750,"props":2099,"children":2100},{"style":784},[2101],{"type":33,"value":2102},"docs",{"type":27,"tag":750,"props":2104,"children":2105},{"style":757},[2106],{"type":33,"value":792},{"type":27,"tag":750,"props":2108,"children":2109},{"style":763},[2110],{"type":33,"value":1988},{"type":27,"tag":750,"props":2112,"children":2113},{"style":774},[2114],{"type":33,"value":2115},"[]) {\n",{"type":27,"tag":750,"props":2117,"children":2118},{"class":752,"line":869},[2119,2123],{"type":27,"tag":750,"props":2120,"children":2121},{"style":757},[2122],{"type":33,"value":1025},{"type":27,"tag":750,"props":2124,"children":2125},{"style":774},[2126],{"type":33,"value":2127}," docs\n",{"type":27,"tag":750,"props":2129,"children":2130},{"class":752,"line":943},[2131,2135,2139,2143,2147,2151],{"type":27,"tag":750,"props":2132,"children":2133},{"style":774},[2134],{"type":33,"value":1039},{"type":27,"tag":750,"props":2136,"children":2137},{"style":763},[2138],{"type":33,"value":1044},{"type":27,"tag":750,"props":2140,"children":2141},{"style":774},[2142],{"type":33,"value":890},{"type":27,"tag":750,"props":2144,"children":2145},{"style":784},[2146],{"type":33,"value":895},{"type":27,"tag":750,"props":2148,"children":2149},{"style":757},[2150],{"type":33,"value":1315},{"type":27,"tag":750,"props":2152,"children":2153},{"style":774},[2154],{"type":33,"value":2155}," ({\n",{"type":27,"tag":750,"props":2157,"children":2158},{"class":752,"line":1011},[2159,2164],{"type":27,"tag":750,"props":2160,"children":2161},{"style":757},[2162],{"type":33,"value":2163},"      ...",{"type":27,"tag":750,"props":2165,"children":2166},{"style":774},[2167],{"type":33,"value":2168},"doc,\n",{"type":27,"tag":750,"props":2170,"children":2171},{"class":752,"line":1019},[2172,2177,2182,2187,2191],{"type":27,"tag":750,"props":2173,"children":2174},{"style":774},[2175],{"type":33,"value":2176},"      rerankScore: ",{"type":27,"tag":750,"props":2178,"children":2179},{"style":763},[2180],{"type":33,"value":2181},"lexicalBoost",{"type":27,"tag":750,"props":2183,"children":2184},{"style":774},[2185],{"type":33,"value":2186},"(query, doc.content) ",{"type":27,"tag":750,"props":2188,"children":2189},{"style":757},[2190],{"type":33,"value":999},{"type":27,"tag":750,"props":2192,"children":2193},{"style":774},[2194],{"type":33,"value":2195}," doc.score,\n",{"type":27,"tag":750,"props":2197,"children":2198},{"class":752,"line":1033},[2199],{"type":27,"tag":750,"props":2200,"children":2201},{"style":774},[2202],{"type":33,"value":2203},"    }))\n",{"type":27,"tag":750,"props":2205,"children":2206},{"class":752,"line":1080},[2207,2211,2216,2220,2225,2229,2234,2238,2242,2247,2252],{"type":27,"tag":750,"props":2208,"children":2209},{"style":774},[2210],{"type":33,"value":1039},{"type":27,"tag":750,"props":2212,"children":2213},{"style":763},[2214],{"type":33,"value":2215},"sort",{"type":27,"tag":750,"props":2217,"children":2218},{"style":774},[2219],{"type":33,"value":1049},{"type":27,"tag":750,"props":2221,"children":2222},{"style":784},[2223],{"type":33,"value":2224},"a",{"type":27,"tag":750,"props":2226,"children":2227},{"style":774},[2228],{"type":33,"value":909},{"type":27,"tag":750,"props":2230,"children":2231},{"style":784},[2232],{"type":33,"value":2233},"b",{"type":27,"tag":750,"props":2235,"children":2236},{"style":774},[2237],{"type":33,"value":1068},{"type":27,"tag":750,"props":2239,"children":2240},{"style":757},[2241],{"type":33,"value":1073},{"type":27,"tag":750,"props":2243,"children":2244},{"style":774},[2245],{"type":33,"value":2246}," b.rerankScore ",{"type":27,"tag":750,"props":2248,"children":2249},{"style":757},[2250],{"type":33,"value":2251},"-",{"type":27,"tag":750,"props":2253,"children":2254},{"style":774},[2255],{"type":33,"value":2256}," a.rerankScore)\n",{"type":27,"tag":750,"props":2258,"children":2259},{"class":752,"line":1153},[2260,2264,2269,2273,2278,2282,2287],{"type":27,"tag":750,"props":2261,"children":2262},{"style":774},[2263],{"type":33,"value":1039},{"type":27,"tag":750,"props":2265,"children":2266},{"style":763},[2267],{"type":33,"value":2268},"slice",{"type":27,"tag":750,"props":2270,"children":2271},{"style":774},[2272],{"type":33,"value":890},{"type":27,"tag":750,"props":2274,"children":2275},{"style":795},[2276],{"type":33,"value":2277},"0",{"type":27,"tag":750,"props":2279,"children":2280},{"style":774},[2281],{"type":33,"value":909},{"type":27,"tag":750,"props":2283,"children":2284},{"style":795},[2285],{"type":33,"value":2286},"5",{"type":27,"tag":750,"props":2288,"children":2289},{"style":774},[2290],{"type":33,"value":1008},{"type":27,"tag":750,"props":2292,"children":2293},{"class":752,"line":1166},[2294],{"type":27,"tag":750,"props":2295,"children":2296},{"style":774},[2297],{"type":33,"value":857},{"type":27,"tag":35,"props":2299,"children":2300},{},[2301],{"type":33,"value":2302},"实际生产里可以用专门 reranker，也可以先用轻量规则做第一版。",{"type":27,"tag":274,"props":2304,"children":2306},{"id":2305},"_63-哪些场景特别需要-rerank",[2307],{"type":33,"value":2308},"6.3 哪些场景特别需要 rerank",{"type":27,"tag":78,"props":2310,"children":2311},{},[2312,2317,2322,2327],{"type":27,"tag":82,"props":2313,"children":2314},{},[2315],{"type":33,"value":2316},"候选文档很多",{"type":27,"tag":82,"props":2318,"children":2319},{},[2320],{"type":33,"value":2321},"不同文档语义都“有点像”",{"type":27,"tag":82,"props":2323,"children":2324},{},[2325],{"type":33,"value":2326},"用户问题很短，歧义大",{"type":27,"tag":82,"props":2328,"children":2329},{},[2330],{"type":33,"value":2331},"需要更高引用准确率",{"type":27,"tag":224,"props":2333,"children":2334},{},[],{"type":27,"tag":228,"props":2336,"children":2338},{"id":2337},"七上下文拼装不是把检索结果贴进去就完事",[2339],{"type":33,"value":2340},"七、上下文拼装：不是把检索结果贴进去就完事",{"type":27,"tag":35,"props":2342,"children":2343},{},[2344,2346,2351],{"type":33,"value":2345},"这是 ",{"type":27,"tag":108,"props":2347,"children":2349},{"className":2348},[],[2350],{"type":33,"value":12},{"type":33,"value":2352}," 工程中第二个高频误区。",{"type":27,"tag":35,"props":2354,"children":2355},{},[2356],{"type":33,"value":2357},"很多系统即使召回不错，回答还是不稳定，原因常常在上下文构造太粗糙。",{"type":27,"tag":274,"props":2359,"children":2361},{"id":2360},"_71-拼装时要解决三个问题",[2362],{"type":33,"value":2363},"7.1 拼装时要解决三个问题",{"type":27,"tag":176,"props":2365,"children":2366},{},[2367,2372,2377],{"type":27,"tag":82,"props":2368,"children":2369},{},[2370],{"type":33,"value":2371},"片段顺序怎么排",{"type":27,"tag":82,"props":2373,"children":2374},{},[2375],{"type":33,"value":2376},"每段保留多少原文",{"type":27,"tag":82,"props":2378,"children":2379},{},[2380],{"type":33,"value":2381},"怎样明确告诉模型“只基于这些内容回答”",{"type":27,"tag":274,"props":2383,"children":2385},{"id":2384},"_72-一个更稳的-prompt-结构",[2386],{"type":33,"value":2387},"7.2 一个更稳的 prompt 结构",{"type":27,"tag":740,"props":2389,"children":2391},{"className":742,"code":2390,"language":744,"meta":7,"style":7},"export function buildRagPrompt(question: string, docs: string[]) {\n  return `\n你是企业知识助手，请仅根据给定资料回答问题。\n如果资料不足，请明确说“当前资料不足以回答”。\n回答时尽量引用资料编号。\n\n资料：\n${docs.map((doc, i) => `[资料${i + 1}] ${doc}`).join('\\n\\n')}\n\n问题：${question}\n`\n}\n",[2392],{"type":27,"tag":108,"props":2393,"children":2394},{"__ignoreMap":7},[2395,2448,2460,2468,2476,2484,2491,2499,2610,2617,2633,2641],{"type":27,"tag":750,"props":2396,"children":2397},{"class":752,"line":753},[2398,2402,2406,2411,2415,2420,2424,2428,2432,2436,2440,2444],{"type":27,"tag":750,"props":2399,"children":2400},{"style":757},[2401],{"type":33,"value":875},{"type":27,"tag":750,"props":2403,"children":2404},{"style":757},[2405],{"type":33,"value":880},{"type":27,"tag":750,"props":2407,"children":2408},{"style":763},[2409],{"type":33,"value":2410}," buildRagPrompt",{"type":27,"tag":750,"props":2412,"children":2413},{"style":774},[2414],{"type":33,"value":890},{"type":27,"tag":750,"props":2416,"children":2417},{"style":784},[2418],{"type":33,"value":2419},"question",{"type":27,"tag":750,"props":2421,"children":2422},{"style":757},[2423],{"type":33,"value":792},{"type":27,"tag":750,"props":2425,"children":2426},{"style":795},[2427],{"type":33,"value":904},{"type":27,"tag":750,"props":2429,"children":2430},{"style":774},[2431],{"type":33,"value":909},{"type":27,"tag":750,"props":2433,"children":2434},{"style":784},[2435],{"type":33,"value":2102},{"type":27,"tag":750,"props":2437,"children":2438},{"style":757},[2439],{"type":33,"value":792},{"type":27,"tag":750,"props":2441,"children":2442},{"style":795},[2443],{"type":33,"value":904},{"type":27,"tag":750,"props":2445,"children":2446},{"style":774},[2447],{"type":33,"value":2115},{"type":27,"tag":750,"props":2449,"children":2450},{"class":752,"line":780},[2451,2455],{"type":27,"tag":750,"props":2452,"children":2453},{"style":757},[2454],{"type":33,"value":1025},{"type":27,"tag":750,"props":2456,"children":2457},{"style":975},[2458],{"type":33,"value":2459}," `\n",{"type":27,"tag":750,"props":2461,"children":2462},{"class":752,"line":20},[2463],{"type":27,"tag":750,"props":2464,"children":2465},{"style":975},[2466],{"type":33,"value":2467},"你是企业知识助手，请仅根据给定资料回答问题。\n",{"type":27,"tag":750,"props":2469,"children":2470},{"class":752,"line":817},[2471],{"type":27,"tag":750,"props":2472,"children":2473},{"style":975},[2474],{"type":33,"value":2475},"如果资料不足，请明确说“当前资料不足以回答”。\n",{"type":27,"tag":750,"props":2477,"children":2478},{"class":752,"line":834},[2479],{"type":27,"tag":750,"props":2480,"children":2481},{"style":975},[2482],{"type":33,"value":2483},"回答时尽量引用资料编号。\n",{"type":27,"tag":750,"props":2485,"children":2486},{"class":752,"line":851},[2487],{"type":27,"tag":750,"props":2488,"children":2489},{"emptyLinePlaceholder":18},[2490],{"type":33,"value":866},{"type":27,"tag":750,"props":2492,"children":2493},{"class":752,"line":860},[2494],{"type":27,"tag":750,"props":2495,"children":2496},{"style":975},[2497],{"type":33,"value":2498},"资料：\n",{"type":27,"tag":750,"props":2500,"children":2501},{"class":752,"line":869},[2502,2507,2511,2516,2520,2524,2528,2532,2537,2541,2545,2550,2554,2559,2564,2569,2573,2577,2581,2585,2589,2593,2598,2602,2606],{"type":27,"tag":750,"props":2503,"children":2504},{"style":975},[2505],{"type":33,"value":2506},"${",{"type":27,"tag":750,"props":2508,"children":2509},{"style":774},[2510],{"type":33,"value":2102},{"type":27,"tag":750,"props":2512,"children":2513},{"style":975},[2514],{"type":33,"value":2515},".",{"type":27,"tag":750,"props":2517,"children":2518},{"style":763},[2519],{"type":33,"value":1044},{"type":27,"tag":750,"props":2521,"children":2522},{"style":975},[2523],{"type":33,"value":1049},{"type":27,"tag":750,"props":2525,"children":2526},{"style":795},[2527],{"type":33,"value":895},{"type":27,"tag":750,"props":2529,"children":2530},{"style":975},[2531],{"type":33,"value":909},{"type":27,"tag":750,"props":2533,"children":2534},{"style":795},[2535],{"type":33,"value":2536},"i",{"type":27,"tag":750,"props":2538,"children":2539},{"style":975},[2540],{"type":33,"value":1068},{"type":27,"tag":750,"props":2542,"children":2543},{"style":757},[2544],{"type":33,"value":1073},{"type":27,"tag":750,"props":2546,"children":2547},{"style":975},[2548],{"type":33,"value":2549}," `[资料${",{"type":27,"tag":750,"props":2551,"children":2552},{"style":774},[2553],{"type":33,"value":2536},{"type":27,"tag":750,"props":2555,"children":2556},{"style":757},[2557],{"type":33,"value":2558}," +",{"type":27,"tag":750,"props":2560,"children":2561},{"style":795},[2562],{"type":33,"value":2563}," 1",{"type":27,"tag":750,"props":2565,"children":2566},{"style":975},[2567],{"type":33,"value":2568},"}] ${",{"type":27,"tag":750,"props":2570,"children":2571},{"style":774},[2572],{"type":33,"value":895},{"type":27,"tag":750,"props":2574,"children":2575},{"style":975},[2576],{"type":33,"value":1195},{"type":27,"tag":750,"props":2578,"children":2579},{"style":975},[2580],{"type":33,"value":1254},{"type":27,"tag":750,"props":2582,"children":2583},{"style":763},[2584],{"type":33,"value":1233},{"type":27,"tag":750,"props":2586,"children":2587},{"style":975},[2588],{"type":33,"value":890},{"type":27,"tag":750,"props":2590,"children":2591},{"style":975},[2592],{"type":33,"value":1138},{"type":27,"tag":750,"props":2594,"children":2595},{"style":795},[2596],{"type":33,"value":2597},"\\n\\n",{"type":27,"tag":750,"props":2599,"children":2600},{"style":975},[2601],{"type":33,"value":1138},{"type":27,"tag":750,"props":2603,"children":2604},{"style":975},[2605],{"type":33,"value":927},{"type":27,"tag":750,"props":2607,"children":2608},{"style":975},[2609],{"type":33,"value":857},{"type":27,"tag":750,"props":2611,"children":2612},{"class":752,"line":943},[2613],{"type":27,"tag":750,"props":2614,"children":2615},{"emptyLinePlaceholder":18},[2616],{"type":33,"value":866},{"type":27,"tag":750,"props":2618,"children":2619},{"class":752,"line":1011},[2620,2625,2629],{"type":27,"tag":750,"props":2621,"children":2622},{"style":975},[2623],{"type":33,"value":2624},"问题：${",{"type":27,"tag":750,"props":2626,"children":2627},{"style":774},[2628],{"type":33,"value":2419},{"type":27,"tag":750,"props":2630,"children":2631},{"style":975},[2632],{"type":33,"value":857},{"type":27,"tag":750,"props":2634,"children":2635},{"class":752,"line":1019},[2636],{"type":27,"tag":750,"props":2637,"children":2638},{"style":975},[2639],{"type":33,"value":2640},"`\n",{"type":27,"tag":750,"props":2642,"children":2643},{"class":752,"line":1033},[2644],{"type":27,"tag":750,"props":2645,"children":2646},{"style":774},[2647],{"type":33,"value":857},{"type":27,"tag":35,"props":2649,"children":2650},{},[2651],{"type":33,"value":2652},"这类 prompt 的关键不在文案华丽，而在边界清晰：",{"type":27,"tag":78,"props":2654,"children":2655},{},[2656,2661,2666],{"type":27,"tag":82,"props":2657,"children":2658},{},[2659],{"type":33,"value":2660},"明确只能基于资料回答",{"type":27,"tag":82,"props":2662,"children":2663},{},[2664],{"type":33,"value":2665},"资料不足时允许说不知道",{"type":27,"tag":82,"props":2667,"children":2668},{},[2669],{"type":33,"value":2670},"提示引用来源",{"type":27,"tag":35,"props":2672,"children":2673},{},[2674],{"type":33,"value":2675},"这比“请你回答以下问题”稳定得多。",{"type":27,"tag":224,"props":2677,"children":2678},{},[],{"type":27,"tag":228,"props":2680,"children":2682},{"id":2681},"八引用与可追溯性企业-rag-不能只要答案还要能回头查",[2683,2685,2690],{"type":33,"value":2684},"八、引用与可追溯性：企业 ",{"type":27,"tag":108,"props":2686,"children":2688},{"className":2687},[],[2689],{"type":33,"value":12},{"type":33,"value":2691}," 不能只要答案，还要能回头查",{"type":27,"tag":35,"props":2693,"children":2694},{},[2695],{"type":33,"value":2696},"在企业场景里，一个能说得像模像样但没有来源的回答，风险其实很大。",{"type":27,"tag":35,"props":2698,"children":2699},{},[2700],{"type":33,"value":2701},"用户会继续追问：",{"type":27,"tag":78,"props":2703,"children":2704},{},[2705,2710,2715],{"type":27,"tag":82,"props":2706,"children":2707},{},[2708],{"type":33,"value":2709},"这个结论来自哪份文档？",{"type":27,"tag":82,"props":2711,"children":2712},{},[2713],{"type":33,"value":2714},"是最新版本吗？",{"type":27,"tag":82,"props":2716,"children":2717},{},[2718],{"type":33,"value":2719},"这是谁写的规则？",{"type":27,"tag":35,"props":2721,"children":2722},{},[2723,2725,2730],{"type":33,"value":2724},"所以一个成熟 ",{"type":27,"tag":108,"props":2726,"children":2728},{"className":2727},[],[2729],{"type":33,"value":12},{"type":33,"value":2731}," 系统最好能提供：",{"type":27,"tag":78,"props":2733,"children":2734},{},[2735,2740,2745,2750],{"type":27,"tag":82,"props":2736,"children":2737},{},[2738],{"type":33,"value":2739},"引用片段",{"type":27,"tag":82,"props":2741,"children":2742},{},[2743],{"type":33,"value":2744},"来源文档",{"type":27,"tag":82,"props":2746,"children":2747},{},[2748],{"type":33,"value":2749},"文档版本 / 更新时间",{"type":27,"tag":82,"props":2751,"children":2752},{},[2753],{"type":33,"value":2754},"命中的章节信息",{"type":27,"tag":274,"props":2756,"children":2758},{"id":2757},"_81-为什么引用这么重要",[2759],{"type":33,"value":2760},"8.1 为什么引用这么重要",{"type":27,"tag":35,"props":2762,"children":2763},{},[2764],{"type":33,"value":2765},"因为它直接决定两个东西：",{"type":27,"tag":176,"props":2767,"children":2768},{},[2769,2774],{"type":27,"tag":82,"props":2770,"children":2771},{},[2772],{"type":33,"value":2773},"用户信任感",{"type":27,"tag":82,"props":2775,"children":2776},{},[2777],{"type":33,"value":2778},"团队排错效率",{"type":27,"tag":35,"props":2780,"children":2781},{},[2782],{"type":33,"value":2783},"没有引用时，你很难判断：",{"type":27,"tag":78,"props":2785,"children":2786},{},[2787,2792,2797],{"type":27,"tag":82,"props":2788,"children":2789},{},[2790],{"type":33,"value":2791},"是检索错了",{"type":27,"tag":82,"props":2793,"children":2794},{},[2795],{"type":33,"value":2796},"是文档本身过时",{"type":27,"tag":82,"props":2798,"children":2799},{},[2800],{"type":33,"value":2801},"还是模型生成时理解偏了",{"type":27,"tag":224,"props":2803,"children":2804},{},[],{"type":27,"tag":228,"props":2806,"children":2808},{"id":2807},"九评测别只问感觉好像更准了",[2809],{"type":33,"value":2810},"九、评测：别只问“感觉好像更准了”",{"type":27,"tag":35,"props":2812,"children":2813},{},[2814,2819],{"type":27,"tag":108,"props":2815,"children":2817},{"className":2816},[],[2818],{"type":33,"value":12},{"type":33,"value":2820}," 最大的问题之一，就是太容易做成“主观上看起来不错”。",{"type":27,"tag":35,"props":2822,"children":2823},{},[2824],{"type":33,"value":2825},"但真正上线前，你需要更可量化的评测方法。",{"type":27,"tag":274,"props":2827,"children":2829},{"id":2828},"_91-至少分两层评估",[2830],{"type":33,"value":2831},"9.1 至少分两层评估",{"type":27,"tag":653,"props":2833,"children":2835},{"id":2834},"第一层检索评估",[2836],{"type":33,"value":2837},"第一层：检索评估",{"type":27,"tag":78,"props":2839,"children":2840},{},[2841,2846,2851],{"type":27,"tag":82,"props":2842,"children":2843},{},[2844],{"type":33,"value":2845},"正确资料是否被召回",{"type":27,"tag":82,"props":2847,"children":2848},{},[2849],{"type":33,"value":2850},"top-k 命中率如何",{"type":27,"tag":82,"props":2852,"children":2853},{},[2854],{"type":33,"value":2855},"是否召回了太多噪音",{"type":27,"tag":653,"props":2857,"children":2859},{"id":2858},"第二层回答评估",[2860],{"type":33,"value":2861},"第二层：回答评估",{"type":27,"tag":78,"props":2863,"children":2864},{},[2865,2870,2875,2880],{"type":27,"tag":82,"props":2866,"children":2867},{},[2868],{"type":33,"value":2869},"是否基于资料回答",{"type":27,"tag":82,"props":2871,"children":2872},{},[2873],{"type":33,"value":2874},"是否引用正确",{"type":27,"tag":82,"props":2876,"children":2877},{},[2878],{"type":33,"value":2879},"是否出现幻觉",{"type":27,"tag":82,"props":2881,"children":2882},{},[2883],{"type":33,"value":2884},"是否漏掉关键限制条件",{"type":27,"tag":274,"props":2886,"children":2888},{"id":2887},"_92-一个最小评测集做法",[2889],{"type":33,"value":2890},"9.2 一个最小评测集做法",{"type":27,"tag":35,"props":2892,"children":2893},{},[2894],{"type":33,"value":2895},"先整理 30~100 个真实问题，每个问题配：",{"type":27,"tag":78,"props":2897,"children":2898},{},[2899,2904,2909],{"type":27,"tag":82,"props":2900,"children":2901},{},[2902],{"type":33,"value":2903},"标准答案要点",{"type":27,"tag":82,"props":2905,"children":2906},{},[2907],{"type":33,"value":2908},"正确参考文档",{"type":27,"tag":82,"props":2910,"children":2911},{},[2912],{"type":33,"value":2913},"不应引用的错误文档",{"type":27,"tag":35,"props":2915,"children":2916},{},[2917],{"type":33,"value":2918},"然后评测：",{"type":27,"tag":78,"props":2920,"children":2921},{},[2922,2927,2932],{"type":27,"tag":82,"props":2923,"children":2924},{},[2925],{"type":33,"value":2926},"top-3 / top-5 召回命中率",{"type":27,"tag":82,"props":2928,"children":2929},{},[2930],{"type":33,"value":2931},"生成答案准确率",{"type":27,"tag":82,"props":2933,"children":2934},{},[2935],{"type":33,"value":2936},"引用正确率",{"type":27,"tag":274,"props":2938,"children":2940},{"id":2939},"_93-为什么评测必须用真实问题",[2941],{"type":33,"value":2942},"9.3 为什么评测必须用真实问题",{"type":27,"tag":35,"props":2944,"children":2945},{},[2946],{"type":33,"value":2947},"因为很多系统在“理想问题”上表现很好，一到真实用户输入就明显下降：",{"type":27,"tag":78,"props":2949,"children":2950},{},[2951,2956,2961,2966],{"type":27,"tag":82,"props":2952,"children":2953},{},[2954],{"type":33,"value":2955},"用户问法不标准",{"type":27,"tag":82,"props":2957,"children":2958},{},[2959],{"type":33,"value":2960},"会有错别字",{"type":27,"tag":82,"props":2962,"children":2963},{},[2964],{"type":33,"value":2965},"会混合多个意图",{"type":27,"tag":82,"props":2967,"children":2968},{},[2969],{"type":33,"value":2970},"会引用内部黑话和简称",{"type":27,"tag":35,"props":2972,"children":2973},{},[2974,2976,2981],{"type":33,"value":2975},"没有真实样本，",{"type":27,"tag":108,"props":2977,"children":2979},{"className":2978},[],[2980],{"type":33,"value":12},{"type":33,"value":2982}," 质量很容易被高估。",{"type":27,"tag":224,"props":2984,"children":2985},{},[],{"type":27,"tag":228,"props":2987,"children":2989},{"id":2988},"十三个高频落地坑提前讲清楚",[2990],{"type":33,"value":2991},"十、三个高频落地坑，提前讲清楚",{"type":27,"tag":274,"props":2993,"children":2995},{"id":2994},"_101-坑一把所有文档都塞进一个索引不做域隔离",[2996],{"type":33,"value":2997},"10.1 坑一：把所有文档都塞进一个索引，不做域隔离",{"type":27,"tag":35,"props":2999,"children":3000},{},[3001],{"type":33,"value":3002},"结果是：",{"type":27,"tag":78,"props":3004,"children":3005},{},[3006,3011,3016],{"type":27,"tag":82,"props":3007,"children":3008},{},[3009],{"type":33,"value":3010},"财务问题召回到技术文档",{"type":27,"tag":82,"props":3012,"children":3013},{},[3014],{"type":33,"value":3015},"客服话术召回到运营策略",{"type":27,"tag":82,"props":3017,"children":3018},{},[3019],{"type":33,"value":3020},"用户越问越混乱",{"type":27,"tag":35,"props":3022,"children":3023},{},[3024],{"type":33,"value":3025},"解决办法通常是：",{"type":27,"tag":78,"props":3027,"children":3028},{},[3029,3034],{"type":27,"tag":82,"props":3030,"children":3031},{},[3032],{"type":33,"value":3033},"先按知识域拆索引或加 metadata",{"type":27,"tag":82,"props":3035,"children":3036},{},[3037],{"type":33,"value":3038},"检索前先做 query classification",{"type":27,"tag":274,"props":3040,"children":3042},{"id":3041},"_102-坑二文档更新了但索引没跟上",[3043],{"type":33,"value":3044},"10.2 坑二：文档更新了，但索引没跟上",{"type":27,"tag":35,"props":3046,"children":3047},{},[3048],{"type":33,"value":3049},"这是企业系统非常常见的问题。",{"type":27,"tag":35,"props":3051,"children":3052},{},[3053],{"type":33,"value":3054},"如果文档更新频繁，索引同步机制必须设计好，否则模型会拿旧知识回答新问题。",{"type":27,"tag":274,"props":3056,"children":3058},{"id":3057},"_103-坑三只优化生成不优化检索",[3059],{"type":33,"value":3060},"10.3 坑三：只优化生成，不优化检索",{"type":27,"tag":35,"props":3062,"children":3063},{},[3064],{"type":33,"value":3065},"很多团队发现答案不准，就一直改 prompt。",{"type":27,"tag":35,"props":3067,"children":3068},{},[3069],{"type":33,"value":3070},"其实很多时候真正问题是：",{"type":27,"tag":78,"props":3072,"children":3073},{},[3074,3079,3084],{"type":27,"tag":82,"props":3075,"children":3076},{},[3077],{"type":33,"value":3078},"没召回到正确片段",{"type":27,"tag":82,"props":3080,"children":3081},{},[3082],{"type":33,"value":3083},"上下文片段不完整",{"type":27,"tag":82,"props":3085,"children":3086},{},[3087],{"type":33,"value":3088},"排序不对",{"type":27,"tag":35,"props":3090,"children":3091},{},[3092,3094,3099],{"type":33,"value":3093},"生成层优化有用，但在 ",{"type":27,"tag":108,"props":3095,"children":3097},{"className":3096},[],[3098],{"type":33,"value":12},{"type":33,"value":3100}," 里，检索层往往更值得先下功夫。",{"type":27,"tag":224,"props":3102,"children":3103},{},[],{"type":27,"tag":228,"props":3105,"children":3107},{"id":3106},"十一什么时候-rag-不够要考虑更进一步的方案",[3108,3110,3115],{"type":33,"value":3109},"十一、什么时候 ",{"type":27,"tag":108,"props":3111,"children":3113},{"className":3112},[],[3114],{"type":33,"value":12},{"type":33,"value":3116}," 不够，要考虑更进一步的方案",{"type":27,"tag":35,"props":3118,"children":3119},{},[3120,3125],{"type":27,"tag":108,"props":3121,"children":3123},{"className":3122},[],[3124],{"type":33,"value":12},{"type":33,"value":3126}," 很强，但不是万能。",{"type":27,"tag":35,"props":3128,"children":3129},{},[3130],{"type":33,"value":3131},"以下几种情况，可能需要进一步组合：",{"type":27,"tag":78,"props":3133,"children":3134},{},[3135,3140,3145,3150],{"type":27,"tag":82,"props":3136,"children":3137},{},[3138],{"type":33,"value":3139},"长链路业务流程：需要工具调用和 agent orchestration",{"type":27,"tag":82,"props":3141,"children":3142},{},[3143],{"type":33,"value":3144},"高结构化规则系统：需要知识图谱或规则引擎辅助",{"type":27,"tag":82,"props":3146,"children":3147},{},[3148],{"type":33,"value":3149},"特定格式抽取：需要微调或专门 extractor",{"type":27,"tag":82,"props":3151,"children":3152},{},[3153],{"type":33,"value":3154},"强实时数据：需要和数据库 / API 实时联动，而不是只靠静态文档",{"type":27,"tag":35,"props":3156,"children":3157},{},[3158],{"type":33,"value":3159},"所以更成熟的看法是：",{"type":27,"tag":46,"props":3161,"children":3162},{},[3163],{"type":27,"tag":35,"props":3164,"children":3165},{},[3166,3171],{"type":27,"tag":108,"props":3167,"children":3169},{"className":3168},[],[3170],{"type":33,"value":12},{"type":33,"value":3172}," 是很多知识增强场景的基础设施，但不是全部答案。",{"type":27,"tag":224,"props":3174,"children":3175},{},[],{"type":27,"tag":228,"props":3177,"children":3179},{"id":3178},"十二给团队的-rag-落地检查清单",[3180,3182,3187],{"type":33,"value":3181},"十二、给团队的 ",{"type":27,"tag":108,"props":3183,"children":3185},{"className":3184},[],[3186],{"type":33,"value":12},{"type":33,"value":3188}," 落地检查清单",{"type":27,"tag":274,"props":3190,"children":3192},{"id":3191},"数据准备层",[3193],{"type":33,"value":3191},{"type":27,"tag":78,"props":3195,"children":3198},{"className":3196},[3197],"contains-task-list",[3199,3211,3220],{"type":27,"tag":82,"props":3200,"children":3203},{"className":3201},[3202],"task-list-item",[3204,3209],{"type":27,"tag":3205,"props":3206,"children":3208},"input",{"disabled":18,"type":3207},"checkbox",[],{"type":33,"value":3210}," 是否明确了知识域边界",{"type":27,"tag":82,"props":3212,"children":3214},{"className":3213},[3202],[3215,3218],{"type":27,"tag":3205,"props":3216,"children":3217},{"disabled":18,"type":3207},[],{"type":33,"value":3219}," 是否清洗了噪音文档和过期文档",{"type":27,"tag":82,"props":3221,"children":3223},{"className":3222},[3202],[3224,3227],{"type":27,"tag":3205,"props":3225,"children":3226},{"disabled":18,"type":3207},[],{"type":33,"value":3228}," 是否设计了合理切块方式",{"type":27,"tag":274,"props":3230,"children":3232},{"id":3231},"检索层",[3233],{"type":33,"value":3231},{"type":27,"tag":78,"props":3235,"children":3237},{"className":3236},[3197],[3238,3247,3256,3265],{"type":27,"tag":82,"props":3239,"children":3241},{"className":3240},[3202],[3242,3245],{"type":27,"tag":3205,"props":3243,"children":3244},{"disabled":18,"type":3207},[],{"type":33,"value":3246}," 是否支持 metadata 过滤",{"type":27,"tag":82,"props":3248,"children":3250},{"className":3249},[3202],[3251,3254],{"type":27,"tag":3205,"props":3252,"children":3253},{"disabled":18,"type":3207},[],{"type":33,"value":3255}," 是否评估过混合检索",{"type":27,"tag":82,"props":3257,"children":3259},{"className":3258},[3202],[3260,3263],{"type":27,"tag":3205,"props":3261,"children":3262},{"disabled":18,"type":3207},[],{"type":33,"value":3264}," 是否有 rerank 策略",{"type":27,"tag":82,"props":3266,"children":3268},{"className":3267},[3202],[3269,3272],{"type":27,"tag":3205,"props":3270,"children":3271},{"disabled":18,"type":3207},[],{"type":33,"value":3273}," 是否测过 top-k 召回命中率",{"type":27,"tag":274,"props":3275,"children":3277},{"id":3276},"生成层",[3278],{"type":33,"value":3276},{"type":27,"tag":78,"props":3280,"children":3282},{"className":3281},[3197],[3283,3292,3301],{"type":27,"tag":82,"props":3284,"children":3286},{"className":3285},[3202],[3287,3290],{"type":27,"tag":3205,"props":3288,"children":3289},{"disabled":18,"type":3207},[],{"type":33,"value":3291}," 是否明确要求“只基于资料回答”",{"type":27,"tag":82,"props":3293,"children":3295},{"className":3294},[3202],[3296,3299],{"type":27,"tag":3205,"props":3297,"children":3298},{"disabled":18,"type":3207},[],{"type":33,"value":3300}," 是否支持资料不足时明确拒答",{"type":27,"tag":82,"props":3302,"children":3304},{"className":3303},[3202],[3305,3308],{"type":27,"tag":3205,"props":3306,"children":3307},{"disabled":18,"type":3207},[],{"type":33,"value":3309}," 是否返回引用和来源",{"type":27,"tag":274,"props":3311,"children":3313},{"id":3312},"运营层",[3314],{"type":33,"value":3312},{"type":27,"tag":78,"props":3316,"children":3318},{"className":3317},[3197],[3319,3328,3337],{"type":27,"tag":82,"props":3320,"children":3322},{"className":3321},[3202],[3323,3326],{"type":27,"tag":3205,"props":3324,"children":3325},{"disabled":18,"type":3207},[],{"type":33,"value":3327}," 是否有文档更新后的索引同步机制",{"type":27,"tag":82,"props":3329,"children":3331},{"className":3330},[3202],[3332,3335],{"type":27,"tag":3205,"props":3333,"children":3334},{"disabled":18,"type":3207},[],{"type":33,"value":3336}," 是否有真实问题评测集",{"type":27,"tag":82,"props":3338,"children":3340},{"className":3339},[3202],[3341,3344],{"type":27,"tag":3205,"props":3342,"children":3343},{"disabled":18,"type":3207},[],{"type":33,"value":3345}," 是否能区分检索错误和生成错误",{"type":27,"tag":224,"props":3347,"children":3348},{},[],{"type":27,"tag":228,"props":3350,"children":3352},{"id":3351},"总结",[3353],{"type":33,"value":3351},{"type":27,"tag":35,"props":3355,"children":3356},{},[3357,3359,3364],{"type":33,"value":3358},"把 ",{"type":27,"tag":108,"props":3360,"children":3362},{"className":3361},[],[3363],{"type":33,"value":12},{"type":33,"value":3365}," 讲透，可以收敛成 5 句话：",{"type":27,"tag":176,"props":3367,"children":3368},{},[3369,3377,3390,3398,3406],{"type":27,"tag":82,"props":3370,"children":3371},{},[3372],{"type":27,"tag":263,"props":3373,"children":3374},{},[3375],{"type":33,"value":3376},"很多企业知识场景需要的不是微调，而是先把正确资料找出来。",{"type":27,"tag":82,"props":3378,"children":3379},{},[3380],{"type":27,"tag":263,"props":3381,"children":3382},{},[3383,3388],{"type":27,"tag":108,"props":3384,"children":3386},{"className":3385},[],[3387],{"type":33,"value":12},{"type":33,"value":3389}," 的核心不是向量库本身，而是整条检索增强链路。",{"type":27,"tag":82,"props":3391,"children":3392},{},[3393],{"type":27,"tag":263,"props":3394,"children":3395},{},[3396],{"type":33,"value":3397},"切块、召回、重排、上下文拼装，任何一环粗糙都会直接拉低回答质量。",{"type":27,"tag":82,"props":3399,"children":3400},{},[3401],{"type":27,"tag":263,"props":3402,"children":3403},{},[3404],{"type":33,"value":3405},"可引用、可追溯、可评测，比“看起来聪明”更重要。",{"type":27,"tag":82,"props":3407,"children":3408},{},[3409],{"type":27,"tag":263,"props":3410,"children":3411},{},[3412,3414,3419],{"type":33,"value":3413},"真正好的 ",{"type":27,"tag":108,"props":3415,"children":3417},{"className":3416},[],[3418],{"type":33,"value":12},{"type":33,"value":3420},"，不是让模型更会编，而是让模型更少乱编。",{"type":27,"tag":35,"props":3422,"children":3423},{},[3424],{"type":33,"value":3425},"如果你只记住一句话，我希望是这一句：",{"type":27,"tag":46,"props":3427,"children":3428},{},[3429],{"type":27,"tag":35,"props":3430,"children":3431},{},[3432,3437],{"type":27,"tag":108,"props":3433,"children":3435},{"className":3434},[],[3436],{"type":33,"value":12},{"type":33,"value":3438}," 的价值，不是让 AI 知道更多，而是让它在回答前先学会查资料。",{"type":27,"tag":35,"props":3440,"children":3441},{},[3442],{"type":33,"value":3443},"否则最后你得到的，很可能不是企业知识助手，而是——",{"type":27,"tag":35,"props":3445,"children":3446},{},[3447],{"type":27,"tag":263,"props":3448,"children":3449},{},[3450],{"type":33,"value":3451},"一个读过你文档封面、但没认真看正文的同事。",{"type":27,"tag":3453,"props":3454,"children":3455},"style",{},[3456],{"type":33,"value":3457},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":20,"depth":20,"links":3459},[3460,3466,3468,3477,3482,3487,3493,3497,3501,3509,3514,3516,3523],{"id":230,"depth":780,"text":3461,"children":3462},"一、先统一认知：RAG 解决的不是“训练模型”，而是“给模型找对材料”",[3463,3465],{"id":276,"depth":20,"text":3464},"1.1 为什么很多场景更适合 RAG",{"id":378,"depth":20,"text":381},{"id":433,"depth":780,"text":3467},"二、一个 RAG 系统到底由哪些部分组成",{"id":578,"depth":780,"text":3469,"children":3470},"三、文档切块：RAG 第一个最容易被低估的问题",[3471,3475,3476],{"id":648,"depth":20,"text":651,"children":3472},[3473,3474],{"id":655,"depth":817,"text":655},{"id":678,"depth":817,"text":678},{"id":701,"depth":20,"text":704},{"id":735,"depth":20,"text":738},{"id":1358,"depth":780,"text":1361,"children":3478},[3479,3480,3481],{"id":1364,"depth":20,"text":1367},{"id":1398,"depth":20,"text":1401},{"id":1465,"depth":20,"text":1468},{"id":1519,"depth":780,"text":3483,"children":3484},"五、召回不是 top-k 一把梭：很多 RAG 差，就差在这里",[3485,3486],{"id":1578,"depth":20,"text":1581},{"id":1635,"depth":20,"text":1638},{"id":1914,"depth":780,"text":3488,"children":3489},"六、重排（Rerank）：RAG 提升质量最值钱的一步之一",[3490,3491,3492],{"id":1942,"depth":20,"text":1945},{"id":1966,"depth":20,"text":1969},{"id":2305,"depth":20,"text":2308},{"id":2337,"depth":780,"text":2340,"children":3494},[3495,3496],{"id":2360,"depth":20,"text":2363},{"id":2384,"depth":20,"text":2387},{"id":2681,"depth":780,"text":3498,"children":3499},"八、引用与可追溯性：企业 RAG 不能只要答案，还要能回头查",[3500],{"id":2757,"depth":20,"text":2760},{"id":2807,"depth":780,"text":2810,"children":3502},[3503,3507,3508],{"id":2828,"depth":20,"text":2831,"children":3504},[3505,3506],{"id":2834,"depth":817,"text":2837},{"id":2858,"depth":817,"text":2861},{"id":2887,"depth":20,"text":2890},{"id":2939,"depth":20,"text":2942},{"id":2988,"depth":780,"text":2991,"children":3510},[3511,3512,3513],{"id":2994,"depth":20,"text":2997},{"id":3041,"depth":20,"text":3044},{"id":3057,"depth":20,"text":3060},{"id":3106,"depth":780,"text":3515},"十一、什么时候 RAG 不够，要考虑更进一步的方案",{"id":3178,"depth":780,"text":3517,"children":3518},"十二、给团队的 RAG 落地检查清单",[3519,3520,3521,3522],{"id":3191,"depth":20,"text":3191},{"id":3231,"depth":20,"text":3231},{"id":3276,"depth":20,"text":3276},{"id":3312,"depth":20,"text":3312},{"id":3351,"depth":780,"text":3351},"markdown","content:topics:engineering:rag-with-your-own-data-guide.md","content","topics/engineering/rag-with-your-own-data-guide.md","topics/engineering/rag-with-your-own-data-guide","md",1777109948116]