{"id":93259,"date":"2026-08-12T09:41:04","date_gmt":"2026-08-12T01:41:04","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/93259.html"},"modified":"2026-08-12T09:41:04","modified_gmt":"2026-08-12T01:41:04","slug":"%e9%80%9a%e7%94%a8%e7%9f%a5%e8%af%86%e5%ba%93%e6%90%ad%e5%bb%ba%e4%b8%8e%e7%9f%a5%e8%af%86%e5%9b%be%e8%b0%b1%e6%9e%84%e5%bb%ba%e5%85%a8%e6%8c%87%e5%8d%97%ef%bc%88rag-graphrag-%e5%ae%9e%e6%88%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/93259.html","title":{"rendered":"\u901a\u7528\u77e5\u8bc6\u5e93\u642d\u5efa\u4e0e\u77e5\u8bc6\u56fe\u8c31\u6784\u5efa\u5168\u6307\u5357\uff08RAG + GraphRAG \u5b9e\u6218\uff09"},"content":{"rendered":"<p>\u4e00\u53e5\u8bdd\u7406\u89e3\u672c\u6587&#xff1a;\u628a\u5927\u6a21\u578b\u5f53\u6210\u4e00\u4e2a&#034;\u535a\u5b66\u4f46\u5bb9\u6613\u8bb0\u9519\u8bdd&#034;\u7684\u540c\u4e8b&#xff0c;\u77e5\u8bc6\u5e93\u5c31\u662f\u5e2e\u5b83\u67e5\u8d44\u6599\u3001\u7406\u5173\u7cfb\u7684&#034;\u5916\u6302\u786c\u76d8 &#043; \u5173\u7cfb\u56fe\u8c31&#034;\u3002\u00a0\u672c\u6587\u4ece\u96f6\u5f00\u59cb&#xff0c;\u7528\u7c7b\u6bd4 &#043; \u6b65\u9aa4 &#043; \u4ee3\u7801 &#043; \u8868\u683c&#xff0c;\u5e26\u4f60\u642d\u51fa\u4e00\u5957\u6807\u51c6\u7684\u4f01\u4e1a\u7ea7\u77e5\u8bc6\u5e93\u3002<\/p>\n<hr \/>\n<h3 id=\"\u76ee\u5f55\" style=\"background-color:transparent\">\u76ee\u5f55<\/h3>\n<ul>\n<li>\u5f15\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u9700\u8981\u77e5\u8bc6\u5e93&#xff1f;<\/li>\n<li>1. RAG \u77e5\u8bc6\u5e93\u539f\u7406\u4e0e\u6838\u5fc3\u6280\u672f\u70b9\n<ul>\n<li>1.1 \u6574\u4f53\u67b6\u6784&#xff1a;Indexing \u2192 Retrieval \u2192 Generation<\/li>\n<li>1.2 \u6587\u6863\u89e3\u6790&#xff1a;\u628a PDF \u53d8\u6210&#034;\u5e72\u51c0\u7684\u6587\u672c&#034;<\/li>\n<li>1.3 \u5207\u7247&#xff1a;\u628a\u4e66\u62c6\u6210&#034;\u77e5\u8bc6\u70b9\u5361\u7247&#034;<\/li>\n<li>1.4 Embedding&#xff1a;\u8ba9\u6587\u5b57\u53d8\u6210&#034;\u5750\u6807\u70b9&#034;<\/li>\n<li>1.5 \u5411\u91cf\u6570\u636e\u5e93&#xff1a;\u7ed9\u4e0a\u4ebf\u4e2a\u5750\u6807\u70b9\u5efa\u7d22\u5f15<\/li>\n<li>1.6 \u6df7\u5408\u68c0\u7d22\u4e0e\u91cd\u6392\u5e8f&#xff1a;\u5148\u6d77\u9009&#xff0c;\u518d\u7cbe\u6311<\/li>\n<li>1.7 \u4e0a\u4e0b\u6587\u7ec4\u88c5&#xff1a;\u628a\u6700\u6709\u7528\u7247\u6bb5\u5582\u7ed9\u5927\u6a21\u578b<\/li>\n<\/ul>\n<\/li>\n<li>2. \u77e5\u8bc6\u56fe\u8c31\u6784\u5efa\u6d41\u7a0b\n<ul>\n<li>2.1 \u77e5\u8bc6\u56fe\u8c31\u662f\u4ec0\u4e48&#xff1a;\u7528&#034;\u5173\u7cfb&#034;\u7ec4\u7ec7\u77e5\u8bc6<\/li>\n<li>2.2 \u672c\u4f53\u8bbe\u8ba1&#xff1a;\u5148\u753b\u597d&#034;\u9aa8\u67b6&#034;<\/li>\n<li>2.3 \u5b9e\u4f53\u8bc6\u522b\u4e0e\u5173\u7cfb\u62bd\u53d6&#xff1a;LLM \u8f85\u52a9\u62bd\u53d6\u4e09\u5143\u7ec4<\/li>\n<li>2.4 \u56fe\u6570\u636e\u5e93\u9009\u578b&#xff1a;Neo4j \/ NebulaGraph \/ JanusGraph<\/li>\n<\/ul>\n<\/li>\n<li>3. GraphRAG&#xff1a;\u77e5\u8bc6\u56fe\u8c31 &#043; LLM \u7684\u878d\u5408\n<ul>\n<li>3.1 \u4e3a\u4ec0\u4e48\u9700\u8981 GraphRAG<\/li>\n<li>3.2 \u5fae\u8f6f GraphRAG \u539f\u7406&#xff1a;\u5efa\u56fe &#043; \u793e\u533a\u6458\u8981 &#043; \u53cc\u901a\u9053\u67e5\u8be2<\/li>\n<li>3.3 \u5176\u4ed6\u7ed3\u5408\u6a21\u5f0f&#xff1a;ToG\u3001Vector &#043; Graph \u6df7\u5408<\/li>\n<\/ul>\n<\/li>\n<li>4. \u4ece\u96f6\u642d\u5efa\u5b9e\u73b0\u6b65\u9aa4\u6e05\u5355&#xff08;RAG &#043; KG \u6df7\u5408\u67b6\u6784&#xff09;<\/li>\n<li>5. \u5173\u952e\u6ce8\u610f\u70b9&#xff1a;\u6570\u636e\u8d28\u91cf\u3001\u66f4\u65b0\u7ef4\u62a4\u3001\u8bc4\u4f30\u3001\u6210\u672c\u3001\u5e7b\u89c9<\/li>\n<li>6. \u771f\u5b9e\u5b9e\u73b0\u6848\u4f8b&#xff08;2024-2026&#xff09;<\/li>\n<li>7. \u5e38\u89c1\u95ee\u9898\u901f\u67e5\u8868&#xff08;FAQ&#xff09;<\/li>\n<li>\u7ed3\u8bed<\/li>\n<\/ul>\n<hr \/>\n<h3 id=\"0-\u5199\u5728\u524d\u9762\u4e3a\u4ec0\u4e48\u9700\u8981\u77e5\u8bc6\u5e93\">\u5f15\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u9700\u8981\u77e5\u8bc6\u5e93&#xff1f;<\/h3>\n<p>\u5927\u8bed\u8a00\u6a21\u578b&#xff08;LLM&#xff09;\u6709\u4e00\u4e2a&#034;\u5929\u751f\u7f3a\u9677&#034;&#xff1a;\u5b83\u5b66\u5230\u7684\u77e5\u8bc6\u53ea\u505c\u7559\u5728\u8bad\u7ec3\u6570\u636e\u622a\u6b62\u7684\u90a3\u4e00\u523b&#xff0c;\u800c\u4e14\u56de\u7b54\u65f6\u5bb9\u6613&#034;\u4e00\u672c\u6b63\u7ecf\u5730\u80e1\u8bf4\u516b\u9053&#034;&#xff08;\u5e7b\u89c9&#xff09;\u3002<\/p>\n<p>\u6253\u4e2a\u6bd4\u65b9&#xff1a;LLM \u50cf\u4e00\u4e2a\u8bb0\u5fc6\u529b\u8d85\u5f3a\u3001\u4f46\u4ece\u4e0d\u67e5\u8d44\u6599\u7684\u5929\u624d\u5b9e\u4e60\u751f\u3002\u4f60\u95ee\u4ed6&#034;\u516c\u53f8\u62a5\u9500\u6d41\u7a0b\u662f\u4ec0\u4e48&#034;&#xff0c;\u4ed6\u4f1a\u51ed\u5370\u8c61\u7f16\u4e00\u4e2a\u2014\u2014\u56e0\u4e3a\u4ed6\u7684&#034;\u5370\u8c61&#034;\u91cc\u6839\u672c\u6ca1\u6709\u4f60\u516c\u53f8\u7684\u5236\u5ea6\u6587\u4ef6\u3002<\/p>\n<p>\u77e5\u8bc6\u5e93\u8981\u89e3\u51b3\u7684\u5c31\u662f\u8fd9\u4e24\u4ef6\u4e8b&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u75db\u70b9\u4f20\u7edf LLM\u63a5\u5165\u77e5\u8bc6\u5e93\u540e<\/tr>\n<tr>\n<td>\u77e5\u8bc6\u8fc7\u65f6<\/td>\n<td>\u53ea\u4f1a\u8bad\u7ec3\u622a\u6b62\u524d\u7684\u77e5\u8bc6<\/td>\n<td>\u4ece\u6700\u65b0\u6587\u6863\u4e2d\u68c0\u7d22\u5b9e\u65f6\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>\u5e7b\u89c9<\/td>\n<td>\u7f16\u9020\u4e0d\u5b58\u5728\u7684&#034;\u4e8b\u5b9e&#034;<\/td>\n<td>\u7b54\u6848\u5fc5\u987b\u57fa\u4e8e\u68c0\u7d22\u5230\u7684\u539f\u6587\u7247\u6bb5<\/td>\n<\/tr>\n<tr>\n<td>\u79c1\u6709\u6570\u636e<\/td>\n<td>\u4e0d\u77e5\u9053\u4f60\u7684\u5185\u90e8\u8d44\u6599<\/td>\n<td>\u53ea\u4ece\u4f60\u7684\u79c1\u6709\u6587\u6863\u4e2d\u56de\u7b54<\/td>\n<\/tr>\n<tr>\n<td>\u590d\u6742\u5173\u7cfb<\/td>\n<td>\u96be\u4ee5\u505a\u591a\u8df3\u63a8\u7406<\/td>\n<td>\u77e5\u8bc6\u56fe\u8c31\u63d0\u4f9b\u5173\u7cfb\u8def\u5f84<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u800c\u77e5\u8bc6\u56fe\u8c31&#xff08;Knowledge Graph&#xff09;\u8fdb\u4e00\u6b65\u89e3\u51b3&#034;\u5173\u7cfb\u590d\u6742\u3001\u9700\u8981\u591a\u8df3\u63a8\u7406&#034;\u7684\u95ee\u9898&#xff1a;\u6bd4\u5982&#034;A \u516c\u53f8\u7684 CEO \u66fe\u5728 B \u516c\u53f8\u4efb\u804c&#xff0c;B \u516c\u53f8\u88ab C \u96c6\u56e2\u6536\u8d2d&#xff0c;\u95ee C \u96c6\u56e2\u7684\u5b9e\u9645\u63a7\u5236\u4eba\u662f\u8c01&#034;\u2014\u2014\u8fd9\u7c7b\u95ee\u9898\u9760&#034;\u5173\u952e\u8bcd\u5339\u914d&#034;\u662f\u7b54\u4e0d\u51fa\u6765\u7684&#xff0c;\u8981\u9760&#034;\u56fe\u4e0a\u8d70\u4e24\u6b65&#034;\u3002<\/p>\n<hr \/>\n<h3 id=\"1-rag-\u77e5\u8bc6\u5e93\u539f\u7406\u4e0e\u6838\u5fc3\u6280\u672f\u70b9\">1. RAG \u77e5\u8bc6\u5e93\u539f\u7406\u4e0e\u6838\u5fc3\u6280\u672f\u70b9<\/h3>\n<h4 id=\"11-\u6574\u4f53\u67b6\u6784indexing-retrieval-generation\">1.1 \u6574\u4f53\u67b6\u6784&#xff1a;Indexing \u2192 Retrieval \u2192 Generation<\/h4>\n<p>RAG&#xff08;Retrieval-Augmented Generation&#xff0c;\u68c0\u7d22\u589e\u5f3a\u751f\u6210&#xff09;\u7684\u6838\u5fc3\u94fe\u8def\u53ea\u6709\u4e09\u6b65&#xff1a;<\/p>\n<p> \u6570\u636e\u5165\u5e93(Indexing)  -&gt;  \u68c0\u7d22(Retrieval)  -&gt;  \u751f\u6210(Generation)<\/p>\n<p>[\u4f60\u7684\u6587\u6863] &#8211;\u89e3\u6790&#8211;&gt; [\u5207\u7247] &#8211;\u5411\u91cf\u5316&#8211;&gt; [\u5411\u91cf\u6570\u636e\u5e93]<br \/>\n                                            \u2191<br \/>\n\u7528\u6237\u63d0\u95ee &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;\u2518<br \/>\n    \u2193<br \/>\n[\u68c0\u7d22\u5230 Top-K \u7247\u6bb5] &#8211;\u7ec4\u88c5&#8211;&gt; [Prompt] &#8211;&gt; [LLM] &#8211;&gt; \u5e26\u5f15\u7528\u7684\u7b54\u6848<\/p>\n<p>\u901a\u4fd7\u7c7b\u6bd4&#xff1a;\u8fd9\u5c31\u50cf\u4f60\u53bb\u56fe\u4e66\u9986\u67e5\u8d44\u6599\u5199\u8bba\u6587\u3002<\/p>\n<li>Indexing&#xff08;\u5165\u5e93&#xff09;&#xff1a;\u5148\u628a\u4e00\u5806\u4e66\u6309\u7167&#034;\u76ee\u5f55 &#043; \u5361\u7247&#034;\u6574\u7406\u597d&#xff0c;\u6446\u4e0a\u4e66\u67b6&#xff08;\u628a\u6587\u6863\u5207\u7247\u3001\u5411\u91cf\u5316\u3001\u5b58\u8fdb\u6570\u636e\u5e93&#xff09;&#xff1b;<\/li>\n<li>Retrieval&#xff08;\u68c0\u7d22&#xff09;&#xff1a;\u62ff\u5230\u4f60\u7684\u95ee\u9898\u540e&#xff0c;\u5148\u53bb\u4e66\u67b6\u6309\u5173\u952e\u8bcd\u3001\u6309\u8bed\u4e49\u627e\u5230\u6700\u76f8\u5173\u7684\u51e0\u9875&#xff08;\u53ec\u56de Top-K \u7247\u6bb5&#xff09;&#xff1b;<\/li>\n<li>Generation&#xff08;\u751f\u6210&#xff09;&#xff1a;\u628a&#034;\u4f60\u7684\u95ee\u9898 &#043; \u8fd9\u51e0\u9875\u5185\u5bb9&#034;\u4e00\u8d77\u4ea4\u7ed9\u5927\u6a21\u578b&#xff0c;\u8ba9\u5b83\u5728\u9650\u5b9a\u8303\u56f4\u5185\u5199\u7b54\u6848&#xff0c;\u5e76\u8981\u6c42\u5b83\u6807\u6ce8\u51fa\u5904\u3002<\/li>\n<p>\u4e0b\u9762\u9010\u4e2a\u62c6\u89e3\u6838\u5fc3\u73af\u8282&#xff0c;\u6bcf\u4e2a\u73af\u8282\u90fd\u6709\u4e00\u4e2a&#034;\u5173\u952e\u6613\u9519\u70b9&#034;\u3002<\/p>\n<hr \/>\n<h4 id=\"12-\u6587\u6863\u89e3\u6790\u628a-pdf-\u53d8\u6210\u5e72\u51c0\u7684\u6587\u672c\">1.2 \u6587\u6863\u89e3\u6790&#xff1a;\u628a PDF \u53d8\u6210&#034;\u5e72\u51c0\u7684\u6587\u672c&#034;<\/h4>\n<p>\u539f\u7406&#xff1a;\u628a\u975e\u7ed3\u6784\u5316\u6570\u636e&#xff08;PDF\u3001Word\u3001HTML\u3001\u626b\u63cf\u4ef6&#xff09;\u8f6c\u6362\u6210 LLM \u80fd\u7406\u89e3\u7684\u7eaf\u6587\u672c\u6216\u7ed3\u6784\u5316\u683c\u5f0f\u3002<\/p>\n<p>\u901a\u4fd7\u7c7b\u6bd4&#xff1a;\u6587\u6863\u89e3\u6790\u5c31\u50cf&#034;\u62c6\u5feb\u9012&#034;\u3002\u5feb\u9012\u7bb1\u91cc\u53ef\u80fd\u585e\u4e86\u6ce1\u6cab\u3001\u8bf4\u660e\u4e66\u3001\u8d60\u54c1&#xff0c;\u4f60\u8981\u7684\u662f\u91cc\u9762\u7684\u5546\u54c1&#xff08;\u6b63\u6587\u6587\u672c&#xff09;\u3002\u89e3\u6790\u505a\u5f97\u597d\u4e0d\u597d&#xff0c;\u76f4\u63a5\u51b3\u5b9a\u540e\u9762\u6240\u6709\u73af\u8282\u7684\u8d28\u91cf\u3002<\/p>\n<p>\u4e3b\u6d41\u5de5\u5177&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u5de5\u5177\u7279\u70b9\u9002\u7528\u573a\u666f<\/tr>\n<tr>\n<td>Unstructured.io<\/td>\n<td>\u884c\u4e1a\u6807\u51c6&#xff0c;\u6309\u5143\u7d20\u7c7b\u578b&#xff08;\u6807\u9898\/\u5217\u8868\/\u8868\u683c&#xff09;\u5206\u533a\u8f93\u51fa<\/td>\n<td>\u901a\u7528\u6587\u6863&#xff0c;\u5927\u591a\u6570\u573a\u666f\u9996\u9009<\/td>\n<\/tr>\n<tr>\n<td>Marker \/ Mathpix<\/td>\n<td>\u7cbe\u51c6\u63d0\u53d6\u590d\u6742\u6570\u5b66\u516c\u5f0f&#xff08;LaTeX&#xff09;<\/td>\n<td>\u8bba\u6587\u3001\u6280\u672f\u6587\u6863\u3001\u7406\u79d1\u6559\u6750<\/td>\n<\/tr>\n<tr>\n<td>LLM-as-a-Parser&#xff08;GPT-4o \u7b49\u591a\u6a21\u6001\u6a21\u578b\u76f4\u63a5&#034;\u770b&#034;PDF&#xff09;<\/td>\n<td>\u51c6\u786e\u7387\u6781\u9ad8&#xff0c;\u76f4\u63a5\u8f93\u51fa Markdown<\/td>\n<td>\u626b\u63cf\u4ef6\u3001\u6392\u7248\u590d\u6742\u7684 PDF&#xff1b;\u6210\u672c\u8f83\u9ad8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u793a\u4f8b&#xff08;\u4f7f\u7528 Unstructured \u89e3\u6790 PDF&#xff09;&#xff1a;<\/p>\n<p>from unstructured.partition.pdf import partition_pdf<\/p>\n<p>elements &#061; partition_pdf(<br \/>\n    filename&#061;&#034;docs\/\u4ea7\u54c1\u624b\u518c.pdf&#034;,<br \/>\n    strategy&#061;&#034;hi_res&#034;,          # \u9ad8\u5206\u8fa8\u7387\u7b56\u7565&#xff0c;\u8868\u683c\/\u56fe\u7247\u8bc6\u522b\u66f4\u51c6<br \/>\n)<br \/>\nfor el in elements:<br \/>\n    print(el.category, &#034;|&#034;, el.text[:100])<br \/>\n# \u8f93\u51fa\u793a\u4f8b&#xff1a;<br \/>\n# Title | \u7b2c\u4e00\u7ae0 \u4ea7\u54c1\u6982\u8ff0<br \/>\n# Table | \u578b\u53f7 | \u529f\u7387 | \u4ef7\u683c &#8230;<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9 1&#xff1a;\u626b\u63cf\u7248 PDF \u5fc5\u987b\u5148 OCR&#xff0c;\u5426\u5219\u89e3\u6790\u51fa\u6765\u5168\u662f\u4e71\u7801\u6216\u7a7a\u767d\u3002Unstructured \u7684\u00a0strategy&#061;&#034;ocr_only&#034;\u00a0\u6216\u00a0hi_res\u00a0\u53ef\u5904\u7406&#xff0c;\u4f46\u4e0d\u8981\u9ed8\u8ba4\u8df3\u8fc7\u8fd9\u4e00\u6b65\u3002<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9 2&#xff1a;\u8868\u683c\u662f\u89e3\u6790\u91cd\u707e\u533a\u3002Word \u8f6c PDF \u7684\u8868\u683c\u3001\u5e26\u5408\u5e76\u5355\u5143\u683c\u7684\u8868\u683c&#xff0c;\u89e3\u6790\u540e\u5e38\u5e38\u884c\u5217\u9519\u4e71\u3002\u89e3\u6790\u540e\u5fc5\u987b\u62bd\u6837\u4eba\u5de5\u68c0\u67e5\u2014\u2014&#034;\u89e3\u6790\u9519\u8bef\u7684 PDF \u662f RAG \u5931\u8d25\u7684\u9996\u8981\u539f\u56e0&#034;&#xff0c;\u6ca1\u6709\u4e4b\u4e00\u3002<\/p>\n<hr \/>\n<h4 id=\"13-\u5207\u7247\u628a\u4e66\u62c6\u6210\u77e5\u8bc6\u70b9\u5361\u7247\">1.3 \u5207\u7247&#xff1a;\u628a\u4e66\u62c6\u6210&#034;\u77e5\u8bc6\u70b9\u5361\u7247&#034;<\/h4>\n<p>\u539f\u7406&#xff1a;\u5927\u6a21\u578b\u7684\u4e0a\u4e0b\u6587\u7a97\u53e3\u6709\u9650&#xff08;\u51e0\u5343\u5230\u51e0\u5341\u4e07 token&#xff09;&#xff0c;\u4f60\u4e0d\u80fd\u628a\u6574\u672c\u4e66\u585e\u8fdb\u53bb&#xff0c;\u8981\u628a\u957f\u6587\u6863\u5207\u6210\u8bed\u4e49\u5b8c\u6574\u7684\u5c0f\u7247\u6bb5&#xff0c;\u68c0\u7d22\u65f6\u6309\u7247\u6bb5\u53ec\u56de\u3002<\/p>\n<p>\u901a\u4fd7\u7c7b\u6bd4&#xff1a;\u5207\u7247\u5c31\u50cf\u628a\u4e00\u672c\u539a\u4e66\u62c6\u6210\u4e00\u5f20\u5f20&#034;\u77e5\u8bc6\u70b9\u5361\u7247&#034;&#xff0c;\u6bcf\u5f20\u5361\u7247\u8bb2\u6e05\u4e00\u4e2a\u5c0f\u4e3b\u9898\u3002\u5207\u5f97\u592a\u7c97&#xff0c;\u68c0\u7d22\u6d6a\u8d39 token&#xff1b;\u5207\u5f97\u592a\u788e&#xff0c;\u8bed\u4e49\u88ab\u62e6\u8170\u622a\u65ad\u3002<\/p>\n<p>\u5207\u7247\u65b9\u6848\u6f14\u8fdb&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u65b9\u6848\u505a\u6cd5\u4f18\u70b9\u7f3a\u70b9<\/tr>\n<tr>\n<td>\u56fa\u5b9a\u5927\u5c0f\u5207\u7247<\/td>\n<td>\u6bcf 500 token \u4e00\u5200<\/td>\n<td>\u5b9e\u73b0\u7b80\u5355<\/td>\n<td>\u6781\u6613\u5207\u65ad\u8bed\u4e49&#xff0c;\u6bd4\u5982\u628a&#034;\u5c0f\u660e\u662f&#034;\u548c&#034;\u7a0b\u5e8f\u5458&#034;\u5206\u5230\u4e24\u6bb5<\/td>\n<\/tr>\n<tr>\n<td>\u7ed3\u6784\u5207\u7247<\/td>\n<td>\u6309 Markdown \u6807\u9898\u3001\u4ee3\u7801\u51fd\u6570\u5207<\/td>\n<td>\u8bed\u4e49\u5b8c\u6574<\/td>\n<td>\u4f9d\u8d56\u6587\u6863\u7ed3\u6784&#xff0c;\u65e0\u7ed3\u6784\u7684\u6587\u6863\u6ca1\u7528<\/td>\n<\/tr>\n<tr>\n<td>\u8bed\u4e49\u5207\u7247<\/td>\n<td>\u7528 Embedding \u7b97\u53e5\u5b50\u76f8\u4f3c\u5ea6&#xff0c;\u5728\u8bed\u4e49\u65ad\u5c42\u5904\u5207<\/td>\n<td>\u8fb9\u754c\u6700\u5408\u7406<\/td>\n<td>\u8ba1\u7b97\u6210\u672c\u9ad8<\/td>\n<\/tr>\n<tr>\n<td>Late Chunking&#xff08;Cohere&#xff09;<\/td>\n<td>\u5148\u5bf9\u5168\u6587\u505a Embedding&#xff0c;\u518d\u6309\u8fb9\u754c\u5e73\u5747\u6c60\u5316<\/td>\n<td>\u4fdd\u7559\u8de8\u8fb9\u754c\u4e0a\u4e0b\u6587\u4fe1\u606f<\/td>\n<td>\u9700\u8981\u7279\u5b9a\u6a21\u578b\u914d\u5408<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5b9e\u9645\u63a8\u8350&#xff1a;\u5148\u7528\u7ed3\u6784\u5207\u7247&#xff08;MarkdownHeaderTextSplitter\u00a0\u6216\u6309\u6bb5\u843d&#xff09;&#xff0c;\u518d\u53e0\u52a0\u5927\u5c0f\u4e0a\u9650&#xff08;\u5982 5121024 token&#xff0c;\u91cd\u53e0 50100 token&#xff09;\u3002\u91cd\u53e0&#xff08;overlap&#xff09;\u662f\u4e3a\u4e86\u9632\u6b62\u95ee\u9898\u6070\u597d\u843d\u5728\u5207\u53e3\u4e0a\u3002<\/p>\n<p>from langchain.text_splitter import MarkdownHeaderTextSplitter<\/p>\n<p>splitter &#061; MarkdownHeaderTextSplitter(<br \/>\n    headers_to_split_on&#061;[(&#034;#&#034;, &#034;\u6807\u98981&#034;), (&#034;##&#034;, &#034;\u6807\u98982&#034;)],<br \/>\n)<br \/>\nchunks &#061; splitter.split_text(markdown_doc)<br \/>\nfor c in chunks[:3]:<br \/>\n    print(c.metadata, &#034;|&#034;, c.page_content[:50])<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9&#xff1a;\u4e0d\u8981\u5bf9\u8868\u683c\u3001JSON\u3001\u4ee3\u7801\u505a\u7eaf\u5b57\u7b26\u5207\u7247\u3002\u8fd9\u7c7b\u7ed3\u6784\u5316\u5185\u5bb9\u6700\u597d\u6574\u5757\u4fdd\u7559&#xff08;\u6bd4\u5982\u4e00\u4e2a\u8868\u683c\u4f5c\u4e3a\u4e00\u7247&#xff09;&#xff0c;\u5426\u5219\u68c0\u7d22\u5230\u7684\u7247\u6bb5&#034;\u7f3a\u5934\u5c11\u5c3e&#034;&#xff0c;\u6a21\u578b\u6839\u672c\u8bfb\u4e0d\u61c2\u3002<\/p>\n<hr \/>\n<h4 id=\"14-embedding\u8ba9\u6587\u5b57\u53d8\u6210\u5750\u6807\u70b9\" style=\"background-color:transparent\">1.4 Embedding&#xff1a;\u8ba9\u6587\u5b57\u53d8\u6210&#034;\u5750\u6807\u70b9&#034;<\/h4>\n<p>\u539f\u7406&#xff1a;\u628a\u6587\u672c\u6620\u5c04\u5230\u4e00\u4e2a\u9ad8\u7ef4\u5411\u91cf\u7a7a\u95f4&#xff08;\u6bd4\u5982 1024 \u7ef4&#xff09;&#xff0c;\u8ba9\u8bed\u4e49\u76f8\u8fd1\u7684\u6587\u672c\u5728\u7a7a\u95f4\u91cc\u8ddd\u79bb\u66f4\u8fd1\u3002<\/p>\n<p>\u901a\u4fd7\u7c7b\u6bd4&#xff1a;\u60f3\u8c61\u4e00\u4e2a\u5de8\u5927\u7684&#034;\u8bed\u4e49\u5730\u56fe&#034;\u3002&#034;\u82f9\u679c&#034;\u548c&#034;\u6c34\u679c&#034;\u79bb\u5f97\u8fd1&#xff0c;&#034;\u82f9\u679c&#034;\u548c&#034;\u6c7d\u8f66&#034;\u79bb\u5f97\u8fdc\u3002Embedding \u6a21\u578b\u8d1f\u8d23\u628a\u6bcf\u53e5\u8bdd\u5728\u5730\u56fe\u4e0a&#034;\u5b9a\u4f4d&#034;\u3002<\/p>\n<p>2026 \u5e74\u5f00\u6e90\u6a21\u578b\u5df2\u5168\u9762\u53cd\u8d85\u95ed\u6e90 API\u2014\u2014Qwen3-Embedding-8B\u3001Harrier-OSS-v1\u3001NV-Embed-v2 \u7b49\u5728 MTEB v2 \u6392\u884c\u699c\u4e0a\u5747\u8d85\u8d8a OpenAI \/ Cohere \u7b49\u5546\u4e1a API\u3002\u81ea\u6258\u7ba1\u4f18\u5148\u9009\u5f00\u6e90&#xff1b;\u95ed\u6e90 API \u53ea\u5728\u4f60\u4e0d\u60f3\u8fd0\u7ef4 GPU\u3001\u4e14\u5bf9\u957f\u4e0a\u4e0b\u6587\/\u591a\u6a21\u6001\u6709\u7279\u5b9a\u9700\u6c42\u65f6\u8003\u8651\u3002<\/p>\n<p>2026 \u6700\u65b0\u5f00\u6e90 Embedding \u6a21\u578b&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u6a21\u578b\u53c2\u6570\u7279\u70b9\u4e0a\u4e0b\u6587\u8bb8\u53ef\u9002\u5408\u573a\u666f<\/tr>\n<tr>\n<td>Qwen3-Embedding-8B<\/td>\n<td style=\"width:54px\">8B<\/td>\n<td style=\"width:178px\">\u591a\u8bed\u8a00\u7b2c\u4e00\u68af\u961f&#xff08;119 \u8bed\u8a00&#xff09;&#xff0c;\u6307\u4ee4\u611f\u77e5&#xff0c;\u652f\u6301 MRL \u622a\u65ad<\/td>\n<td style=\"width:61px\">32K<\/td>\n<td>Apache 2.0<\/td>\n<td>\u81ea\u6258\u7ba1\u9996\u9009&#xff0c;\u4e2d\u6587\/\u591a\u8bed\u8a00 RAG \u6700\u5f3a\u5f00\u6e90\u9009\u62e9<\/td>\n<\/tr>\n<tr>\n<td>Qwen3-Embedding-4B \/ 0.6B<\/td>\n<td style=\"width:54px\">4B \/ 0.6B<\/td>\n<td style=\"width:178px\">\u540c\u7cfb\u5217\u5c0f\u5c3a\u5bf8&#xff0c;\u6027\u4ef7\u6bd4\u4e0e\u8fb9\u7f18\u90e8\u7f72<\/td>\n<td style=\"width:61px\">32K<\/td>\n<td>Apache 2.0<\/td>\n<td>4B \u662f\u751f\u4ea7\u90e8\u7f72\u751c\u70b9&#xff0c;0.6B \u9002\u5408 CPU\/\u8fb9\u7f18<\/td>\n<\/tr>\n<tr>\n<td>Harrier-OSS-v1&#xff08;\u5fae\u8f6f&#xff09;<\/td>\n<td style=\"width:54px\">27B<\/td>\n<td style=\"width:178px\">2026 \u5e74 3 \u6708\u53d1\u5e03&#xff0c;MMTEB v2 \u699c\u9996&#xff08;~74.3&#xff09;<\/td>\n<td style=\"width:61px\">32K<\/td>\n<td>MIT<\/td>\n<td>\u6709\u63a8\u7406\u57fa\u7840\u8bbe\u65bd\u3001\u8ffd\u6c42\u6781\u81f4\u8d28\u91cf<\/td>\n<\/tr>\n<tr>\n<td>NV-Embed-v2&#xff08;NVIDIA&#xff09;<\/td>\n<td style=\"width:54px\">7B<\/td>\n<td style=\"width:178px\">\u82f1\u6587\u68c0\u7d22\u4e13\u9879\u6700\u5f3a&#xff08;~72.3&#xff09;<\/td>\n<td style=\"width:61px\">32K<\/td>\n<td>CC-BY-NC<\/td>\n<td>\u82f1\u6587\u573a\u666f\u3001NVIDIA\/vLLM \u670d\u52a1<\/td>\n<\/tr>\n<tr>\n<td>BGE-M3&#xff08;\u667a\u6e90&#xff09;<\/td>\n<td style=\"width:54px\">568M<\/td>\n<td style=\"width:178px\">dense &#043; sparse &#043; \u591a\u5411\u91cf\u4e09\u5408\u4e00&#xff0c;100&#043; \u8bed\u8a00<\/td>\n<td style=\"width:61px\">8K<\/td>\n<td>MIT<\/td>\n<td>\u4ecd\u662f\u751f\u4ea7\u73af\u5883\u6700\u5e38\u7528&#xff0c;\u6df7\u5408\u68c0\u7d22\u514d\u591a\u6a21\u578b<\/td>\n<\/tr>\n<tr>\n<td>Jina v5-text-small<\/td>\n<td style=\"width:54px\">~0.6B<\/td>\n<td style=\"width:178px\">MTEB v2 \u82f1\u6587 71.7&#xff0c;\u8de8\u8bed\u8a00\u5bf9\u9f50\u597d<\/td>\n<td style=\"width:61px\">32K<\/td>\n<td>CC-BY-NC<\/td>\n<td>\u5185\u90e8\u5de5\u5177\/\u7814\u7a76&#xff1b;\u5546\u7528\u8d70 API<\/td>\n<\/tr>\n<tr>\n<td>gte-Qwen3-8B&#xff08;\u963f\u91cc&#xff09;<\/td>\n<td style=\"width:54px\">8B<\/td>\n<td style=\"width:178px\">\u901a\u7528\u591a\u8bed\u8a00&#xff0c;Apache 2.0<\/td>\n<td style=\"width:61px\">32K<\/td>\n<td>Apache 2.0<\/td>\n<td>\u9700\u8981\u5bbd\u677e\u5546\u7528\u8bb8\u53ef\u7684\u66ff\u4ee3<\/td>\n<\/tr>\n<tr>\n<td>KaLM-Embedding-Gemma3-12B&#xff08;\u817e\u8baf&#xff09;<\/td>\n<td style=\"width:54px\">12B<\/td>\n<td style=\"width:178px\">MMTEB \u5b98\u65b9\u699c\u9996&#xff08;72.32&#xff09;<\/td>\n<td style=\"width:61px\">32K<\/td>\n<td>\u817e\u8baf\u793e\u533a\u8bb8\u53ef<\/td>\n<td>\u4e2d\u6587\/\u591a\u8bed\u8a00\u9ad8\u8d28\u91cf\u573a\u666f<\/td>\n<\/tr>\n<tr>\n<td>Nomic Embed Text V2&#xff08;MoE&#xff09;<\/td>\n<td style=\"width:54px\">~475M<\/td>\n<td style=\"width:178px\">\u9996\u4e2a\u5f00\u6e90 MoE Embedding&#xff0c;dense&#043;sparse \u4e00\u4f53<\/td>\n<td style=\"width:61px\">512<\/td>\n<td>Apache 2.0<\/td>\n<td>\u6df7\u5408\u68c0\u7d22\u3001\u4f4e\u8d44\u6e90<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>2026 \u6700\u65b0\u95ed\u6e90 API&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u6a21\u578b\u7279\u70b9\u4e0a\u4e0b\u6587\u4ef7\u683c&#xff08;\u6bcf\u767e\u4e07 token&#xff09;<\/tr>\n<tr>\n<td>Gemini Embedding 2&#xff08;Google&#xff09;<\/td>\n<td style=\"width:278px\">\u9996\u4e2a\u539f\u751f\u591a\u6a21\u6001&#xff08;\u6587\u672c&#043;\u56fe&#043;\u97f3\u89c6\u9891&#043;PDF \u7edf\u4e00\u5411\u91cf&#xff09;&#xff0c;MTEB ~68.3<\/td>\n<td style=\"width:61px\">8K<\/td>\n<td style=\"width:177px\">~$0.008&#xff08;batch \u66f4\u4f4e&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>Voyage-3.1 \/ voyage-4-large<\/td>\n<td style=\"width:278px\">\u4ee3\u7801\/\u6cd5\u5f8b\/\u91d1\u878d\u9886\u57df\u68c0\u7d22\u6700\u5f3a&#xff0c;\u957f\u4e0a\u4e0b\u6587\u4e4b\u738b<\/td>\n<td style=\"width:61px\">128K<\/td>\n<td style=\"width:177px\">~$0.06\u20130.5<\/td>\n<\/tr>\n<tr>\n<td>Cohere Embed v4<\/td>\n<td style=\"width:278px\">\u591a\u6a21\u6001\u3001100&#043; \u8bed\u8a00\u3001Matryoshka \u7ef4\u5ea6\u53ef\u8c03<\/td>\n<td style=\"width:61px\">128K<\/td>\n<td style=\"width:177px\">~$0.10\u20130.12<\/td>\n<\/tr>\n<tr>\n<td>OpenAI text-embedding-3-large\/small<\/td>\n<td style=\"width:278px\">\u4ecd\u662f 2024 \u5e74 1 \u6708\u7684\u7248\u672c&#xff0c;\u672a\u66f4\u65b0&#xff0c;\u9760\u751f\u6001\u5403\u8001\u672c<\/td>\n<td style=\"width:61px\">8K<\/td>\n<td style=\"width:177px\">$0.13 \/ $0.02<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5173\u952e\u8d8b\u52bf&#xff1a;<\/p>\n<li>\u5f00\u6e90\u5df2\u53cd\u8d85\u95ed\u6e90&#xff1a;Qwen3-Embedding-8B\u3001Harrier\u3001NV-Embed-v2 \u5728 MTEB v2 \u4e0a\u5747\u8d85\u8d8a OpenAI\/Cohere \u7b49 API\u3002<\/li>\n<li>\u591a\u6a21\u6001\u6210\u4e3a\u6807\u914d&#xff1a;Gemini Embedding 2\u3001Cohere v4 \u90fd\u80fd\u628a\u56fe\u7247\/PDF \u4e0e\u6587\u672c\u5d4c\u5165\u540c\u4e00\u5411\u91cf\u7a7a\u95f4\u3002<\/li>\n<li>Matryoshka&#xff08;MRL&#xff09;\u7ef4\u5ea6\u622a\u65ad\u666e\u53ca&#xff1a;\u53ef\u628a 4096 \u7ef4\u622a\u5230 32 \u7ef4\u4f7f\u7528&#xff0c;\u5411\u91cf\u5e93\u5b58\u50a8\u7701 75% \u4ee5\u4e0a\u3002<\/li>\n<li>\u6df7\u5408\u68c0\u7d22\u5185\u5efa&#xff1a;BGE-M3\u3001Nomic v2 \u5355\u6a21\u578b\u540c\u65f6\u8f93\u51fa dense &#043; sparse&#xff0c;\u4e0d\u7528\u518d\u62fc BM25\u3002<\/li>\n<li>\u6210\u672c\u5dee\u8ddd\u60ac\u6b8a&#xff1a;\u6bcf\u5929 1 \u4ebf token \u7684 RAG \u8d1f\u8f7d&#xff0c;OpenAI API \u7ea6 $13,000\/\u6708&#xff0c;\u81ea\u6258\u7ba1 BGE-M3 \u7ea6 $500\/\u6708&#xff08;\u5dee\u7ea6 26 \u500d&#xff09;\u3002<\/li>\n<li>\u6ce8\u610f MTEB v2 \u5df2\u6362\u699c&#xff1a;2026 \u5e74\u8d77\u5206 English v2 \u4e0e MMTEB \u591a\u8bed\u8a00\u699c&#xff0c;\u5206\u6570\u4e0d\u80fd\u4e0e v1 \u76f4\u63a5\u6bd4\u8f83\u3002<\/li>\n<p>from sentence_transformers import SentenceTransformer<\/p>\n<p>model &#061; SentenceTransformer(&#034;BAAI\/bge-m3&#034;)<br \/>\ntexts &#061; [&#034;\u82f9\u679c\u662f\u4e00\u79cd\u6c34\u679c&#034;, &#034;\u82f9\u679c\u53d1\u5e03\u4e86\u65b0\u624b\u673a&#034;, &#034;\u4eca\u5929\u5929\u6c14\u5f88\u597d&#034;]<br \/>\nembeddings &#061; model.encode(texts, normalize_embeddings&#061;True)<br \/>\nprint(embeddings.shape)  # (3, 1024)<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9 1&#xff1a;\u67e5\u8be2\u8bed\u53e5\u548c\u6587\u6863\u8981\u7528\u540c\u4e00\u4e2a Embedding \u6a21\u578b&#xff0c;\u5426\u5219&#034;\u5730\u56fe&#034;\u90fd\u4e0d\u4e00\u6837&#xff0c;\u68c0\u7d22\u5fc5\u7136\u5931\u6548\u3002<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9 2&#xff1a;Embedding \u6a21\u578b\u5347\u7ea7\u540e\u8981\u5168\u91cf\u91cd\u704c\u5411\u91cf\u5e93\u3002\u6df7\u7528\u65b0\u65e7\u6a21\u578b\u4ea7\u751f\u7684\u5411\u91cf&#xff08;\u65b0\u65e7&#034;\u5730\u56fe&#034;&#xff09;\u65e0\u6cd5\u4e92\u76f8\u6bd4\u8f83&#xff0c;\u8fd9\u662f\u7ebf\u4e0a\u4e8b\u6545\u9ad8\u53d1\u70b9\u3002<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9 3&#xff1a;\u4e2d\u6587\u573a\u666f\u8bf7\u4f18\u5148\u9009\u62e9\u591a\u8bed\u8a00\u6a21\u578b&#xff08;\u5982 Qwen3-Embedding\u3001BGE-M3\u3001KaLM-Embedding&#xff09;&#xff0c;\u7eaf\u82f1\u6587\u4e13\u9879\u6a21\u578b&#xff08;\u5982 NV-Embed-v2&#xff09;\u5bf9\u4e2d\u6587\u8bed\u4e49\u7684\u7406\u89e3\u4f1a\u5927\u6253\u6298\u6263\u3002<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9 4&#xff1a;MRL \u7ef4\u5ea6\u622a\u65ad\u5fc5\u987b\u5168\u5c40\u7edf\u4e00\u3002Qwen3-Embedding \u7b49\u652f\u6301\u628a 4096 \u7ef4\u622a\u5230\u4efb\u610f\u7ef4\u5ea6&#xff08;\u5982 1024\/512\/256&#xff09;&#xff0c;\u4f46\u4e00\u65e6\u9009\u5b9a\u622a\u65ad\u7ef4\u5ea6&#xff0c;\u5165\u5e93\u4e0e\u67e5\u8be2\u5fc5\u987b\u4e00\u81f4&#xff0c;\u4e2d\u9014\u6539\u7ef4\u5ea6\u8981\u5168\u91cf\u91cd\u5efa\u5411\u91cf\u5e93\u3002<\/p>\n<hr \/>\n<h4 id=\"15-\u5411\u91cf\u6570\u636e\u5e93\u7ed9\u4e0a\u4ebf\u4e2a\u5750\u6807\u70b9\u5efa\u7d22\u5f15\">1.5 \u5411\u91cf\u6570\u636e\u5e93&#xff1a;\u7ed9\u4e0a\u4ebf\u4e2a\u5750\u6807\u70b9\u5efa\u7d22\u5f15<\/h4>\n<p>\u539f\u7406&#xff1a;\u5411\u91cf\u6570\u636e\u5e93\u89e3\u51b3&#034;\u5728\u51e0\u4ebf\u4e2a\u9ad8\u7ef4\u5411\u91cf\u91cc\u5feb\u901f\u627e\u5230\u79bb\u67e5\u8be2\u70b9\u6700\u8fd1\u7684 Top-K \u4e2a&#034;\u3002\u6838\u5fc3\u662f\u8fd1\u4f3c\u6700\u8fd1\u90bb&#xff08;ANN&#xff09;\u7d22\u5f15&#xff08;\u5982 HNSW\u3001IVF&#xff09;&#xff0c;\u727a\u7272\u5c11\u91cf\u7cbe\u5ea6\u6362\u53d6\u6beb\u79d2\u7ea7\u54cd\u5e94\u3002<\/p>\n<p>\u901a\u4fd7\u7c7b\u6bd4&#xff1a;Embedding \u6a21\u578b\u53ea\u662f\u628a\u4e66\u7684\u5185\u5bb9&#034;\u7ffb\u8bd1\u6210\u5750\u6807&#034;&#xff0c;\u5411\u91cf\u6570\u636e\u5e93\u624d\u662f\u771f\u6b63\u7684&#034;\u4e66\u67b6&#034;\u2014\u2014\u5b83\u628a\u4e0a\u4ebf\u4e2a\u5750\u6807\u70b9\u7ec4\u7ec7\u6210\u53ef\u4ee5\u79d2\u67e5\u7684\u7d22\u5f15\u7ed3\u6784\u3002<\/p>\n<p>\u9009\u578b\u5bf9\u6bd4&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u6570\u636e\u5e93\u6838\u5fc3\u7279\u70b9\u9002\u7528\u573a\u666f<\/tr>\n<tr>\n<td>Pinecone<\/td>\n<td>\u5168\u6258\u7ba1 SaaS&#xff0c;\u81ea\u52a8\u6269\u7f29\u5bb9<\/td>\n<td>\u5feb\u901f\u539f\u578b\u3001\u4e0d\u60f3\u8fd0\u7ef4\u7684\u521d\u521b\u56e2\u961f<\/td>\n<\/tr>\n<tr>\n<td>Milvus \/ Zilliz<\/td>\n<td>\u9ad8\u6027\u80fd&#xff0c;\u5341\u4ebf\u7ea7\u5411\u91cf&#xff0c;\u652f\u6301\u5411\u91cf&#043;\u6807\u91cf\u6df7\u5408\u68c0\u7d22<\/td>\n<td>\u6d77\u91cf\u6570\u636e\u3001\u9ad8\u5e76\u53d1\u751f\u4ea7\u73af\u5883<\/td>\n<\/tr>\n<tr>\n<td>Weaviate<\/td>\n<td>\u5f00\u6e90&#xff0c;\u539f\u751f\u591a\u6a21\u6001&#xff0c;\u5185\u7f6e LLM \u6a21\u5757<\/td>\n<td>\u9700\u8981\u672c\u5730\u90e8\u7f72\u3001\u6a21\u5757\u5316\u8981\u6c42\u9ad8<\/td>\n<\/tr>\n<tr>\n<td>Chroma \/ FAISS<\/td>\n<td>\u8f7b\u91cf\u7ea7\u3001\u5d4c\u5165\u5f0f<\/td>\n<td>\u672c\u5730\u6d4b\u8bd5\u3001\u5c0f\u89c4\u6a21\u5e94\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p># \u4ee5 Milvus \u4e3a\u4f8b&#xff1a;\u5efa Collection \u5e76\u5199\u5165<br \/>\nfrom pymilvus import MilvusClient<\/p>\n<p>client &#061; MilvusClient(&#034;milvus_demo.db&#034;)<br \/>\nclient.create_collection(<br \/>\n    collection_name&#061;&#034;kb_docs&#034;,<br \/>\n    dimension&#061;1024,                     # \u4e0e bge-m3 \u8f93\u51fa\u7ef4\u5ea6\u4e00\u81f4<br \/>\n    metric_type&#061;&#034;COSINE&#034;,               # \u4f59\u5f26\u76f8\u4f3c\u5ea6<br \/>\n)<br \/>\nclient.insert(<br \/>\n    collection_name&#061;&#034;kb_docs&#034;,<br \/>\n    data&#061;[<br \/>\n        {&#034;id&#034;: 1, &#034;vector&#034;: embeddings[0].tolist(), &#034;text&#034;: &#034;\u82f9\u679c\u662f\u4e00\u79cd\u6c34\u679c&#034;, &#034;source&#034;: &#034;\u5e38\u8bc6.md&#034;},<br \/>\n        {&#034;id&#034;: 2, &#034;vector&#034;: embeddings[1].tolist(), &#034;text&#034;: &#034;\u82f9\u679c\u53d1\u5e03\u4e86\u65b0\u624b\u673a&#034;, &#034;source&#034;: &#034;\u65b0\u95fb.md&#034;},<br \/>\n    ],<br \/>\n)<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9&#xff1a;\u5411\u91cf\u7ef4\u5ea6\u5fc5\u987b\u4e0e Embedding \u6a21\u578b\u8f93\u51fa\u7ef4\u5ea6\u4e00\u81f4&#xff08;BGE-M3 \u662f 1024 \u7ef4&#xff0c;\u6362\u6a21\u578b\u5c31\u8981\u91cd\u5efa Collection&#xff09;\u3002\u53e6\u5916&#xff0c;\u751f\u4ea7\u73af\u5883\u4e0d\u8981\u53ea\u5b58\u5411\u91cf&#xff0c;\u8981\u628a\u539f\u6587\u3001\u6765\u6e90\u3001\u5143\u6570\u636e&#xff08;\u6807\u9898\u3001\u9875\u53f7&#xff09;\u4e00\u8d77\u5b58\u8fdb\u53bb&#xff0c;\u5426\u5219\u68c0\u7d22\u7ed3\u679c\u65e0\u6cd5\u8ffd\u6eaf\u3001\u65e0\u6cd5\u5c55\u793a\u5f15\u7528\u3002<\/p>\n<hr \/>\n<h4 id=\"16-\u6df7\u5408\u68c0\u7d22\u4e0e\u91cd\u6392\u5e8f\u5148\u6d77\u9009\u518d\u7cbe\u6311\">1.6 \u6df7\u5408\u68c0\u7d22\u4e0e\u91cd\u6392\u5e8f&#xff1a;\u5148\u6d77\u9009&#xff0c;\u518d\u7cbe\u6311<\/h4>\n<p>\u95ee\u9898&#xff1a;\u7eaf\u5411\u91cf\u68c0\u7d22&#xff08;\u8bed\u4e49\u5339\u914d&#xff09;\u5bf9\u7cbe\u786e\u5173\u952e\u8bcd\u5f88\u5f31\u3002\u6bd4\u5982\u7528\u6237\u641c&#034;iPhone 15 Pro Max 256G \u6df1\u84dd&#034;&#xff0c;\u5411\u91cf\u68c0\u7d22\u53ef\u80fd\u628a&#034;\u84dd\u8272\u624b\u673a&#034;\u90fd\u53ec\u56de&#xff0c;\u5374\u6f0f\u6389\u8fd9\u4e2a\u7cbe\u786e\u578b\u53f7\u3002<\/p>\n<p>\u6df7\u5408\u68c0\u7d22&#xff08;Hybrid Search&#xff09;&#xff1a;\u5411\u91cf\u68c0\u7d22&#xff08;\u8bed\u4e49&#xff09; &#043; \u5173\u952e\u8bcd\u68c0\u7d22&#xff08;BM25\/TF-IDF&#xff0c;\u7cbe\u786e\u5339\u914d&#xff09;\u53cc\u8def\u53ec\u56de&#xff0c;\u518d\u5408\u5e76\u53bb\u91cd\u3002<\/p>\n<p>\u91cd\u6392\u5e8f&#xff08;Reranking&#xff09;&#xff1a;\u628a\u53ec\u56de\u7684\u4e0a\u767e\u4e2a\u5019\u9009&#xff0c;\u4ea4\u7ed9\u4e00\u4e2a\u66f4\u7cbe\u7ec6\u7684 Cross-Encoder \u6a21\u578b\u91cd\u65b0\u6253\u5206&#xff0c;\u53ea\u628a\u6700\u76f8\u5173\u7684 Top-N&#xff08;\u5982 5 \u4e2a&#xff09;\u4f20\u7ed9 LLM\u3002<\/p>\n<p>\u901a\u4fd7\u7c7b\u6bd4&#xff1a;\u6df7\u5408\u68c0\u7d22\u662f&#034;\u5148\u6d77\u9009&#034;\u2014\u2014\u8bed\u4e49\u641c\u7d22\u548c\u5173\u952e\u8bcd\u641c\u7d22\u5404\u62db\u4e00\u6279\u4eba&#xff1b;\u91cd\u6392\u5e8f\u662f&#034;\u7ec8\u9762&#034;\u2014\u2014\u8ba9\u8d44\u6df1\u9762\u8bd5\u5b98&#xff08;Reranker&#xff09;\u9010\u4e2a\u7cbe\u6311&#xff0c;\u53ea\u7559\u6700\u4f18\u79c0\u7684\u51e0\u4e2a\u4eba\u8fdb final round&#xff08;\u5582\u7ed9 LLM&#xff09;\u3002<\/p>\n<p>\u76ee\u524d\u63d0\u5347 RAG \u51c6\u786e\u7387\u6027\u4ef7\u6bd4\u6700\u9ad8\u7684\u624b\u6bb5&#xff0c;\u5c31\u662f\u52a0\u4e00\u4e2a Reranker\u3002<\/p>\n<table>\n<tbody>\n<tr>\u91cd\u6392\u5e8f\u5de5\u5177\u8bf4\u660e<\/tr>\n<tr>\n<td>Cohere Rerank<\/td>\n<td>\u5546\u4e1a API&#xff0c;\u6548\u679c\u597d\u3001\u63a5\u5165\u5feb<\/td>\n<\/tr>\n<tr>\n<td>BGE Reranker<\/td>\n<td>\u5f00\u6e90&#xff0c;\u4e2d\u6587\u6548\u679c\u597d&#xff0c;\u53ef\u672c\u5730\u90e8\u7f72<\/td>\n<\/tr>\n<tr>\n<td>Voyage Reranker<\/td>\n<td>\u4e0e voyage embedding \u914d\u5408\u6700\u4f73<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>from FlagEmbedding import FlagReranker<\/p>\n<p>reranker &#061; FlagReranker(&#034;BAAI\/bge-reranker-v2-m3&#034;)<br \/>\nquery &#061; &#034;\u82f9\u679c\u516c\u53f8\u7684\u521b\u59cb\u4eba\u662f\u8c01&#xff1f;&#034;<br \/>\ncandidates &#061; [&#034;\u82f9\u679c\u662f\u4e00\u79cd\u6c34\u679c\u3002&#034;, &#034;\u4e54\u5e03\u65af\u662f\u82f9\u679c\u516c\u53f8\u7684\u8054\u5408\u521b\u59cb\u4eba\u4e4b\u4e00\u3002&#034;, &#034;\u82f9\u679c\u53d1\u5e03\u4e86\u65b0\u624b\u673a\u3002&#034;]<br \/>\nscores &#061; reranker.compute_score([[query, c] for c in candidates])<br \/>\n# \u8f93\u51fa: [-7.8, 8.5, -2.1]  -&gt; \u7b2c2\u6761\u6700\u76f8\u5173<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9 1&#xff1a;\u91cd\u6392\u5e8f\u540e\u4ecd\u7136\u8981\u63a7\u5236\u9001\u8fdb LLM \u7684 token \u91cf\u3002Top-5 \u6bcf\u6761 1000 token&#xff0c;\u5c31\u662f 5000 token&#xff0c;\u8d85\u51fa\u9884\u7b97\u4f1a\u62d6\u6162\u54cd\u5e94\u3001\u63d0\u9ad8\u6210\u672c\u3002<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9 2&#xff1a;BM25 \u7684\u00a0k1\u3001b\u00a0\u53c2\u6570\u3001\u6df7\u5408\u6bd4\u4f8b&#xff08;\u5982\u5411\u91cf 0.7 : \u5173\u952e\u8bcd 0.3&#xff09;\u9700\u8981\u5728\u771f\u5b9e\u6570\u636e\u4e0a\u8c03\u53c2&#xff0c;\u4e0d\u8981\u62cd\u8111\u888b\u3002\u53ef\u4ee5\u7528\u9a8c\u8bc1\u96c6\u505a\u4e00\u6b21\u5c0f\u5b9e\u9a8c\u786e\u5b9a\u6bd4\u4f8b\u3002<\/p>\n<hr \/>\n<h4 id=\"17-\u4e0a\u4e0b\u6587\u7ec4\u88c5\u628a\u6700\u6709\u7528\u7247\u6bb5\u5582\u7ed9\u5927\u6a21\u578b\">1.7 \u4e0a\u4e0b\u6587\u7ec4\u88c5&#xff1a;\u628a\u6700\u6709\u7528\u7247\u6bb5\u5582\u7ed9\u5927\u6a21\u578b<\/h4>\n<p>\u68c0\u7d22\u5230\u7247\u6bb5\u540e&#xff0c;\u4e0d\u80fd\u7b80\u5355\u62fc\u63a5&#xff0c;\u8981\u505a&#034;\u7ec4\u88c5&#034;\u52a0\u5de5&#xff0c;\u5e38\u89c1\u6280\u672f&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u6280\u672f\u505a\u4ec0\u4e48\u901a\u4fd7\u7406\u89e3<\/tr>\n<tr>\n<td>Prompt \u6a21\u677f\u7ec4\u88c5<\/td>\n<td>\u6309&#034;\u7cfb\u7edf\u6307\u4ee4 &#043; \u68c0\u7d22\u7247\u6bb5 &#043; \u95ee\u9898&#034;\u7ed3\u6784\u5316\u62fc\u63a5&#xff0c;\u8981\u6c42&#034;\u53ea\u80fd\u57fa\u4e8e\u7247\u6bb5\u56de\u7b54&#034;<\/td>\n<td>\u7ed9\u5927\u6a21\u578b\u5b9a\u89c4\u77e9&#xff1a;\u4e0d\u8bb8\u778e\u7f16&#xff0c;\u5f15\u7528\u8981\u6807\u51fa\u5904<\/td>\n<\/tr>\n<tr>\n<td>Prompt Compression&#xff08;\u5982 LLMLingua&#xff09;<\/td>\n<td>\u538b\u7f29\u68c0\u7d22\u4e0a\u4e0b\u6587&#xff0c;\u5254\u9664\u5197\u4f59 token<\/td>\n<td>\u628a 5000 token \u7684&#034;\u5e9f\u8bdd&#043;\u5e72\u8d27&#034;\u538b\u7f29\u5230 2000 token \u7684&#034;\u7eaf\u5e72\u8d27&#034;<\/td>\n<\/tr>\n<tr>\n<td>CRAG&#xff08;Corrective RAG&#xff09;<\/td>\n<td>\u5148\u8bc4\u4f30\u68c0\u7d22\u7ed3\u679c\u76f8\u5173\u6027&#xff0c;\u4e0d\u76f8\u5173\u5c31\u89e6\u53d1 Web \u641c\u7d22\u8865\u5145<\/td>\n<td>\u68c0\u7d22&#034;\u6389\u94fe\u5b50&#034;\u65f6\u81ea\u52a8\u6362\u4e00\u6761\u8def\u8d70<\/td>\n<\/tr>\n<tr>\n<td>\u5f15\u6587\u6807\u6ce8<\/td>\n<td>\u8ba9 LLM \u5728\u7b54\u6848\u540e\u6807\u6ce8\u00a0[\u6765\u6e90: \u6587\u6863\u540d-\u9875\u53f7]<\/td>\n<td>\u7528\u6237\u80fd\u56de\u6eaf\u9a8c\u8bc1&#xff0c;\u63d0\u5347\u53ef\u4fe1\u5ea6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>prompt &#061; f&#034;&#034;&#034;\u4f60\u662f\u4e00\u540d\u4e25\u8c28\u7684\u77e5\u8bc6\u5e93\u52a9\u624b\u3002\u8bf7\u53ea\u4f9d\u636e\u4e0b\u9762\u63d0\u4f9b\u7684\u8d44\u6599\u56de\u7b54\u95ee\u9898&#xff1b;<br \/>\n\u5982\u679c\u8d44\u6599\u4e2d\u6ca1\u6709\u76f8\u5173\u4fe1\u606f&#xff0c;\u8bf7\u660e\u786e\u56de\u7b54&#034;\u8d44\u6599\u4e2d\u672a\u627e\u5230&#034;\u3002\u56de\u7b54\u672b\u5c3e\u8bf7\u6807\u6ce8\u6765\u6e90\u3002<\/p>\n<p>\u3010\u8d44\u6599\u3011<br \/>\n{context}   # \u5df2\u62fc\u63a5\u3001\u53bb\u91cd\u3001\u538b\u7f29\u540e\u7684 Top-5 \u7247\u6bb5<\/p>\n<p>\u3010\u95ee\u9898\u3011<br \/>\n{question}<\/p>\n<p>\u3010\u56de\u7b54\u3011<br \/>\n&#034;&#034;&#034;<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9 1&#xff1a;\u62fc\u63a5\u4e0a\u4e0b\u6587\u65f6\u8981\u53bb\u91cd\u3001\u6309\u76f8\u5173\u6027\u964d\u5e8f&#xff0c;\u628a\u6700\u76f8\u5173\u7684\u653e\u524d\u9762\u2014\u2014LLM \u5bf9 Prompt \u524d\u90e8\u7684\u6ce8\u610f\u529b\u66f4\u5f3a\u3002 \u26a0\ufe0f\u00a0\u6613\u9519\u70b9 2&#xff1a;\u4e00\u5b9a\u8981\u5728 Prompt \u91cc\u5199\u660e&#034;\u627e\u4e0d\u5230\u5c31\u8bf4\u627e\u4e0d\u5230&#034;&#xff0c;\u5426\u5219\u6a21\u578b\u4f1a\u5f3a\u884c\u7528\u4e0a\u4e0b\u6587&#034;\u7f16&#034;\u4e00\u4e2a\u7b54\u6848&#xff0c;\u5e7b\u89c9\u53c8\u56de\u6765\u4e86\u3002<\/p>\n<hr \/>\n<h3 id=\"2-\u77e5\u8bc6\u56fe\u8c31\u6784\u5efa\u6d41\u7a0b\">2. \u77e5\u8bc6\u56fe\u8c31\u6784\u5efa\u6d41\u7a0b<\/h3>\n<h4 id=\"21-\u77e5\u8bc6\u56fe\u8c31\u662f\u4ec0\u4e48\u7528\u5173\u7cfb\u7ec4\u7ec7\u77e5\u8bc6\">2.1 \u77e5\u8bc6\u56fe\u8c31\u662f\u4ec0\u4e48&#xff1a;\u7528&#034;\u5173\u7cfb&#034;\u7ec4\u7ec7\u77e5\u8bc6<\/h4>\n<p>\u539f\u7406&#xff1a;\u77e5\u8bc6\u56fe\u8c31\u7528\u56fe\u7ed3\u6784\u5b58\u50a8\u77e5\u8bc6\u2014\u2014\u8282\u70b9&#xff08;Node&#xff09;\u8868\u793a\u5b9e\u4f53&#xff0c;\u8fb9&#xff08;Edge&#xff09;\u8868\u793a\u5173\u7cfb&#xff0c;\u5373\u00a0(\u5b9e\u4f53A) &#8211;\u5173\u7cfb&#8211;&gt; (\u5b9e\u4f53B)\u00a0\u7684\u4e09\u5143\u7ec4\u7ed3\u6784\u3002<\/p>\n<p>         \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u5de5\u4f5c\u4e8e   \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n        \u2502  \u4e54\u5e03\u65af \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500&gt; \u2502\u82f9\u679c\u516c\u53f8 \u2502<br \/>\n        \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518           \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n              \u2502                  \u2502<br \/>\n        \u521b\u7acb\u4e8e\u2502                  \u2502\u53d1\u5e03<br \/>\n              \u25bc                  \u25bc<br \/>\n        \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510           \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n        \u2502  1976\u5e74 \u2502           \u2502  iPhone \u2502<br \/>\n        \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518           \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<p>\u901a\u4fd7\u7c7b\u6bd4&#xff1a;\u5982\u679c\u8bf4\u5411\u91cf\u5e93\u662f&#034;\u6309\u5185\u5bb9\u76f8\u4f3c\u5ea6\u6392\u4e66\u7684\u56fe\u4e66\u9986&#034;&#xff0c;\u77e5\u8bc6\u56fe\u8c31\u5c31\u662f&#034;\u753b\u6ee1\u4eba\u7269\u5173\u7cfb\u7f51\u7684\u767d\u677f&#034;\u2014\u2014\u5b83\u4e0d\u5173\u5fc3\u4e24\u53e5\u8bdd\u50cf\u4e0d\u50cf&#xff0c;\u53ea\u5173\u5fc3&#034;\u8c01\u548c\u8c01\u662f\u4ec0\u4e48\u5173\u7cfb&#034;\u3002<\/p>\n<p>\u77e5\u8bc6\u56fe\u8c31\u64c5\u957f\u4ec0\u4e48&#xff1a;<\/p>\n<ul>\n<li>\u2705\u00a0\u591a\u8df3\u63a8\u7406&#xff1a;&#034;\u4e54\u5e03\u65af\u521b\u7acb\u4e86\u82f9\u679c \u2192 \u82f9\u679c\u53d1\u5e03\u4e86 iPhone \u2192 iPhone \u7684\u4f9b\u5e94\u5546\u662f\u8c01&#xff1f;&#034;&#xff08;\u6cbf\u5173\u7cfb\u8d70\u4e24\u6b65&#xff09;<\/li>\n<li>\u2705\u00a0\u7cbe\u786e\u5173\u7cfb\u67e5\u8be2&#xff1a;&#034;\u5217\u51fa\u6240\u6709\u5728 2024 \u5e74\u878d\u8d44\u8d85\u8fc7 1 \u4ebf\u7684 A \u8f6e\u516c\u53f8&#034;<\/li>\n<li>\u2705\u00a0\u5168\u5c40\u603b\u7ed3&#xff1a;&#034;\u8fd9\u5957\u8f6f\u4ef6\u67b6\u6784\u7684\u6f14\u53d8\u8d8b\u52bf\u662f\u4ec0\u4e48&#xff1f;&#034;<\/li>\n<li>\u274c\u00a0\u4e0d\u64c5\u957f&#xff1a;\u957f\u7bc7\u6a21\u7cca\u8bed\u4e49\u7684\u76f8\u4f3c\u5339\u914d&#xff08;\u8fd9\u662f\u5411\u91cf\u5e93\u7684\u5f3a\u9879&#xff09;<\/li>\n<\/ul>\n<h4 id=\"22-\u672c\u4f53\u8bbe\u8ba1\u5148\u753b\u597d\u9aa8\u67b6\">2.2 \u672c\u4f53\u8bbe\u8ba1&#xff1a;\u5148\u753b\u597d&#034;\u9aa8\u67b6&#034;<\/h4>\n<p>\u539f\u7406&#xff1a;\u672c\u4f53&#xff08;Ontology&#xff09;\u5c31\u662f\u56fe\u8c31\u7684\u00a0schema&#xff08;\u6a21\u5f0f&#xff09;\u2014\u2014\u89c4\u5b9a\u6709\u54ea\u4e9b\u5b9e\u4f53\u7c7b\u578b&#xff08;\u5982&#xff1a;\u4eba\u7269\u3001\u516c\u53f8\u3001\u836f\u7269\u3001\u75be\u75c5&#xff09;\u548c\u5173\u7cfb\u7c7b\u578b&#xff08;\u5982&#xff1a;\u5de5\u4f5c\u4e8e\u3001\u6cbb\u7597\u3001\u7ade\u4e89\u3001\u6536\u8d2d&#xff09;\u3002<\/p>\n<p>\u901a\u4fd7\u7c7b\u6bd4&#xff1a;\u76d6\u697c\u524d\u5148\u753b\u7ed3\u6784\u56fe\u2014\u2014\u54ea\u91cc\u662f\u627f\u91cd\u5899\u3001\u54ea\u91cc\u662f\u623f\u95f4\u3001\u54ea\u91cc\u662f\u8d70\u5eca\u3002\u6ca1\u6709\u672c\u4f53\u76f4\u63a5\u5f80\u91cc\u5806\u6570\u636e&#xff0c;\u56fe\u8c31\u5f88\u5feb\u5c31\u4f1a\u53d8\u6210&#034;\u4e00\u9505\u4e71\u9ebb&#034;\u3002<\/p>\n<p>\u8bbe\u8ba1\u539f\u5219&#xff1a;<\/p>\n<li>\u5148\u5b9a\u4e49\u6838\u5fc3\u4e1a\u52a1\u5b9e\u4f53&#xff1a;\u4ece\u4f60\u771f\u6b63\u8981\u56de\u7b54\u7684\u95ee\u9898\u51fa\u53d1&#xff0c;\u53cd\u63a8\u9700\u8981\u54ea\u4e9b\u5b9e\u4f53\u548c\u5173\u7cfb\u3002\u6bd4\u5982\u8981\u56de\u7b54&#034;\u8fd9\u4e2a\u836f\u6cbb\u4ec0\u4e48\u75c5&#034;&#xff0c;\u5c31\u9700\u8981\u00a0\u836f\u7269 -[\u6cbb\u7597]-&gt; \u75be\u75c5\u3002<\/li>\n<li>\u907f\u514d\u8fc7\u5ea6\u8bbe\u8ba1&#xff1a;\u4e0d\u8981\u628a\u73b0\u5b9e\u4e2d\u6240\u6709\u5c5e\u6027\u90fd\u5efa\u6a21\u6210\u5b9e\u4f53\u3002\u80fd\u4f5c\u4e3a\u5c5e\u6027&#xff08;Property&#xff09;\u5c31\u4e0d\u8981\u786c\u62c6\u6210\u8282\u70b9\u3002\u6bd4\u5982&#034;\u4ef7\u683c 99 \u5143&#034;\u662f\u5546\u54c1\u5c5e\u6027&#xff0c;\u4e0d\u5fc5\u5355\u72ec\u5efa\u4e00\u4e2a&#034;\u4ef7\u683c&#034;\u8282\u70b9\u3002<\/li>\n<li>\u81ea\u9876\u5411\u4e0b &#043; \u81ea\u5e95\u5411\u4e0a\u7ed3\u5408&#xff1a;\u5148\u7528\u4e1a\u52a1\u4e13\u5bb6\u5b9a\u6838\u5fc3 schema&#xff0c;\u518d\u5728\u6570\u636e\u62bd\u53d6\u8fc7\u7a0b\u4e2d\u53d1\u73b0\u9057\u6f0f&#xff0c;\u53cd\u5411\u8865\u5145\u3002<\/li>\n<li>\u5173\u7cfb\u8981\u53cc\u5411\u53ef\u8bfb\u3001\u547d\u540d\u6e05\u6670&#xff1a;A -[\u96c7\u4f63]-&gt; B\u00a0\u6bd4\u00a0A -[\u76f8\u5173]-&gt; B\u00a0\u6709\u4ef7\u503c\u5f97\u591a\u3002&#034;\u76f8\u5173&#034;\u8fd9\u7c7b\u6a21\u7cca\u5173\u7cfb\u4f1a\u8ba9\u56fe\u8c31\u5931\u53bb\u63a8\u7406\u80fd\u529b\u3002<\/li>\n<p>\u793a\u4f8b\u672c\u4f53&#xff08;\u4f01\u4e1a\u4eba\u624d\u56fe\u8c31&#xff09;&#xff1a;<\/p>\n<p>\u5b9e\u4f53\u7c7b\u578b:<br \/>\n  &#8211; Person:   {name, title, email}<br \/>\n  &#8211; Company:  {name, industry, founded_year}<br \/>\n  &#8211; Position: {name}<\/p>\n<p>\u5173\u7cfb\u7c7b\u578b:<br \/>\n  &#8211; Person -[\u5de5\u4f5c\u4e8e]-&gt; Company<br \/>\n  &#8211; Person -[\u62c5\u4efb]-&gt; Position<br \/>\n  &#8211; Person -[\u6bd5\u4e1a\u4e8e]-&gt; School<br \/>\n  &#8211; Company -[\u6536\u8d2d]-&gt; Company<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9&#xff1a;\u5148\u60f3\u6e05\u695a&#034;\u56fe\u8c31\u7528\u6765\u56de\u7b54\u4ec0\u4e48\u95ee\u9898&#034;&#xff0c;\u518d\u8bbe\u8ba1\u672c\u4f53\u3002\u4e3a\u5efa\u6a21\u800c\u5efa\u6a21\u3001\u628a\u672c\u4f53\u8bbe\u8ba1\u5f97\u53c8\u5927\u53c8\u5168&#xff0c;\u4f1a\u5bfc\u81f4\u540e\u7eed\u62bd\u53d6\u6210\u672c\u7206\u70b8\u3001\u56fe\u8c31\u5229\u7528\u7387\u6781\u4f4e\u300220 \u4e2a\u5b9e\u4f53\u7c7b\u578b\u5f80\u5f80\u6bd4 200 \u4e2a\u66f4\u5b9e\u7528\u3002<\/p>\n<h4 id=\"23-\u5b9e\u4f53\u8bc6\u522b\u4e0e\u5173\u7cfb\u62bd\u53d6llm-\u8f85\u52a9\u62bd\u53d6\u4e09\u5143\u7ec4\">2.3 \u5b9e\u4f53\u8bc6\u522b\u4e0e\u5173\u7cfb\u62bd\u53d6&#xff1a;LLM \u8f85\u52a9\u62bd\u53d6\u4e09\u5143\u7ec4<\/h4>\n<p>\u539f\u7406&#xff1a;\u4ece\u975e\u7ed3\u6784\u5316\u6587\u672c\u4e2d\u63d0\u53d6\u00a0(Subject, Predicate, Object)\u00a0\u4e09\u5143\u7ec4\u3002\u4f8b\u5982\u4ece\u53e5\u5b50&#034;\u4e54\u5e03\u65af\u4e8e 1976 \u5e74\u521b\u7acb\u4e86\u82f9\u679c\u516c\u53f8&#034;\u63d0\u53d6&#xff1a;<\/p>\n<p> (\u4e54\u5e03\u65af, \u521b\u7acb, \u82f9\u679c\u516c\u53f8)<br \/>\n(\u4e54\u5e03\u65af, \u5de5\u4f5c\u4e8e, \u82f9\u679c\u516c\u53f8)<br \/>\n(\u82f9\u679c\u516c\u53f8, \u6210\u7acb\u5e74\u4efd, 1976)<\/p>\n<p>\u4f20\u7edf\u65b9\u6cd5&#xff1a;SpaCy\u3001Stanford CoreNLP \u8bad\u7ec3\u9886\u57df NER \u6a21\u578b\u2014\u2014\u9700\u8981\u6807\u6ce8\u6570\u636e\u3001\u8bad\u7ec3\u6210\u672c\u9ad8\u3001\u6362\u9886\u57df\u8981\u91cd\u8bad\u3002<\/p>\n<p>2024-2026 \u4e3b\u6d41&#xff1a;LLM-based Extraction&#xff08;Few-shot &#043; Schema-guided&#xff09;&#xff1a;<\/p>\n<li>Few-shot Prompting&#xff1a;\u7ed9 LLM \u51e0\u4e2a\u793a\u4f8b&#xff0c;\u8ba9\u5b83\u4ece\u6587\u672c\u4e2d\u76f4\u63a5\u62bd\u4e09\u5143\u7ec4&#xff1b;<\/li>\n<li>Schema-guided Prompting&#xff08;\u63a8\u8350&#xff09;&#xff1a;\u628a 2.2 \u8282\u5b9a\u4e49\u597d\u7684\u672c\u4f53\u5199\u8fdb Prompt&#xff0c;\u5f3a\u5236 LLM\u00a0\u53ea\u8f93\u51fa\u7b26\u5408\u672c\u4f53\u7684\u5b9e\u4f53\u548c\u5173\u7cfb\u2014\u2014\u4fdd\u8bc1\u56fe\u8c31\u7ed3\u6784\u89c4\u8303&#xff0c;\u907f\u514d&#034;\u81ea\u7531\u53d1\u6325&#034;\u51fa\u6765\u7684\u4e71\u4e03\u516b\u7cdf\u7684\u5173\u7cfb\u3002<\/li>\n<p>from langchain.llms import OpenAI<br \/>\nfrom langchain.chains import create_extraction_chain<\/p>\n<p>schema &#061; {<br \/>\n    &#034;properties&#034;: [<br \/>\n        {&#034;name&#034;: &#034;subject&#034;, &#034;type&#034;: &#034;string&#034;, &#034;description&#034;: &#034;\u4e3b\u4f53\u5b9e\u4f53&#034;},<br \/>\n        {&#034;name&#034;: &#034;relation&#034;, &#034;type&#034;: &#034;string&#034;, &#034;description&#034;: &#034;\u5173\u7cfb&#xff0c;\u53d6\u503c\u9650\u5b9a\u4e3a: \u5de5\u4f5c\u4e8e\/\u521b\u7acb\/\u6536\u8d2d\/\u6bd5\u4e1a\u4e8e&#034;},<br \/>\n        {&#034;name&#034;: &#034;object&#034;, &#034;type&#034;: &#034;string&#034;, &#034;description&#034;: &#034;\u5ba2\u4f53\u5b9e\u4f53&#034;},<br \/>\n    ],<br \/>\n    &#034;required&#034;: [&#034;subject&#034;, &#034;relation&#034;, &#034;object&#034;],<br \/>\n}<br \/>\nchain &#061; create_extraction_chain(llm, schema)<br \/>\nres &#061; chain.run(&#034;\u4e54\u5e03\u65af\u4e8e1976\u5e74\u521b\u7acb\u4e86\u82f9\u679c\u516c\u53f8\u3002&#034;)<br \/>\n# \u8f93\u51fa: [{&#034;subject&#034;: &#034;\u4e54\u5e03\u65af&#034;, &#034;relation&#034;: &#034;\u521b\u7acb&#034;, &#034;object&#034;: &#034;\u82f9\u679c\u516c\u53f8&#034;}]<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9 1&#xff1a;LLM \u62bd\u53d6\u975e\u5e38\u6d88\u8017 Token&#xff08;\u5927\u91cf\u8f93\u5165 &#043; \u7ed3\u6784\u5316\u8f93\u51fa&#xff09;&#xff0c;\u662f RAG \u4f53\u7cfb\u7684&#034;\u6210\u672c\u5927\u5934&#034;\u3002\u5efa\u8bae&#xff1a;\u2460 \u4f18\u5148\u7528\u00a0Batch API\u00a0\u6279\u91cf\u5904\u7406&#xff1b;\u2461 \u5bf9\u9ad8\u9891\u62bd\u53d6\u4efb\u52a1\u5fae\u8c03\u4e00\u4e2a\u5c0f\u6a21\u578b&#xff08;\u5982 Llama-3.1-8B&#xff09;&#xff0c;\u6210\u672c\u80fd\u964d\u4e00\u4e2a\u6570\u91cf\u7ea7\u3002<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9 2&#xff1a;LLM \u62bd\u53d6\u7ed3\u679c\u5fc5\u987b\u505a\u6821\u9a8c\u3002\u7528\u6b63\u5219\/\u89c4\u5219\u8fc7\u6ee4\u660e\u663e\u9519\u8bef&#xff0c;\u7528\u7f6e\u4fe1\u5ea6\u9608\u503c\u4e22\u5f03\u4f4e\u8d28\u91cf\u4e09\u5143\u7ec4&#xff0c;\u5426\u5219&#034;\u5783\u573e\u4e09\u5143\u7ec4\u8fdb\u56fe\u8c31&#034;&#xff0c;\u63a8\u7406\u7ed3\u679c\u5168\u662f\u9519\u7684\u3002<\/p>\n<h4 id=\"24-\u56fe\u6570\u636e\u5e93\u9009\u578bneo4j-nebulagraph-janusgraph\">2.4 \u56fe\u6570\u636e\u5e93\u9009\u578b&#xff1a;Neo4j \/ NebulaGraph \/ JanusGraph<\/h4>\n<p>\u539f\u7406&#xff1a;\u56fe\u6570\u636e\u5e93\u4e13\u95e8\u4e3a&#034;\u8282\u70b9 &#043; \u5173\u7cfb&#034;\u7684\u9ad8\u6548\u904d\u5386\u8bbe\u8ba1&#xff0c;\u63d0\u4f9b\u56fe\u67e5\u8be2\u8bed\u8a00&#xff08;Cypher \/ nGQL \/ Gremlin&#xff09;\u3002<\/p>\n<p>\u901a\u4fd7\u7c7b\u6bd4&#xff1a;\u56fe\u6570\u636e\u5e93\u662f&#034;\u4e13\u4e3a\u67e5\u5173\u7cfb\u7f51\u4f18\u5316\u7684\u641c\u7d22\u5f15\u64ce&#034;\u2014\u2014\u67e5\u8be2&#034;A \u7684\u670b\u53cb\u7684\u670b\u53cb\u91cc\u6709\u54ea\u4e9b\u662f\u533b\u751f&#034;&#xff0c;\u5b83\u6beb\u79d2\u7ea7\u8fd4\u56de&#xff1b;\u800c\u4f20\u7edf\u5173\u7cfb\u578b\u6570\u636e\u5e93\u505a\u540c\u6837\u7684\u591a\u8868 JOIN \u4f1a\u6162\u5230\u5d29\u6e83\u3002<\/p>\n<p>\u9009\u578b\u5bf9\u6bd4&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u6570\u636e\u5e93\u6838\u5fc3\u7279\u70b9\u4f18\u70b9\u7f3a\u70b9\u9002\u5408\u573a\u666f<\/tr>\n<tr>\n<td>Neo4j<\/td>\n<td>\u6700\u6d41\u884c&#xff0c;Cypher \u67e5\u8be2\u8bed\u8a00&#xff0c;\u751f\u6001\u5b8c\u5584&#xff08;APOC \u63d2\u4ef6&#xff09;<\/td>\n<td>\u793e\u533a\u5927\u3001\u5de5\u5177\u591a\u3001\u4e0a\u624b\u5feb\u3001\u6587\u6863\u5168<\/td>\n<td>\u5f00\u6e90\u7248&#xff08;Community&#xff09;\u4e0d\u652f\u6301\u9ad8\u53ef\u7528\u96c6\u7fa4<\/td>\n<td>\u4e2d\u5c0f\u4f01\u4e1a\u3001\u56e2\u961f\u5b66\u4e60\u6210\u672c\u4f4e\u3001\u5feb\u901f\u4ea4\u4ed8<\/td>\n<\/tr>\n<tr>\n<td>NebulaGraph<\/td>\n<td>\u56fd\u4ea7\u5f00\u6e90&#xff0c;\u5206\u5e03\u5f0f\u67b6\u6784&#xff0c;\u517c\u5bb9 OpenCypher<\/td>\n<td>\u6027\u80fd\u5f3a\u3001\u652f\u6301\u8d85\u5927\u89c4\u6a21\u56fe\u8c31\u3001\u4e91\u539f\u751f<\/td>\n<td>\u5b66\u4e60\u66f2\u7ebf\u9661\u3001\u751f\u6001\u4e0d\u5982 Neo4j<\/td>\n<td>\u767e\u4e07\u4ebf\u7ea7\u8fb9\u3001\u9ad8\u5e76\u53d1\u751f\u4ea7\u73af\u5883<\/td>\n<\/tr>\n<tr>\n<td>JanusGraph<\/td>\n<td>\u5b8c\u5168\u5f00\u6e90&#xff0c;\u652f\u6301 HBase\/Cassandra \u7b49\u591a\u540e\u7aef<\/td>\n<td>\u7075\u6d3b\u6027\u9ad8\u3001\u652f\u6301\u6d77\u91cf\u6570\u636e<\/td>\n<td>\u67b6\u6784\u590d\u6742\u3001\u9700\u81ea\u7ef4\u62a4\u5b58\u50a8\u4e0e\u7d22\u5f15\u3001\u5ef6\u8fdf\u8f83\u9ad8<\/td>\n<td>\u6df1\u5ea6\u5b9a\u5236\u3001\u5df2\u6709\u5927\u6570\u636e\u7ec4\u4ef6\u6808<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Neo4j Cypher \u793a\u4f8b&#xff1a;<\/p>\n<p>\/\/ \u5efa\u8282\u70b9<br \/>\nCREATE (p:Person {name: &#034;\u4e54\u5e03\u65af&#034;})<br \/>\nCREATE (c:Company {name: &#034;\u82f9\u679c\u516c\u53f8&#034;})<\/p>\n<p>\/\/ \u5efa\u5173\u7cfb<br \/>\nMATCH (p:Person {name: &#034;\u4e54\u5e03\u65af&#034;}), (c:Company {name: &#034;\u82f9\u679c\u516c\u53f8&#034;})<br \/>\nCREATE (p)-[:\u521b\u7acb {year: 1976}]-&gt;(c)<\/p>\n<p>\/\/ \u591a\u8df3\u67e5\u8be2&#xff1a;\u4e54\u5e03\u65af\u521b\u7acb\u7684\u516c\u53f8\u53d1\u5e03\u4e86\u54ea\u4e9b\u4ea7\u54c1&#xff1f;<br \/>\nMATCH (p:Person {name: &#034;\u4e54\u5e03\u65af&#034;})-[:\u521b\u7acb]-&gt;(c:Company)-[:\u53d1\u5e03]-&gt;(prod:Product)<br \/>\nRETURN prod.name<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9&#xff1a;\u4e0d\u8981\u7528\u56fe\u6570\u636e\u5e93\u5b58\u5927\u6bb5\u6587\u672c\u539f\u6587\u3002\u56fe\u6570\u636e\u5e93\u64c5\u957f\u5173\u7cfb\u904d\u5386&#xff0c;\u4e0d\u64c5\u957f\u5168\u6587\u68c0\u7d22\u3002\u6b63\u786e\u59ff\u52bf\u662f**&#034;\u5411\u91cf\u5e93\u5b58\u539f\u6587\u3001\u56fe\u5e93\u5b58\u5173\u7cfb&#034;**&#xff1a;\u6587\u672c\u68c0\u7d22\u8d70\u5411\u91cf\u5e93&#xff0c;\u5173\u7cfb\u63a8\u7406\u8d70\u56fe\u5e93&#xff0c;\u4e24\u8005\u4e92\u8865&#xff08;\u8be6\u89c1\u7b2c 4 \u90e8\u5206\u67b6\u6784&#xff09;\u3002<\/p>\n<hr \/>\n<h3 id=\"3-graphrag\u77e5\u8bc6\u56fe\u8c31-llm-\u7684\u878d\u5408\">3. GraphRAG&#xff1a;\u77e5\u8bc6\u56fe\u8c31 &#043; LLM \u7684\u878d\u5408<\/h3>\n<h4 id=\"31-\u4e3a\u4ec0\u4e48\u9700\u8981-graphrag\">3.1 \u4e3a\u4ec0\u4e48\u9700\u8981 GraphRAG<\/h4>\n<p>\u4f20\u7edf RAG \u7684\u77ed\u677f&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u95ee\u9898\u7c7b\u578b\u793a\u4f8b\u4f20\u7edf RAG \u8868\u73b0<\/tr>\n<tr>\n<td>\u5168\u5c40\u6027\u95ee\u9898<\/td>\n<td>&#034;\u8fd9\u5957\u7cfb\u7edf\u67b6\u6784\u7684\u6574\u4f53\u6f14\u8fdb\u8d8b\u52bf\u662f\u4ec0\u4e48&#xff1f;&#034;<\/td>\n<td>\u274c \u68c0\u7d22\u5230\u7684\u53ea\u662f\u5c40\u90e8\u7247\u6bb5&#xff0c;\u62fc\u4e0d\u51fa\u5168\u5c40<\/td>\n<\/tr>\n<tr>\n<td>\u591a\u8df3\u63a8\u7406<\/td>\n<td>&#034;X \u516c\u53f8\u7684\u80a1\u4e1c\u4e0e Y \u516c\u53f8\u6709\u4f55\u95f4\u63a5\u5173\u8054&#xff1f;&#034;<\/td>\n<td>\u274c \u5355\u8f6e\u68c0\u7d22\u65e0\u6cd5\u6cbf\u5173\u7cfb\u94fe\u8d70\u4e24\u6b65<\/td>\n<\/tr>\n<tr>\n<td>\u5173\u7cfb\u805a\u5408<\/td>\n<td>&#034;\u54ea\u4e9b\u5458\u5de5\u540c\u65f6\u53c2\u4e0e\u4e86 A \u548c B \u4e24\u4e2a\u9879\u76ee&#xff1f;&#034;<\/td>\n<td>\u274c \u5411\u91cf\u68c0\u7d22\u96be\u4ee5\u505a\u7cbe\u786e\u7684\u5173\u7cfb\u4ea4\u96c6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>GraphRAG&#xff08;\u56fe\u68c0\u7d22\u589e\u5f3a\u751f\u6210&#xff09;\u628a&#034;\u77e5\u8bc6\u56fe\u8c31\u7684\u5173\u7cfb\u63a8\u7406\u80fd\u529b&#034;\u6ce8\u5165 RAG \u6d41\u7a0b&#xff0c;\u4e13\u95e8\u8865\u4e0a\u8fd9\u4e09\u5757\u77ed\u677f\u3002<\/p>\n<h4 id=\"32-\u5fae\u8f6f-graphrag-\u539f\u7406\u5efa\u56fe-\u793e\u533a\u6458\u8981-\u53cc\u901a\u9053\u67e5\u8be2\">3.2 \u5fae\u8f6f GraphRAG \u539f\u7406&#xff1a;\u5efa\u56fe &#043; \u793e\u533a\u6458\u8981 &#043; \u53cc\u901a\u9053\u67e5\u8be2<\/h4>\n<p>\u5fae\u8f6f 2024 \u5e74\u5f00\u6e90\u4e86\u00a0microsoft\/graphrag&#xff0c;\u662f\u76ee\u524d GraphRAG \u4e8b\u5b9e\u4e0a\u7684\u6807\u51c6\u5b9e\u73b0\u3002<\/p>\n<p>\u6784\u5efa\u9636\u6bb5&#xff08;Indexing&#xff09;&#xff1a;<\/p>\n<li>\u5207\u7247&#xff1a;\u4e0e RAG \u7c7b\u4f3c&#xff0c;\u628a\u6587\u6863\u5207\u6210\u7247\u6bb5&#xff1b;<\/li>\n<li>LLM \u5efa\u56fe&#xff1a;\u7528 LLM \u4ece\u6bcf\u4e2a\u7247\u6bb5\u4e2d\u62bd\u53d6\u5b9e\u4f53\u548c\u5173\u7cfb&#xff0c;\u5199\u5165\u77e5\u8bc6\u56fe\u8c31&#xff1b;<\/li>\n<li>\u793e\u533a\u68c0\u6d4b&#xff08;Community Detection&#xff09;&#xff1a;\u7528\u56fe\u7b97\u6cd5&#xff08;\u5982 Leiden&#xff09;\u628a\u56fe\u8c31\u5212\u5206\u6210&#034;\u793e\u533a&#034;&#xff08;\u8054\u7cfb\u7d27\u5bc6\u7684\u8282\u70b9\u7c07&#xff09;&#xff1b;<\/li>\n<li>\u793e\u533a\u6458\u8981&#xff08;Community Summaries&#xff09;&#xff1a;\u7528 LLM \u4e3a\u6bcf\u4e2a\u793e\u533a\u751f\u6210\u4e00\u6bb5\u6458\u8981\u2014\u2014\u76f8\u5f53\u4e8e\u7ed9&#034;\u5173\u7cfb\u7f51&#034;\u5199&#034;\u90e8\u95e8\u7b80\u4ecb&#034;\u3002<\/li>\n<p>\u67e5\u8be2\u9636\u6bb5&#xff08;Query&#xff09;&#xff1a;<\/p>\n<ul>\n<li>Global Search&#xff08;\u5168\u5c40\u641c\u7d22&#xff09;&#xff1a;\u9488\u5bf9&#034;\u603b\u7ed3\u6574\u4e2a\u6570\u636e\u96c6&#034;\u7c7b\u95ee\u9898&#xff0c;\u901a\u8fc7\u00a0Map-Reduce\u00a0\u65b9\u5f0f\u628a\u591a\u4e2a\u793e\u533a\u6458\u8981\u6c47\u603b\u3001\u538b\u7f29&#xff0c;\u518d\u4ea4\u7ed9 LLM \u751f\u6210\u5168\u5c40\u6027\u7b54\u6848&#xff1b;<\/li>\n<li>Local Search&#xff08;\u5c40\u90e8\u641c\u7d22&#xff09;&#xff1a;\u9488\u5bf9&#034;\u67d0\u4e2a\u5177\u4f53\u5b9e\u4f53&#034;\u7684\u95ee\u9898&#xff0c;\u4ece\u8be5\u5b9e\u4f53\u8282\u70b9\u51fa\u53d1&#xff0c;\u6cbf\u56fe\u8c31\u5173\u7cfb\u505a\u591a\u8df3\u68c0\u7d22&#xff0c;\u628a\u76f8\u5173\u90bb\u5c45\u8282\u70b9\u548c\u539f\u6587\u7247\u6bb5\u4e00\u8d77\u4ea4\u7ed9 LLM\u3002<\/li>\n<\/ul>\n<p>                     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n                    \u2502        \u5fae\u8f6f GraphRAG \u6d41\u7a0b       \u2502<br \/>\n                    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n \u6784\u5efa:  \u6587\u6863\u5207\u7247 -&gt; LLM\u62bd\u53d6\u5b9e\u4f53\u5173\u7cfb -&gt; \u56fe\u6570\u636e\u5e93 -&gt; \u793e\u533a\u68c0\u6d4b -&gt; \u793e\u533a\u6458\u8981<br \/>\n                                                           \u2502<br \/>\n \u67e5\u8be2:  Global Search: \u6c47\u603b\u591a\u4e2a\u793e\u533a\u6458\u8981 (Map-Reduce) \u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n        Local Search: \u5b9e\u4f53\u8282\u70b9\u51fa\u53d1 -&gt; \u591a\u8df3\u68c0\u7d22\u90bb\u5c45 &#043; \u539f\u6587<\/p>\n<p># \u5b89\u88c5\u4e0e\u521d\u59cb\u5316&#xff08;microsoft\/graphrag&#xff09;<br \/>\npip install graphrag<\/p>\n<p># \u521d\u59cb\u5316\u9879\u76ee&#xff08;\u4f1a\u751f\u6210 settings.yaml \u7b49\u914d\u7f6e\u6587\u4ef6&#xff09;<br \/>\ngraphrag init &#8211;root .\/ragproject<\/p>\n<p># \u7d22\u5f15\u6784\u5efa&#xff08;\u6784\u5efa\u9636\u6bb5&#xff1a;\u89e3\u6790 -&gt; \u5207\u7247 -&gt; LLM \u5efa\u56fe -&gt; \u793e\u533a\u6458\u8981&#xff09;<br \/>\ngraphrag index &#8211;root .\/ragproject<\/p>\n<p># \u67e5\u8be2&#xff08;\u5168\u5c40 \/ \u5c40\u90e8&#xff09;<br \/>\ngraphrag query &#8211;root .\/ragproject &#8211;method global &#8211;query &#034;\u8fd9\u4efd\u6587\u6863\u7684\u6838\u5fc3\u4e3b\u9898\u662f\u4ec0\u4e48&#xff1f;&#034;<br \/>\ngraphrag query &#8211;root .\/ragproject &#8211;method local  &#8211;query &#034;\u4e54\u5e03\u65af\u521b\u7acb\u4e86\u54ea\u4e9b\u516c\u53f8&#xff1f;&#034;<\/p>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9&#xff1a;GraphRAG \u7684\u7d22\u5f15\u6784\u5efa\u975e\u5e38\u6602\u8d35&#xff08;\u6bcf\u4e2a\u7247\u6bb5\u90fd\u8981 LLM \u62bd\u4e09\u5143\u7ec4 &#043; \u751f\u6210\u793e\u533a\u6458\u8981&#xff09;&#xff0c;\u6784\u5efa\u65f6\u95f4\u4ee5&#034;\u5c0f\u65f6&#034;\u8ba1\u662f\u5e38\u6001\u3002\u5148\u5728\u5c0f\u6570\u636e\u96c6\u4e0a\u8dd1\u901a&#xff0c;\u786e\u8ba4\u6548\u679c\u540e\u518d\u5168\u91cf\u6784\u5efa&#xff1b;\u4e0d\u8981\u4e00\u4e0a\u6765\u5c31\u5bf9 100 \u4e07\u6587\u6863\u8dd1\u7d22\u5f15\u3002<\/p>\n<h4 id=\"33-\u5176\u4ed6\u7ed3\u5408\u6a21\u5f0ftogvector-graph-\u6df7\u5408\">3.3 \u5176\u4ed6\u7ed3\u5408\u6a21\u5f0f&#xff1a;ToG\u3001Vector &#043; Graph \u6df7\u5408<\/h4>\n<p>\u9664\u5fae\u8f6f GraphRAG \u5916&#xff0c;\u8fd8\u6709\u51e0\u79cd\u4e3b\u6d41\u7ed3\u5408\u6a21\u5f0f&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u6a21\u5f0f\u6838\u5fc3\u601d\u60f3\u9002\u5408\u573a\u666f<\/tr>\n<tr>\n<td>ToG&#xff08;Think-on-Graph&#xff09;<\/td>\n<td>LLM \u5728\u63a8\u7406\u8fc7\u7a0b\u4e2d\u6bcf\u4e00\u6b65\u90fd\u5230\u56fe\u4e0a\u6267\u884c\u641c\u7d22&#xff0c;\u50cf\u4eba\u4e00\u6837\u6cbf\u7740\u5173\u7cfb\u8def\u5f84\u8fb9\u60f3\u8fb9\u8d70<\/td>\n<td>\u9700\u8981\u9010\u6b65\u63a8\u7406\u7684\u590d\u6742\u95ee\u7b54<\/td>\n<\/tr>\n<tr>\n<td>Vector &#043; Graph \u6df7\u5408<\/td>\n<td>\u5148\u7528\u5411\u91cf\u68c0\u7d22\u627e\u5230\u8d77\u59cb\u8282\u70b9&#xff0c;\u518d\u6cbf\u56fe\u904d\u5386\u53d1\u73b0\u5173\u8054\u8282\u70b9<\/td>\n<td>\u5927\u591a\u6570\u751f\u4ea7\u843d\u5730\u573a\u666f&#xff0c;\u6027\u4ef7\u6bd4\u6700\u9ad8<\/td>\n<\/tr>\n<tr>\n<td>Graph \u4f5c\u4e3a\u9a8c\u8bc1\u5c42<\/td>\n<td>\u5411\u91cf\u68c0\u7d22\u51fa\u5019\u9009\u7b54\u6848\u540e&#xff0c;\u7528\u56fe\u8c31\u9a8c\u8bc1\u5b9e\u4f53\u5173\u7cfb\u662f\u5426\u6210\u7acb<\/td>\n<td>\u63d0\u9ad8\u7b54\u6848\u53ef\u4fe1\u5ea6\u3001\u8fc7\u6ee4\u5e7b\u89c9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Vector &#043; Graph \u6df7\u5408\u68c0\u7d22\u4f2a\u4ee3\u7801&#xff1a;<\/p>\n<p>def hybrid_retrieve(question):<br \/>\n    # 1. \u5411\u91cf\u68c0\u7d22&#xff1a;\u627e\u5230\u76f8\u5173\u6587\u672c\u7247\u6bb5\u53ca\u5176\u4e2d\u7684\u5b9e\u4f53<br \/>\n    vec_hits &#061; vector_store.search(question, top_k&#061;20)<\/p>\n<p>    # 2. \u4ece\u7247\u6bb5\u4e2d\u8bc6\u522b\u5b9e\u4f53&#xff08;\u6216\u7528 LLM \u62bd\u53d6&#xff09;<br \/>\n    seed_entities &#061; extract_entities(question) &#043; extract_entities_from(vec_hits)<\/p>\n<p>    # 3. \u56fe\u904d\u5386&#xff1a;\u4ece\u79cd\u5b50\u5b9e\u4f53\u51fa\u53d1&#xff0c;\u591a\u8df3\u6269\u5c55\u5173\u8054\u8282\u70b9<br \/>\n    graph_hits &#061; neo4j.query(<br \/>\n        &#034;MATCH (e) WHERE e.name IN $entities &#034;<br \/>\n        &#034;MATCH (e)-[r*1..2]-(neighbor) RETURN neighbor, r&#034;,<br \/>\n        entities&#061;seed_entities,<br \/>\n    )<\/p>\n<p>    # 4. \u5408\u5e76\u4e24\u7c7b\u7ed3\u679c -&gt; \u7ec4\u88c5 Prompt -&gt; LLM<br \/>\n    return assemble_prompt(question, vec_hits, graph_hits)<\/p>\n<p>\u843d\u5730\u5efa\u8bae&#xff1a;\u751f\u4ea7\u9879\u76ee\u4f18\u5148\u9009\u00a0Vector &#043; Graph \u6df7\u5408\u2014\u2014\u5b83\u4e0d\u9700\u8981\u50cf\u5fae\u8f6f GraphRAG \u90a3\u6837\u6784\u5efa\u6602\u8d35\u7684\u793e\u533a\u6458\u8981&#xff0c;\u6539\u9020\u73b0\u6709 RAG \u7cfb\u7edf\u7684\u6210\u672c\u6700\u4f4e\u3002<\/p>\n<hr \/>\n<h3 id=\"4-\u4ece\u96f6\u642d\u5efa\u5b9e\u73b0\u6b65\u9aa4\u6e05\u5355rag-kg-\u6df7\u5408\u67b6\u6784\">4. \u4ece\u96f6\u642d\u5efa\u5b9e\u73b0\u6b65\u9aa4\u6e05\u5355&#xff08;RAG &#043; KG \u6df7\u5408\u67b6\u6784&#xff09;<\/h3>\n<p>\u4e0b\u9762\u662f\u4e00\u4efd&#034;\u7167\u505a\u5373\u53ef&#034;\u7684 10 \u6b65\u6e05\u5355&#xff0c;\u67b6\u6784\u540c\u65f6\u5305\u542b\u5411\u91cf\u5e93&#xff08;RAG&#xff09;\u4e0e\u56fe\u5e93&#xff08;KG&#xff09;&#xff0c;\u662f\u6807\u51c6\u7684\u4f01\u4e1a\u77e5\u8bc6\u5e93\u5f62\u6001\u3002<\/p>\n<p> \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502                     \u6df7\u5408\u77e5\u8bc6\u5e93\u67b6\u6784\u603b\u89c8                      \u2502<br \/>\n\u2502                                                             \u2502<br \/>\n\u2502   PDF\/MD\/HTML \u2500\u2500\u89e3\u6790\u2500\u2500&gt; \u5207\u7247                                \u2502<br \/>\n\u2502                          \u251c\u2500\u2500&gt; \u5411\u91cf\u5316 -&gt; \u5411\u91cf\u5e93(Milvus)      \u2502<br \/>\n\u2502                          \u2502          \u25b2                       \u2502<br \/>\n\u2502                          \u2502          \u2514\u2500\u2500 \u6df7\u5408\u68c0\u7d22(\u5411\u91cf&#043;BM25) \u2502<br \/>\n\u2502                          \u251c\u2500\u2500&gt; LLM\u62bd\u53d6\u4e09\u5143\u7ec4 -&gt; \u56fe\u5e93(Neo4j)  \u2502<br \/>\n\u2502                          \u2502          \u25b2                       \u2502<br \/>\n\u2502                          \u2502          \u2514\u2500\u2500 \u56fe\u904d\u5386(\u591a\u8df3)        \u2502<br \/>\n\u2502                          \u2514\u2500\u2500&gt; \u539f\u6587\u5b58\u50a8 -&gt; \u5f15\u7528\u6eaf\u6e90          \u2502<br \/>\n\u2502                                                             \u2502<br \/>\n\u2502   \u7528\u6237\u63d0\u95ee -&gt; \u6df7\u5408\u68c0\u7d22 &#043; \u91cd\u6392\u5e8f -&gt; Prompt\u7ec4\u88c5 -&gt; LLM -&gt; \u7b54\u6848\u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<p>\u6b65\u9aa4 1&#xff1a;\u660e\u786e\u95ee\u9898\u57df\u4e0e\u6570\u636e\u76d8\u70b9&#xff08;\u6700\u91cd\u8981\u7684\u4e00\u6b65&#xff09;<\/p>\n<ul>\n<li>\u5217\u51fa\u77e5\u8bc6\u5e93\u8981\u56de\u7b54\u7684\u00a010~20 \u4e2a\u5178\u578b\u95ee\u9898&#xff08;\u5982&#034;\u62a5\u9500\u6d41\u7a0b&#034;&#034;\u67d0\u578b\u53f7\u4ea7\u54c1\u53c2\u6570&#034;&#034;\u79bb\u804c\u5458\u5de5\u4ea4\u63a5&#034;&#xff09;&#xff1b;<\/li>\n<li>\u76d8\u70b9\u6570\u636e\u6e90&#xff1a;\u54ea\u4e9b\u662f PDF\u3001\u54ea\u4e9b\u662f Word\/HTML\u3001\u54ea\u4e9b\u9700\u8981 OCR&#xff1b;<\/li>\n<li>\u5224\u65ad\u6bcf\u7c7b\u95ee\u9898\u8be5\u8d70\u5411\u91cf\u68c0\u7d22&#xff08;\u8bed\u4e49&#xff09;\u8fd8\u662f\u56fe\u8c31\u63a8\u7406&#xff08;\u5173\u7cfb&#xff09;\u2014\u2014\u8fd9\u4e00\u6b65\u51b3\u5b9a\u540e\u9762\u6240\u6709\u67b6\u6784\u9009\u578b\u3002<\/li>\n<\/ul>\n<p>\u6b65\u9aa4 2&#xff1a;\u73af\u5883\u51c6\u5907<\/p>\n<ul>\n<li>Python 3.10&#043;&#xff0c;\u5b89\u88c5\u00a0langchain\u3001unstructured\u3001sentence-transformers\u3001pymilvus\u3001neo4j&#xff1b;<\/li>\n<li>\u51c6\u5907\u4e00\u4e2a Embedding \u6a21\u578b&#xff08;\u63a8\u8350 BGE-M3&#xff09;\u3001\u4e00\u4e2a Reranker&#xff08;BGE-Reranker&#xff09;\u3001\u4e00\u4e2a LLM API&#xff08;GPT-4o \/ Claude \/ DeepSeek \u5747\u53ef&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u6b65\u9aa4 3&#xff1a;\u6587\u6863\u89e3\u6790\u4e0e\u6e05\u6d17<\/p>\n<ul>\n<li>\u7528 Unstructured\/Marker \u89e3\u6790\u5168\u90e8\u6587\u6863&#xff1b;<\/li>\n<li>\u6e05\u6d17&#xff1a;\u53bb\u9875\u7709\u9875\u811a\u3001\u53bb\u91cd\u590d\u7a7a\u767d\u3001\u4fee\u6b63 OCR \u9519\u5b57&#xff1b;<\/li>\n<li>\u62bd\u6837 10% \u4eba\u5de5\u68c0\u67e5\u89e3\u6790\u8d28\u91cf&#xff0c;\u91cd\u70b9\u770b\u8868\u683c\u548c\u516c\u5f0f\u3002<\/li>\n<\/ul>\n<p>\u6b65\u9aa4 4&#xff1a;\u5207\u7247\u4e0e\u5411\u91cf\u5316<\/p>\n<ul>\n<li>\u7ed3\u6784\u5207\u7247&#xff08;Markdown \u6807\u9898\/\u6bb5\u843d&#xff09;\u4e3a\u4e3b&#xff0c;\u8bbe\u7f6e chunk_size&#061;5121024&#xff0c;overlap&#061;50100&#xff1b;<\/li>\n<li>\u7528 Embedding \u6a21\u578b\u6279\u91cf\u5411\u91cf\u5316&#xff0c;\u4fdd\u5b58\u539f\u59cb\u6587\u672c\u3001\u6765\u6e90\u3001\u9875\u53f7\u7b49\u5143\u6570\u636e\u3002<\/li>\n<\/ul>\n<p>\u6b65\u9aa4 5&#xff1a;\u5199\u5165\u5411\u91cf\u5e93<\/p>\n<ul>\n<li>\u5efa Collection&#xff08;\u7ef4\u5ea6\u4e0e\u6a21\u578b\u4e00\u81f4&#xff0c;metric&#061;COSINE&#xff09;&#xff1b;<\/li>\n<li>\u6279\u91cf\u5199\u5165&#xff1b;\u5efa\u7acb\u4e3b\u952e\u7d22\u5f15&#xff08;\u7528\u6587\u6863 ID \u65b9\u4fbf\u540e\u7eed\u66f4\u65b0\u5220\u9664&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u6b65\u9aa4 6&#xff1a;\u77e5\u8bc6\u56fe\u8c31\u62bd\u53d6\u4e0e\u5165\u5e93<\/p>\n<ul>\n<li>\u57fa\u4e8e\u7b2c 2.2 \u8282\u5b9a\u4e49\u7684\u672c\u4f53&#xff0c;\u7528 LLM &#043; Schema-guided Prompt \u62bd\u53d6\u4e09\u5143\u7ec4&#xff1b;<\/li>\n<li>\u5b9e\u4f53\u6d88\u6b67&#xff08;\u540c\u540d\u5b9e\u4f53\u5408\u5e76\u3001\u522b\u540d\u6620\u5c04&#xff0c;\u5982&#034;\u82f9\u679c\u516c\u53f8&#034;&#061; &#034;Apple Inc.&#034;&#xff09;&#xff1b;<\/li>\n<li>\u5199\u5165 Neo4j&#xff0c;\u5efa\u7acb\u552f\u4e00\u7ea6\u675f\u4e0e\u7d22\u5f15&#xff1a; CREATE CONSTRAINT unique_person IF NOT EXISTS FOR (p:Person) REQUIRE p.name IS UNIQUE;<br \/>\nCREATE INDEX company_name_idx IF NOT EXISTS FOR (c:Company) ON (c.name);\n <\/li>\n<\/ul>\n<p>\u6b65\u9aa4 7&#xff1a;\u6784\u5efa\u6df7\u5408\u68c0\u7d22\u5668<\/p>\n<ul>\n<li>\u5411\u91cf\u68c0\u7d22&#xff08;\u8bed\u4e49&#xff09;&#043; BM25 \u5173\u952e\u8bcd\u68c0\u7d22&#xff08;\u7cbe\u786e&#xff09;\u53cc\u8def\u53ec\u56de&#xff0c;\u6309\u6bd4\u4f8b\u878d\u5408&#xff08;\u5982 0.7:0.3&#xff09;&#xff1b;<\/li>\n<li>\u56fe\u68c0\u7d22&#xff1a;\u4ece\u95ee\u9898\u4e2d\u63d0\u53d6\u79cd\u5b50\u5b9e\u4f53&#xff0c;\u505a 1~2 \u8df3\u56fe\u904d\u5386&#xff1b;<\/li>\n<li>\u4e09\u8005\u7ed3\u679c\u5408\u5e76\u53bb\u91cd\u3002<\/li>\n<\/ul>\n<p>\u6b65\u9aa4 8&#xff1a;\u63a5\u5165\u91cd\u6392\u5e8f<\/p>\n<ul>\n<li>\u7528 Reranker \u5bf9\u5019\u9009\u91cd\u65b0\u6253\u5206&#xff0c;\u53ea\u4fdd\u7559 Top-5 \u4ea4\u7ed9 LLM&#xff1b;<\/li>\n<li>\u5728\u9a8c\u8bc1\u96c6\u4e0a\u5bf9\u6bd4&#034;\u6709\u65e0 Reranker&#034;\u7684\u51c6\u786e\u7387\u5dee\u5f02&#xff0c;\u91cf\u5316\u6536\u76ca\u3002<\/li>\n<\/ul>\n<p>\u6b65\u9aa4 9&#xff1a;Prompt \u7ec4\u88c5\u4e0e\u751f\u6210<\/p>\n<ul>\n<li>\u7ed3\u6784\u5316\u6a21\u677f&#xff1a;\u7cfb\u7edf\u6307\u4ee4&#xff08;\u53ea\u4f9d\u636e\u8d44\u6599\u56de\u7b54 &#043; \u627e\u4e0d\u5230\u5c31\u8bf4\u627e\u4e0d\u5230&#xff09;&#043; \u68c0\u7d22\u7247\u6bb5&#xff08;\u5e26\u6765\u6e90&#xff09;&#043; \u95ee\u9898&#xff1b;<\/li>\n<li>\u63a5\u5165 LLM \u751f\u6210\u7b54\u6848&#xff0c;\u5f3a\u5236\u8f93\u51fa\u5f15\u7528\u6807\u6ce8\u3002<\/li>\n<\/ul>\n<p>\u6b65\u9aa4 10&#xff1a;\u8bc4\u4f30\u4e0e\u4e0a\u7ebf<\/p>\n<ul>\n<li>\u7528 Ragas \/ DeepEval \/ LangSmith \u8bc4\u4f30&#xff08;\u6307\u6807\u89c1\u7b2c 5.3 \u8282&#xff09;&#xff1b;<\/li>\n<li>\u6784\u5efa CI \u5f0f\u56de\u5f52\u96c6&#xff1a;\u6bcf\u6b21\u6539\u5207\u7247\u7b56\u7565\/\u6362\u6a21\u578b&#xff0c;\u5148\u8dd1\u4e00\u904d\u8bc4\u4f30\u96c6&#xff0c;\u5206\u6570\u4e0d\u964d\u518d\u4e0a\u7ebf&#xff1b;<\/li>\n<li>\u4e0a\u7ebf\u540e\u63a5\u76d1\u63a7&#xff1a;\u8bb0\u5f55\u68c0\u7d22\u547d\u4e2d\u7387\u3001\u65e0\u5f15\u7528\u56de\u7b54\u5360\u6bd4\u3001\u7528\u6237\u53cd\u9988\u3002<\/li>\n<\/ul>\n<p>\u26a0\ufe0f\u00a0\u6613\u9519\u70b9&#xff08;\u8d2f\u7a7f\u5168\u7a0b&#xff09;&#xff1a;<\/p>\n<ul>\n<li>\u4e0d\u8981\u8df3\u8fc7\u6b65\u9aa4 1\u2014\u2014\u5f88\u591a\u9879\u76ee\u5931\u8d25\u4e0d\u662f\u6280\u672f\u95ee\u9898&#xff0c;\u662f&#034;\u6ca1\u60f3\u6e05\u695a\u8981\u56de\u7b54\u4ec0\u4e48\u95ee\u9898&#034;&#xff1b;<\/li>\n<li>\u4e0d\u8981\u4e00\u6b21\u6027\u5168\u91cf\u5904\u7406\u2014\u2014\u5148\u7528 20~50 \u4efd\u6587\u6863\u8dd1\u901a\u5168\u6d41\u7a0b&#xff0c;\u518d\u6a2a\u5411\u6269\u5c55&#xff1b;<\/li>\n<li>\u6bcf\u4e00\u6b65\u90fd\u8981\u7559&#034;\u53ef\u56de\u6eda&#034;&#xff1a;\u5411\u91cf\u5e93\u7528 version \u5b57\u6bb5\u533a\u5206 Embedding \u6a21\u578b\u7248\u672c&#xff0c;\u56fe\u8c31\u4fdd\u7559\u6784\u5efa\u811a\u672c\u4e0e\u539f\u59cb\u62bd\u53d6\u7ed3\u679c&#xff0c;\u65b9\u4fbf\u91cd\u5efa\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3 id=\"5-\u5173\u952e\u6ce8\u610f\u70b9\u6570\u636e\u8d28\u91cf\u66f4\u65b0\u7ef4\u62a4\u8bc4\u4f30\u6210\u672c\u5e7b\u89c9\">5. \u5173\u952e\u6ce8\u610f\u70b9&#xff1a;\u6570\u636e\u8d28\u91cf\u3001\u66f4\u65b0\u7ef4\u62a4\u3001\u8bc4\u4f30\u3001\u6210\u672c\u3001\u5e7b\u89c9<\/h3>\n<h4 id=\"51-\u6570\u636e\u8d28\u91cfgarbage-in-garbage-out\">5.1 \u6570\u636e\u8d28\u91cf&#xff08;Garbage In, Garbage Out&#xff09;<\/h4>\n<p>\u6838\u5fc3\u539f\u5219&#xff1a;\u89e3\u6790\u9519\u8bef\u7684 PDF \u662f RAG \u5931\u8d25\u7684\u9996\u8981\u539f\u56e0\u3002<\/p>\n<table>\n<tbody>\n<tr>\u6570\u636e\u95ee\u9898\u540e\u679c\u5bf9\u7b56<\/tr>\n<tr>\n<td>\u626b\u63cf\u4ef6\u672a OCR<\/td>\n<td>\u68c0\u7d22\u5168\u662f\u4e71\u7801&#xff0c;\u7b54\u6848\u5168\u9519<\/td>\n<td>\u89e3\u6790\u6d41\u7a0b\u5f3a\u5236 OCR &#043; \u62bd\u6837\u68c0\u67e5<\/td>\n<\/tr>\n<tr>\n<td>\u8868\u683c\u884c\u5217\u9519\u4e71<\/td>\n<td>\u68c0\u7d22\u5230\u6b8b\u7f3a\u8868\u683c&#xff0c;\u6a21\u578b\u8bfb\u4e0d\u61c2<\/td>\n<td>\u8868\u683c\u6574\u4f53\u5207\u7247&#xff0c;\u4e13\u8868\u4e13\u7528\u89e3\u6790\u5668<\/td>\n<\/tr>\n<tr>\n<td>\u8fc7\u671f\/\u77db\u76fe\u6587\u6863<\/td>\n<td>\u65b0\u65e7\u7248\u672c\u7b54\u6848\u4e92\u76f8\u6253\u67b6<\/td>\n<td>\u6587\u6863\u5143\u6570\u636e\u5e26\u7248\u672c\u53f7 &#043; \u751f\u6548\u65e5\u671f<\/td>\n<\/tr>\n<tr>\n<td>\u91cd\u590d\u6587\u6863<\/td>\n<td>\u68c0\u7d22\u7ed3\u679c\u5197\u4f59&#xff0c;\u6d6a\u8d39 token<\/td>\n<td>\u5165\u5e93\u524d\u53bb\u91cd&#xff08;hash &#043; \u8bed\u4e49\u76f8\u4f3c\u5ea6&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u26a0\ufe0f\u00a0\u9884\u8b66&#xff1a;&#034;\u6570\u636e\u6cbb\u7406&#034;\u82b1\u7684\u65f6\u95f4\u5e94\u8be5\u5360\u6574\u4e2a\u9879\u76ee 60% \u4ee5\u4e0a\u3002\u6570\u636e\u6ca1\u6cbb\u7406\u597d\u4e4b\u524d&#xff0c;\u6a21\u578b\u6362\u5f97\u518d\u5f3a\u90fd\u662f\u767d\u642d\u3002<\/p>\n<h4 id=\"52-\u66f4\u65b0\u7ef4\u62a4\">5.2 \u66f4\u65b0\u7ef4\u62a4<\/h4>\n<ul>\n<li>\u5411\u91cf\u5e93&#xff1a;\u652f\u6301\u00a0Upsert&#xff08;\u66f4\u65b0\u63d2\u5165&#xff09;\u2014\u2014\u6587\u6863\u66f4\u65b0\u65f6\u6309\u6587\u6863 ID \u8986\u76d6\u65e7\u5411\u91cf&#xff0c;\u5220\u9664\u65f6\u6309 ID \u5220\u9664&#xff1b;<\/li>\n<li>\u77e5\u8bc6\u56fe\u8c31&#xff1a;\n<ul>\n<li>\u5b9e\u4f53\u6d88\u6b67&#xff08;Entity Resolution&#xff09;\u975e\u5e38\u96be\u3002\u65b0\u6570\u636e\u5165\u5e93\u65f6&#xff0c;\u8981\u5224\u5b9a &#034;Apple Inc.&#034; \u548c&#034;\u82f9\u679c\u516c\u53f8&#034;\u662f\u5426\u6307\u5411\u540c\u4e00\u8282\u70b9\u2014\u2014\u5efa\u8bae\u7ef4\u62a4\u522b\u540d\u8868&#xff08;Alias Table&#xff09;&#xff0c;\u5148\u67e5\u8868\u518d\u5efa\u8282\u70b9&#xff1b;<\/li>\n<li>\u5173\u7cfb\u65f6\u6548\u6027&#xff1a;\u5173\u7cfb\u8981\u5e26\u65f6\u95f4\u5c5e\u6027&#xff08;\u5982&#034;\u4efb\u804c\u4e8e 2019-2023&#034;&#xff09;&#xff0c;\u907f\u514d\u628a\u5386\u53f2\u5173\u7cfb\u5f53\u73b0\u72b6&#xff1b;<\/li>\n<li>\u589e\u91cf\u62bd\u53d6&#xff1a;\u53ea\u5bf9\u65b0\u589e\u6587\u6863\u505a\u62bd\u53d6&#xff0c;\u4e0d\u8981\u6bcf\u6b21\u5168\u91cf\u91cd\u5efa\u56fe\u8c31\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4 id=\"53-\u8bc4\u4f30\u6307\u6807\">5.3 \u8bc4\u4f30\u6307\u6807<\/h4>\n<p>\u8bc4\u4f30\u5206\u4e24\u5c42\u2014\u2014\u68c0\u7d22\u5c42\u548c\u751f\u6210\u5c42&#xff0c;\u63a8\u8350\u5de5\u5177&#xff1a;Ragas\u3001DeepEval\u3001LangSmith\u3002<\/p>\n<table>\n<tbody>\n<tr>\u5c42\u7ea7\u6307\u6807\u542b\u4e49\u901a\u4fd7\u7406\u89e3<\/tr>\n<tr>\n<td>\u68c0\u7d22\u5c42<\/td>\n<td>Hit Rate&#xff08;\u547d\u4e2d\u7387&#xff09;<\/td>\n<td>\u6b63\u786e\u7b54\u6848\u662f\u5426\u88ab\u53ec\u56de<\/td>\n<td>\u9c7c\u662f\u4e0d\u662f\u635e\u8fdb\u7f51\u91cc\u4e86<\/td>\n<\/tr>\n<tr>\n<td>\u68c0\u7d22\u5c42<\/td>\n<td>MRR&#xff08;\u5e73\u5747\u5012\u6570\u6392\u540d&#xff09;<\/td>\n<td>\u6b63\u786e\u7b54\u6848\u6392\u5f97\u591a\u9760\u524d<\/td>\n<td>\u9c7c\u662f\u4e0d\u662f\u635e\u5728\u7f51\u53e3\u9644\u8fd1<\/td>\n<\/tr>\n<tr>\n<td>\u68c0\u7d22\u5c42<\/td>\n<td>NDCG<\/td>\n<td>\u6392\u5e8f\u8d28\u91cf\u6574\u4f53\u8bc4\u4f30<\/td>\n<td>\u9c7c\u7684\u5927\u5c0f\u662f\u5426\u6309\u4ef7\u503c\u6392\u597d<\/td>\n<\/tr>\n<tr>\n<td>\u751f\u6210\u5c42<\/td>\n<td>Faithfulness&#xff08;\u5fe0\u5b9e\u5ea6&#xff09;<\/td>\n<td>\u7b54\u6848\u662f\u5426\u5fe0\u4e8e\u68c0\u7d22\u8d44\u6599<\/td>\n<td>\u6709\u6ca1\u6709\u8131\u79bb\u8d44\u6599\u7f16\u778e\u8bdd<\/td>\n<\/tr>\n<tr>\n<td>\u751f\u6210\u5c42<\/td>\n<td>Answer Relevance&#xff08;\u7b54\u6848\u76f8\u5173\u6027&#xff09;<\/td>\n<td>\u7b54\u6848\u662f\u5426\u5207\u9898<\/td>\n<td>\u7b54\u975e\u6240\u95ee\u6ca1\u6709<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p># Ragas \u8bc4\u4f30\u793a\u4f8b<br \/>\nfrom ragas import evaluate<br \/>\nfrom ragas.metrics import faithfulness, answer_relevancy, context_precision<\/p>\n<p>result &#061; evaluate(<br \/>\n    dataset&#061;test_dataset,          # \u5305\u542b question \/ answer \/ contexts \/ ground_truth<br \/>\n    metrics&#061;[faithfulness, answer_relevancy, context_precision],<br \/>\n)<br \/>\nprint(result)<\/p>\n<p>\u26a0\ufe0f\u00a0\u9884\u8b66&#xff1a;\u8bc4\u4f30\u96c6\u5fc5\u987b\u771f\u5b9e\u2014\u2014\u7528\u7ebf\u4e0a\u771f\u5b9e\u7528\u6237\u95ee\u9898\u6784\u5efa&#xff0c;\u4e0d\u8981\u7528&#034;\u611f\u89c9\u50cf&#034;\u7684\u6837\u4f8b\u3002\u8bc4\u4f30\u96c6\u8981\u6301\u7eed\u6269\u5145&#xff0c;\u6bcf\u6b21\u4e1a\u52a1\u53d8\u5316\u90fd\u5f80\u91cc\u52a0\u65b0\u95ee\u9898\u3002<\/p>\n<h4 id=\"54-\u6210\u672c\u63a7\u5236\">5.4 \u6210\u672c\u63a7\u5236<\/h4>\n<table>\n<tbody>\n<tr>\u6210\u672c\u9879\u63a7\u5236\u624b\u6bb5<\/tr>\n<tr>\n<td>LLM \u62bd\u53d6\u4e09\u5143\u7ec4&#xff08;\u5927\u5934&#xff09;<\/td>\n<td>Batch API \u6279\u91cf\u5904\u7406&#xff1b;\u9488\u5bf9\u62bd\u53d6\u5fae\u8c03\u5c0f\u6a21\u578b&#xff08;Llama-3.1-8B \u7ea7\u522b&#xff09;&#xff1b;\u53ea\u62bd&#034;\u80fd\u56de\u7b54\u95ee\u9898&#034;\u7684\u5b9e\u4f53<\/td>\n<\/tr>\n<tr>\n<td>Embedding \u8c03\u7528<\/td>\n<td>\u672c\u5730\u90e8\u7f72\u5f00\u6e90\u6a21\u578b&#xff08;BGE \u7cfb\u5217&#xff09;&#xff0c;\u4e00\u6b21\u5411\u91cf\u5316\u957f\u671f\u590d\u7528<\/td>\n<\/tr>\n<tr>\n<td>\u6bcf\u6b21\u95ee\u7b54\u7684 token<\/td>\n<td>Prompt \u538b\u7f29&#xff08;LLMLingua&#xff09;\u3001\u9650\u5236 Top-K\u3001\u9650\u5236\u7247\u6bb5\u957f\u5ea6<\/td>\n<\/tr>\n<tr>\n<td>\u7d22\u5f15\u6784\u5efa<\/td>\n<td>\u589e\u91cf\u6784\u5efa&#xff0c;\u4e0d\u8981\u9891\u7e41\u5168\u91cf\u91cd\u5efa<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u26a0\ufe0f\u00a0\u9884\u8b66&#xff1a;\u5148\u4f30\u7b97\u518d\u52a8\u624b\u3002100 \u4e07\u6587\u6863\u5168\u91cf\u62bd\u53d6\u4e09\u5143\u7ec4&#xff0c;\u6309 LLM API \u5355\u4ef7&#xff0c;\u6210\u672c\u53ef\u80fd\u5728\u6570\u5343\u5230\u6570\u4e07\u7f8e\u5143\u91cf\u7ea7\u2014\u2014\u5148\u5c0f\u89c4\u6a21\u8bd5\u8dd1&#xff0c;\u91cf\u51fa\u5355\u6587\u6863\u6210\u672c&#xff0c;\u518d\u4e58\u4ee5\u603b\u91cf\u505a\u9884\u7b97\u3002<\/p>\n<h4 id=\"55-\u5e7b\u89c9\u63a7\u5236\">5.5 \u5e7b\u89c9\u63a7\u5236<\/h4>\n<table>\n<tbody>\n<tr>\u624b\u6bb5\u8bf4\u660e<\/tr>\n<tr>\n<td>\u5f3a\u5236\u5f15\u7528<\/td>\n<td>Prompt \u8981\u6c42&#034;\u6bcf\u4e2a\u7ed3\u8bba\u5fc5\u987b\u6807\u6ce8\u6765\u6e90&#034;&#xff0c;\u65e0\u6765\u6e90\u4e0d\u8f93\u51fa<\/td>\n<\/tr>\n<tr>\n<td>\u627e\u4e0d\u5230\u5c31\u627f\u8ba4<\/td>\n<td>\u660e\u786e\u6307\u4ee4&#xff1a;\u8d44\u6599\u4e2d\u6ca1\u6709\u7684&#xff0c;\u56de\u7b54&#034;\u672a\u627e\u5230&#034;&#xff0c;\u7981\u6b62\u7f16\u9020<\/td>\n<\/tr>\n<tr>\n<td>\u56fe\u8c31\u9a8c\u8bc1<\/td>\n<td>\u7528\u77e5\u8bc6\u56fe\u8c31\u6821\u9a8c\u7b54\u6848\u4e2d\u7684\u5b9e\u4f53\u5173\u7cfb\u662f\u5426\u771f\u5b9e\u5b58\u5728<\/td>\n<\/tr>\n<tr>\n<td>\u7b54\u6848\u6eaf\u6e90 UI<\/td>\n<td>\u524d\u7aef\u5c55\u793a\u5f15\u7528\u6765\u6e90&#xff08;\u6587\u6863\u540d &#043; \u9875\u53f7 &#043; \u9ad8\u4eae\u7247\u6bb5&#xff09;&#xff0c;\u7528\u6237\u53ef\u81ea\u884c\u9a8c\u8bc1<\/td>\n<\/tr>\n<tr>\n<td>\u4f4e\u7f6e\u4fe1\u5ea6\u62e6\u622a<\/td>\n<td>\u68c0\u7d22\u76f8\u5173\u6027\u4f4e\u4e8e\u9608\u503c\u65f6&#xff0c;\u76f4\u63a5\u63d0\u793a&#034;\u8d44\u6599\u4e0d\u8db3&#034;&#xff0c;\u4e0d\u786c\u7b54<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3 id=\"6-\u771f\u5b9e\u5b9e\u73b0\u6848\u4f8b2024-2026\">6. \u771f\u5b9e\u5b9e\u73b0\u6848\u4f8b&#xff08;2024-2026&#xff09;<\/h3>\n<h4 id=\"\u6848\u4f8b-1\u5fae\u8f6f\u5f00\u6e90-graphrag2024\">\u6848\u4f8b 1&#xff1a;\u5fae\u8f6f\u5f00\u6e90 GraphRAG&#xff08;2024&#xff09;<\/h4>\n<ul>\n<li>\u573a\u666f&#xff1a;\u5206\u6790\u5e9e\u5927\u7684\u5185\u90e8\u6280\u672f\u6587\u6863\u4e0e\u5f00\u6e90\u793e\u533a\u6570\u636e&#xff0c;\u56de\u7b54&#034;\u67b6\u6784\u6f14\u8fdb\u8d8b\u52bf&#034;\u7b49\u5168\u5c40\u6027\u95ee\u9898&#xff1b;<\/li>\n<li>\u5b9e\u73b0&#xff1a;\u5229\u7528 LLM \u81ea\u52a8\u6784\u5efa\u77e5\u8bc6\u56fe\u8c31\u7d22\u5f15&#xff08;\u62bd\u53d6\u5b9e\u4f53\u5173\u7cfb &#043; \u793e\u533a\u68c0\u6d4b &#043; \u793e\u533a\u6458\u8981&#xff09;&#xff0c;\u67e5\u8be2\u65f6 Global\/Local \u53cc\u901a\u9053&#xff1b;<\/li>\n<li>\u6548\u679c&#xff1a;\u56de\u7b54\u5168\u5c40\u6027\u95ee\u9898\u65f6\u51c6\u786e\u7387\u8fdc\u8d85\u4f20\u7edf RAG&#xff1b;\u9a8c\u8bc1\u4e86&#034;\u5173\u7cfb\u578b\u77e5\u8bc6&#034;\u5fc5\u987b\u7528\u56fe\u7ed3\u6784\u627f\u8f7d&#xff1b;<\/li>\n<li>\u542f\u793a&#xff1a;\u5982\u679c\u4f60\u7684\u6838\u5fc3\u9700\u6c42\u662f&#034;\u603b\u7ed3\u6574\u5e93&#034;&#034;\u68b3\u7406\u5168\u5c40\u8109\u7edc&#034;&#xff0c;GraphRAG \u662f\u9996\u9009\u3002<\/li>\n<\/ul>\n<h4 id=\"\u6848\u4f8b-2\u67d0\u5934\u90e8\u7535\u5546\u4f9b\u5e94\u94fe\u77e5\u8bc6\u5e932025-\u5178\u578b\u5b9e\u8df5\">\u6848\u4f8b 2&#xff1a;\u67d0\u5934\u90e8\u7535\u5546\u4f9b\u5e94\u94fe\u77e5\u8bc6\u5e93&#xff08;2025 \u5178\u578b\u5b9e\u8df5&#xff09;<\/h4>\n<ul>\n<li>\u9700\u6c42&#xff1a;\u5ba2\u670d\u4e0e\u8fd0\u8425\u8981\u67e5\u8be2\u6570\u767e\u4e07 SKU \u7684\u590d\u6742\u5c5e\u6027\u53ca\u5173\u8054\u5173\u7cfb&#xff0c;\u5982&#034;\u9002\u5408\u654f\u611f\u808c\u4e14\u4e0d\u542b\u5c3c\u6cca\u91d1\u916f\u7684\u9632\u6652&#034;&#xff1b;<\/li>\n<li>\u67b6\u6784&#xff1a;\n<ul>\n<li>\u77e5\u8bc6\u56fe\u8c31&#xff08;NebulaGraph&#xff09;&#xff1a;\u5b58\u50a8&#034;\u5546\u54c1 &#8211; \u5c5e\u6027 &#8211; \u54c1\u724c &#8211; \u4f9b\u5e94\u5546&#034;\u5173\u7cfb&#xff0c;\u652f\u6491\u9ad8\u5e76\u53d1\u56fe\u67e5\u8be2&#xff1b;<\/li>\n<li>RAG&#xff08;\u5411\u91cf\u5e93&#xff09;&#xff1a;\u5b58\u50a8\u5546\u54c1\u8be6\u60c5\u9875\u7684\u957f\u6587\u672c\u63cf\u8ff0&#xff1b;<\/li>\n<li>ToG&#xff08;Think-on-Graph&#xff09;&#xff1a;\u7528\u6237\u63d0\u95ee\u540e&#xff0c;\u6a21\u578b\u5148\u5728\u56fe\u8c31\u4e2d\u8fc7\u6ee4\u51fa&#034;\u654f\u611f\u808c\u9002\u7528&#034;\u548c&#034;\u4e0d\u542b\u5c3c\u6cca\u91d1\u916f&#034;\u7684\u5b9e\u4f53\u5b50\u96c6&#xff0c;\u518d\u68c0\u7d22\u5177\u4f53\u4ea7\u54c1\u8be6\u60c5&#xff1b;<\/li>\n<\/ul>\n<\/li>\n<li>\u6548\u679c&#xff1a;\u628a&#034;\u591a\u6761\u4ef6\u5c5e\u6027\u7ec4\u5408\u7b5b\u9009&#034;\u8fd9\u7c7b\u4f20\u7edf RAG \u96be\u4ee5\u5904\u7406\u7684\u95ee\u9898&#xff0c;\u53d8\u6210\u53ef\u7cbe\u786e\u6c42\u89e3\u7684\u56fe\u67e5\u8be2&#xff1b;<\/li>\n<li>\u542f\u793a&#xff1a;\u5f3a\u7ed3\u6784\u5316\u3001\u591a\u6761\u4ef6\u7ec4\u5408\u7684\u4e1a\u52a1&#xff08;\u7535\u5546\u3001\u533b\u7597\u3001\u4f9b\u5e94\u94fe&#xff09;&#xff0c;\u56fe &#043; \u5411\u91cf\u7684\u6df7\u5408\u67b6\u6784\u51e0\u4e4e\u662f\u5fc5\u9009\u9879\u3002<\/li>\n<\/ul>\n<h4 id=\"\u6848\u4f8b-3\u6cd5\u5f8b\u5408\u540c\u5ba1\u67e5\u52a9\u624b2024-2025\">\u6848\u4f8b 3&#xff1a;\u6cd5\u5f8b\u5408\u540c\u5ba1\u67e5\u52a9\u624b&#xff08;2024-2025&#xff09;<\/h4>\n<ul>\n<li>\u6280\u672f\u6808&#xff1a;LangChain &#043; Neo4j &#043; Claude 3.5&#xff1b;<\/li>\n<li>\u6d41\u7a0b&#xff1a;\n<li>\u4e0a\u4f20\u5408\u540c PDF&#xff0c;\u89e3\u6790\u3001\u5207\u7247&#xff1b;<\/li>\n<li>LLM \u62bd\u53d6\u5173\u952e\u5b9e\u4f53\u4e0e\u6761\u6b3e&#xff1a;\u7532\u65b9\u3001\u4e59\u65b9\u3001\u91d1\u989d\u3001\u8fdd\u7ea6\u8d23\u4efb\u3001\u751f\u6548\u65e5\u671f&#xff0c;\u6784\u5efa\u5408\u540c\u5b50\u56fe&#xff1b;<\/li>\n<li>\u7528\u6237\u63d0\u95ee&#xff1a;&#034;\u5982\u679c\u7532\u65b9\u8fdd\u7ea6&#xff0c;\u4e59\u65b9\u6709\u54ea\u4e9b\u6551\u6d4e\u9014\u5f84&#xff1f;&#034;<\/li>\n<li>\u7cfb\u7edf\u6cbf\u56fe\u8c31\u627e\u5230&#034;\u8fdd\u7ea6\u8d23\u4efb&#034;\u8282\u70b9&#xff0c;\u5173\u8054\u5bf9\u5e94\u6761\u6b3e\u539f\u6587&#xff0c;\u5582\u7ed9 LLM \u751f\u6210\u5e26\u5f15\u7528\u7b54\u6848&#xff1b;<\/li>\n<\/li>\n<li>\u6548\u679c&#xff1a;\u4ece&#034;\u5168\u6587\u627e\u6761\u6b3e&#034;\u53d8\u4e3a&#034;\u56fe\u8c31\u5b9a\u4f4d &#043; \u6761\u6b3e\u76f4\u5f15&#034;&#xff0c;\u54cd\u5e94\u901f\u5ea6\u548c\u51c6\u786e\u6027\u90fd\u5927\u5e45\u63d0\u5347&#xff1b;<\/li>\n<li>\u542f\u793a&#xff1a;\u4e13\u4e1a\u6587\u6863&#xff08;\u5408\u540c\u3001\u6cd5\u5f8b\u3001\u75c5\u5386&#xff09;\u6700\u9002\u5408&#034;\u62bd\u53d6\u7ed3\u6784\u5316\u5b50\u56fe &#043; \u539f\u6587\u6eaf\u6e90&#034;\u7684\u7ec4\u5408\u2014\u2014\u56fe\u8c31\u8d1f\u8d23\u5b9a\u4f4d&#xff0c;\u5411\u91cf\u5e93\u8d1f\u8d23\u4f9b\u539f\u6587\u3002<\/li>\n<\/ul>\n<p>\u6848\u4f8b\u5171\u6027\u603b\u7ed3&#xff1a;<\/p>\n<p> \u6838\u5fc3\u9700\u6c42\u662f&#034;\u76f8\u4f3c\u6587\u672c\u53ec\u56de&#034;      -&gt; \u7eaf RAG&#xff08;\u5411\u91cf\u5e93&#xff09;\u5c31\u591f<br \/>\n\u6838\u5fc3\u9700\u6c42\u662f&#034;\u5173\u7cfb\u63a8\u7406\/\u5168\u5c40\u603b\u7ed3&#034;  -&gt; \u5f15\u5165\u77e5\u8bc6\u56fe\u8c31&#xff08;GraphRAG \/ Vector&#043;Graph&#xff09;<br \/>\n\u6570\u636e\u5f3a\u7ed3\u6784\u5316\u3001\u5c5e\u6027\u7ec4\u5408\u7b5b\u9009     -&gt; \u56fe\u6570\u636e\u5e93\u505a\u4e3b\u529b&#xff0c;\u5411\u91cf\u5e93\u505a\u8865\u5145<\/p>\n<hr \/>\n<h3 id=\"7-\u5e38\u89c1\u95ee\u9898\u901f\u67e5\u8868faq\">7. \u5e38\u89c1\u95ee\u9898\u901f\u67e5\u8868&#xff08;FAQ&#xff09;<\/h3>\n<table>\n<tbody>\n<tr>\u95ee\u9898\u901f\u7b54<\/tr>\n<tr>\n<td>1<\/td>\n<td>\u4ec0\u4e48\u65f6\u5019\u53ea\u9700\u8981 RAG&#xff0c;\u4e0d\u9700\u8981\u77e5\u8bc6\u56fe\u8c31&#xff1f;<\/td>\n<td>\u9700\u6c42\u662f&#034;\u627e\u76f8\u4f3c\u6587\u6863\/\u56de\u7b54\u7247\u6bb5\u7ea7\u95ee\u9898&#034;\u65f6&#xff0c;\u7eaf RAG \u8db3\u591f&#xff1b;\u51fa\u73b0&#034;\u591a\u8df3\u63a8\u7406\u3001\u5168\u5c40\u603b\u7ed3\u3001\u5c5e\u6027\u7ec4\u5408\u7b5b\u9009&#034;\u9700\u6c42\u518d\u52a0\u56fe\u8c31<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>\u5207\u7247\u591a\u5927\u5408\u9002&#xff1f;<\/td>\n<td>\u7ecf\u9a8c\u503c 5121024 token&#xff0c;overlap 50100&#xff1b;\u4ee5&#034;\u8bed\u4e49\u5b8c\u6574&#034;\u4e3a\u5148&#xff0c;\u8868\u683c\/\u4ee3\u7801\/JSON \u6574\u5757\u4fdd\u7559<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>Embedding \u6a21\u578b\u600e\u4e48\u9009&#xff1f;<\/td>\n<td>\u4e2d\u6587\u9996\u9009 BGE-M3&#xff08;\u591a\u8bed\u8a00\u591a\u7c92\u5ea6&#xff09;&#xff1b;\u82f1\u6587\u957f\u6587\u6863 jina-v2&#xff1b;\u4ee3\u7801 voyage-code-2&#xff1b;\u67e5\u8be2\u4e0e\u6587\u6863\u5fc5\u987b\u540c\u4e00\u6a21\u578b<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>\u5411\u91cf\u6570\u636e\u5e93\u9009\u54ea\u4e2a&#xff1f;<\/td>\n<td>\u539f\u578b\u7528 Chroma\/FAISS&#xff1b;\u751f\u4ea7\u6d77\u91cf\u9ad8\u5e76\u53d1\u7528 Milvus&#xff1b;\u4e0d\u60f3\u8fd0\u7ef4\u7528 Pinecone<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>\u91cd\u6392\u5e8f\u771f\u7684\u6709\u7528\u5417&#xff1f;<\/td>\n<td>\u662f\u3002\u63d0\u5347 RAG \u51c6\u786e\u7387\u6027\u4ef7\u6bd4\u6700\u9ad8\u7684\u5355\u70b9\u6539\u9020&#xff0c;\u5f3a\u70c8\u5efa\u8bae\u5fc5\u505a<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>\u77e5\u8bc6\u56fe\u8c31\u6784\u5efa\u597d\u8d35&#xff0c;\u600e\u4e48\u7701\u94b1&#xff1f;<\/td>\n<td>\u53ea\u62bd&#034;\u80fd\u56de\u7b54\u95ee\u9898&#034;\u7684\u5b9e\u4f53&#xff1b;\u7528 Batch API&#xff1b;\u5bf9\u9ad8\u9891\u62bd\u53d6\u5fae\u8c03 8B \u5c0f\u6a21\u578b&#xff1b;\u589e\u91cf\u6784\u5efa\u4e0d\u91cd\u5efa<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>\u5b9e\u4f53\u6d88\u6b67\u600e\u4e48\u505a&#xff1f;<\/td>\n<td>\u7ef4\u62a4\u522b\u540d\u8868&#xff08;&#034;\u82f9\u679c\u516c\u53f8&#034;&#061;&#034;Apple Inc.&#034;&#xff09;&#xff1b;\u5efa\u552f\u4e00\u7ea6\u675f &#043; \u5148\u67e5\u540e\u5efa&#xff1b;\u5173\u7cfb\u5e26\u65f6\u95f4\u6233<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>\u600e\u4e48\u8bc4\u4f30\u6211\u7684\u77e5\u8bc6\u5e93\u597d\u4e0d\u597d&#xff1f;<\/td>\n<td>\u68c0\u7d22\u5c42\u770b Hit Rate \/ MRR&#xff1b;\u751f\u6210\u5c42\u770b Faithfulness \/ Answer Relevance&#xff1b;\u7528 Ragas\/DeepEval \u8dd1\u771f\u5b9e\u95ee\u9898\u96c6<\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td>\u5982\u4f55\u9632\u6b62\u6a21\u578b\u7f16\u7b54\u6848&#xff1f;<\/td>\n<td>\u5f3a\u5236\u5f15\u7528\u6807\u6ce8&#xff1b;&#034;\u627e\u4e0d\u5230\u5c31\u8bf4\u627e\u4e0d\u5230&#034;&#xff1b;\u4f4e\u7f6e\u4fe1\u5ea6\u62e6\u622a&#xff1b;\u56fe\u8c31\u9a8c\u8bc1&#xff1b;\u524d\u7aef\u5c55\u793a\u6765\u6e90\u9ad8\u4eae<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>\u5fae\u8f6f GraphRAG \u548c\u666e\u901a RAG \u4ec0\u4e48\u5173\u7cfb&#xff1f;<\/td>\n<td>GraphRAG \u662f RAG \u7684\u8fdb\u9636\u7248&#xff1a;\u5728\u5411\u91cf\u68c0\u7d22\u57fa\u7840\u4e0a\u589e\u52a0&#034;\u56fe\u6784\u5efa &#043; \u793e\u533a\u6458\u8981&#034;&#xff0c;\u64c5\u957f\u5168\u5c40\u6027\u95ee\u9898&#xff1b;\u6210\u672c\u66f4\u9ad8&#xff0c;\u6309\u9700\u9009\u7528<\/td>\n<\/tr>\n<tr>\n<td>11<\/td>\n<td>\u6587\u6863\u66f4\u65b0\u4e86\u600e\u4e48\u529e&#xff1f;<\/td>\n<td>\u5411\u91cf\u5e93\u6309\u6587\u6863 ID Upsert\/\u5220\u9664&#xff1b;\u56fe\u8c31\u53ea\u5bf9\u589e\u91cf\u6587\u6863\u62bd\u53d6&#xff1b;\u65b0\u65e7\u7248\u672c\u7528\u5143\u6570\u636e\u533a\u5206<\/td>\n<\/tr>\n<tr>\n<td>12<\/td>\n<td>\u4e2d\u6587\u6587\u6863\u89e3\u6790\u4e71\u7801\u600e\u4e48\u529e&#xff1f;<\/td>\n<td>\u626b\u63cf\u4ef6\u5148 OCR&#xff08;hi_res\/ocr_only&#xff09;&#xff1b;\u8868\u683c\u7528\u4e13\u7528\u89e3\u6790\u7b56\u7565&#xff1b;\u89e3\u6790\u540e\u5fc5\u987b\u62bd\u6837\u4eba\u5de5\u68c0\u67e5<\/td>\n<\/tr>\n<tr>\n<td>13<\/td>\n<td>\u77e5\u8bc6\u5e93\u68c0\u7d22\u4e0d\u5230\u7b54\u6848\u600e\u4e48\u529e&#xff1f;<\/td>\n<td>\u5148\u67e5\u6570\u636e\u662f\u5426\u5165\u5e93&#xff1b;\u518d\u67e5\u5207\u7247\u662f\u5426\u5207\u788e\u8bed\u4e49&#xff1b;\u7136\u540e\u67e5\u6df7\u5408\u68c0\u7d22\u6bd4\u4f8b&#xff1b;\u6700\u540e\u67e5 Reranker \u662f\u5426\u8fc7\u6ee4\u6389\u4e86\u6b63\u786e\u7b54\u6848<\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td>\u5411\u91cf\u7ef4\u5ea6\u600e\u4e48\u5b9a&#xff1f;<\/td>\n<td>\u7531 Embedding \u6a21\u578b\u51b3\u5b9a&#xff08;BGE-M3&#061;1024&#xff09;&#xff0c;\u6539\u6a21\u578b\u5fc5\u987b\u91cd\u5efa Collection<\/td>\n<\/tr>\n<tr>\n<td>15<\/td>\n<td>\u8981\u4e0d\u8981\u7528 GraphRAG \u7684 Global Search&#xff1f;<\/td>\n<td>\u53ea\u6709&#034;\u603b\u7ed3\u5168\u5e93\u3001\u68b3\u7406\u5168\u5c40&#034;\u7c7b\u9700\u6c42\u624d\u7528&#xff1b;\u65e5\u5e38\u95ee\u7b54\u7528 Local Search \u6216 Vector&#043;Graph \u6df7\u5408&#xff0c;\u6210\u672c\u4f4e\u5f97\u591a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3 id=\"\u7ed3\u8bed\">\u7ed3\u8bed<\/h3>\n<p>\u77e5\u8bc6\u5e93&#xff0c;\u4e0d\u518d\u662f&#034;\u5207\u7247 &#043; \u5411\u91cf\u5316&#034;\u7684\u5355\u70b9\u6280\u672f&#xff0c;\u800c\u662f\u4e00\u5957\u7ec4\u5408\u62f3&#xff1a;<\/p>\n<li>\u4e8b\u5b9e\u6027\u3001\u5173\u7cfb\u578b\u6570\u636e\u00a0\u2192 \u5f15\u5165\u77e5\u8bc6\u56fe\u8c31&#xff08;KG&#xff09;\u00a0\u4e0e\u00a0GraphRAG&#xff0c;\u8ba9\u673a\u5668&#034;\u61c2\u5173\u7cfb&#034;&#xff1b;<\/li>\n<li>\u957f\u7bc7\u6587\u6863\u3001\u6a21\u7cca\u8bed\u4e49\u00a0\u2192 \u4f9d\u8d56\u9ad8\u7ea7 RAG&#xff08;\u6df7\u5408\u68c0\u7d22 &#043; \u91cd\u6392\u5e8f &#043; \u4e0a\u4e0b\u6587\u7ec4\u88c5&#xff09;&#xff0c;\u8ba9\u673a\u5668&#034;\u67e5\u5f97\u51c6&#034;&#xff1b;<\/li>\n<li>\u5de5\u7a0b\u843d\u5730\u7684\u6838\u5fc3\u75db\u70b9&#xff0c;\u5df2\u7ecf\u4ece&#034;\u6a21\u578b\u6548\u679c&#034;\u8f6c\u79fb\u5230\u00a0\u6570\u636e\u89e3\u6790\u8d28\u91cf\u00a0\u4e0e\u00a0\u56fe\u8c31\u6784\u5efa\u7684\u81ea\u52a8\u5316\u4e0e\u51c6\u786e\u6027\u2014\u2014\u6570\u636e\u6cbb\u7406\u5360 60% \u4ee5\u4e0a\u7684\u7cbe\u529b&#xff0c;\u6c38\u8fdc\u662f\u503c\u5f97\u7684\u3002<\/li>\n<p>\u6700\u540e\u9001\u4f60\u4e00\u53e5\u53e3\u8bc0&#xff1a;<\/p>\n<p>\u5148\u95ee&#034;\u8981\u56de\u7b54\u4ec0\u4e48\u95ee\u9898&#034;&#xff0c;\u518d\u9009&#034;\u5411\u91cf\u3001\u56fe\u8c31\u8fd8\u662f\u6df7\u5408&#034;&#xff1b;\u6570\u636e\u4e0d\u597d\u4e0d\u5efa\u5e93&#xff0c;\u8bc4\u4f30\u4e0d\u8fc7\u4e0d\u4e0a\u7ebf\u3002<\/p>\n<p>\u5982\u679c\u672c\u6587\u5bf9\u4f60\u6709\u5e2e\u52a9&#xff0c;\u6b22\u8fce\u6536\u85cf\u3001\u8f6c\u53d1\u3002\u6709\u4efb\u4f55\u642d\u5efa\u8fc7\u7a0b\u4e2d\u7684\u95ee\u9898&#xff0c;\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u4ea4\u6d41\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u53e5\u8bdd\u7406\u89e3\u672c\u6587&#xff1a;\u628a\u5927\u6a21\u578b\u5f53\u6210\u4e00\u4e2a\\&#8221;\u535a\u5b66\u4f46\u5bb9\u6613\u8bb0\u9519\u8bdd\\&#8221;\u7684\u540c\u4e8b&#xff0c;\u77e5\u8bc6\u5e93\u5c31\u662f\u5e2e\u5b83\u67e5\u8d44\u6599\u3001\u7406\u5173\u7cfb\u7684\\&#8221;\u5916\u6302\u786c\u76d8  \u5173\u7cfb\u56fe\u8c31\\&#8221;\u3002\u00a0\u672c\u6587\u4ece\u96f6\u5f00\u59cb&#xff0c;\u7528\u7c7b\u6bd4  \u6b65\u9aa4  \u4ee3\u7801  \u8868\u683c&#xff0c;\u5e26\u4f60\u642d\u51fa\u4e00\u5957\u6807\u51c6\u7684\u4f01\u4e1a\u7ea7\u77e5\u8bc6\u5e93\u3002 \u76ee\u5f55<br \/>\n\u5f15\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u9700\u8981\u77e5\u8bc6\u5e93&#xff1f;1. RAG \u77e5\u8bc6\u5e93\u539f\u7406\u4e0e\u6838\u5fc3\u6280\u672f\u70b9 1.1 \u6574\u4f53\u67b6\u6784&#xff1a;Indexing \u2192 Retrieval \u2192 Generation1.2 \u6587\u6863\u89e3\u6790&amp;#xff1a<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10187,66,81,50,613],"topic":[],"class_list":["post-93259","post","type-post","status-publish","format-standard","hentry","category-server","tag-codingplan","tag-ai","tag-python","tag-50","tag-613"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u901a\u7528\u77e5\u8bc6\u5e93\u642d\u5efa\u4e0e\u77e5\u8bc6\u56fe\u8c31\u6784\u5efa\u5168\u6307\u5357\uff08RAG + GraphRAG \u5b9e\u6218\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/93259.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u901a\u7528\u77e5\u8bc6\u5e93\u642d\u5efa\u4e0e\u77e5\u8bc6\u56fe\u8c31\u6784\u5efa\u5168\u6307\u5357\uff08RAG + GraphRAG \u5b9e\u6218\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u53e5\u8bdd\u7406\u89e3\u672c\u6587&#xff1a;\u628a\u5927\u6a21\u578b\u5f53\u6210\u4e00\u4e2a&quot;\u535a\u5b66\u4f46\u5bb9\u6613\u8bb0\u9519\u8bdd&quot;\u7684\u540c\u4e8b&#xff0c;\u77e5\u8bc6\u5e93\u5c31\u662f\u5e2e\u5b83\u67e5\u8d44\u6599\u3001\u7406\u5173\u7cfb\u7684&quot;\u5916\u6302\u786c\u76d8 \u5173\u7cfb\u56fe\u8c31&quot;\u3002\u00a0\u672c\u6587\u4ece\u96f6\u5f00\u59cb&#xff0c;\u7528\u7c7b\u6bd4 \u6b65\u9aa4 \u4ee3\u7801 \u8868\u683c&#xff0c;\u5e26\u4f60\u642d\u51fa\u4e00\u5957\u6807\u51c6\u7684\u4f01\u4e1a\u7ea7\u77e5\u8bc6\u5e93\u3002 \u76ee\u5f55 \u5f15\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u9700\u8981\u77e5\u8bc6\u5e93&#xff1f;1. RAG \u77e5\u8bc6\u5e93\u539f\u7406\u4e0e\u6838\u5fc3\u6280\u672f\u70b9 1.1 \u6574\u4f53\u67b6\u6784&#xff1a;Indexing \u2192 Retrieval \u2192 Generation1.2 \u6587\u6863\u89e3\u6790&amp;#xff1a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/93259.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-12T01:41:04+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/93259.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/93259.html\",\"name\":\"\u901a\u7528\u77e5\u8bc6\u5e93\u642d\u5efa\u4e0e\u77e5\u8bc6\u56fe\u8c31\u6784\u5efa\u5168\u6307\u5357\uff08RAG + GraphRAG \u5b9e\u6218\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-12T01:41:04+00:00\",\"dateModified\":\"2026-08-12T01:41:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/93259.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/93259.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/93259.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u901a\u7528\u77e5\u8bc6\u5e93\u642d\u5efa\u4e0e\u77e5\u8bc6\u56fe\u8c31\u6784\u5efa\u5168\u6307\u5357\uff08RAG + GraphRAG \u5b9e\u6218\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u901a\u7528\u77e5\u8bc6\u5e93\u642d\u5efa\u4e0e\u77e5\u8bc6\u56fe\u8c31\u6784\u5efa\u5168\u6307\u5357\uff08RAG + GraphRAG \u5b9e\u6218\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/93259.html","og_locale":"zh_CN","og_type":"article","og_title":"\u901a\u7528\u77e5\u8bc6\u5e93\u642d\u5efa\u4e0e\u77e5\u8bc6\u56fe\u8c31\u6784\u5efa\u5168\u6307\u5357\uff08RAG + GraphRAG \u5b9e\u6218\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u53e5\u8bdd\u7406\u89e3\u672c\u6587&#xff1a;\u628a\u5927\u6a21\u578b\u5f53\u6210\u4e00\u4e2a\"\u535a\u5b66\u4f46\u5bb9\u6613\u8bb0\u9519\u8bdd\"\u7684\u540c\u4e8b&#xff0c;\u77e5\u8bc6\u5e93\u5c31\u662f\u5e2e\u5b83\u67e5\u8d44\u6599\u3001\u7406\u5173\u7cfb\u7684\"\u5916\u6302\u786c\u76d8 \u5173\u7cfb\u56fe\u8c31\"\u3002\u00a0\u672c\u6587\u4ece\u96f6\u5f00\u59cb&#xff0c;\u7528\u7c7b\u6bd4 \u6b65\u9aa4 \u4ee3\u7801 \u8868\u683c&#xff0c;\u5e26\u4f60\u642d\u51fa\u4e00\u5957\u6807\u51c6\u7684\u4f01\u4e1a\u7ea7\u77e5\u8bc6\u5e93\u3002 \u76ee\u5f55 \u5f15\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u9700\u8981\u77e5\u8bc6\u5e93&#xff1f;1. RAG \u77e5\u8bc6\u5e93\u539f\u7406\u4e0e\u6838\u5fc3\u6280\u672f\u70b9 1.1 \u6574\u4f53\u67b6\u6784&#xff1a;Indexing \u2192 Retrieval \u2192 Generation1.2 \u6587\u6863\u89e3\u6790&amp;#xff1a","og_url":"https:\/\/www.wsisp.com\/helps\/93259.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-12T01:41:04+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"12 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/93259.html","url":"https:\/\/www.wsisp.com\/helps\/93259.html","name":"\u901a\u7528\u77e5\u8bc6\u5e93\u642d\u5efa\u4e0e\u77e5\u8bc6\u56fe\u8c31\u6784\u5efa\u5168\u6307\u5357\uff08RAG + GraphRAG \u5b9e\u6218\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-12T01:41:04+00:00","dateModified":"2026-08-12T01:41:04+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/93259.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/93259.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/93259.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u901a\u7528\u77e5\u8bc6\u5e93\u642d\u5efa\u4e0e\u77e5\u8bc6\u56fe\u8c31\u6784\u5efa\u5168\u6307\u5357\uff08RAG + GraphRAG \u5b9e\u6218\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/93259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=93259"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/93259\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=93259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=93259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=93259"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=93259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}