{"id":101618,"date":"2026-09-07T03:25:06","date_gmt":"2026-09-06T19:25:06","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/101618.html"},"modified":"2026-09-07T03:25:06","modified_gmt":"2026-09-06T19:25:06","slug":"%e5%a4%a7%e5%ad%a6%e7%94%9f%e5%b0%8f%e8%82%a0%e5%ad%a6%e4%b9%a0%ef%bc%9alangchain%e5%ae%8c%e6%95%b4%e7%9f%a5%e8%af%86%e7%82%b9%ef%bc%88%e6%99%ba%e8%83%bd%e4%bd%93%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/101618.html","title":{"rendered":"\u5927\u5b66\u751f\u5c0f\u80a0\u5b66\u4e60\uff1aLangChain\u5b8c\u6574\u77e5\u8bc6\u70b9\uff08\u667a\u80fd\u4f53\uff09"},"content":{"rendered":"<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u968f\u7740\u65f6\u4ee3\u7684\u53d1\u5c55&#xff0c;\u667a\u80fd\u4f53\u5df2\u7ecf\u9010\u6e10\u8fdb\u5165\u5230\u4e86\u6211\u4eec\u7684\u89c6\u91ce&#xff0c;\u53ea\u8981\u6211\u4eec\u7d27\u8ddf\u65f6\u4ee3\u6b65\u4f10&#xff0c;\u65e0\u8bba\u672a\u6765\u600e\u6837&#xff0c;\u76f8\u4fe1\u81ea\u5df1&#xff0c;\u4f60\u90fd\u4e0d\u4f1a\u5dee\u3002\u4eca\u5929\u5b66\u4e60\u4e86\u5b8c\u6574\u7684LangChain\u662f\u4ec0\u4e48&#xff1f;\u91cc\u9762\u5305\u62ec\u4e86\u4ec0\u4e48&#xff0c;\u4ee5\u53ca\u9879\u76ee\u4e2d\u5e94\u8be5\u600e\u4e48\u5e94\u7528&#xff0c;\u8fd8\u662f&#xff0c;\u5982\u679c\u54ea\u4e9b\u5730\u65b9\u6709\u95ee\u9898&#xff0c;\u5927\u5bb6\u4e00\u5b9a\u8981\u591a\u591a\u6307\u51fa\u7ea0\u6b63\u6211\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<h4><span style=\"color:#0d0016\">\u4e00.\u5927\u6a21\u578b<\/span><\/h4>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u5927\u6a21\u578b\u5206\u4e3a&#xff1a;<span style=\"background-color:#ffd900\">\u516c\u5171\u5927\u6a21\u578b&amp;\u79c1\u6709\u5927\u6a21\u578b<\/span><\/p>\n<p>\u516c\u7528\u5927\u6a21\u578b&#xff1a;\u4f8b\u5982deepseek\u00a0 \u8c46\u5305&#xff0c;\u6210\u672c\u4f4e&#xff0c;\u4e0d\u662f\u5f88\u5b89\u5168&#xff0c;\u957f\u671f\u4f7f\u7528\u6210\u672c\u4f1a\u53d8\u9ad8\u3002\u7533\u8bf7\u4e2a\u5bc6\u94a5\u5c31\u80fd\u7528&#xff0c;\u6309\u8c03\u7528\u91cf\u8ba1\u8d39&#xff0c;\u4e0d\u7528\u81ea\u5df1\u4e70\u663e\u5361&#xff0c;\u4e0a\u624b\u6700\u5feb\u3002<\/p>\n<p>\u79c1\u6709\u5927\u6a21\u578b&#xff1a;\u81ea\u5df1\u521b\u5efa\u7684\u6a21\u578b&#xff0c;\u6bd4\u8f83\u5b89\u5168\u3002\u7528Ollama\u8fd9\u4e2a\u5de5\u5177&#xff0c;\u628a\u5927\u6a21\u578b\u4e0b\u8f7d\u5230\u81ea\u5df1\u7535\u8111\/\u670d\u52a1\u671f\u4e0a&#xff0c;\u6570\u636e\u4e0d\u6d41\u51fa\u5185\u7f51&#xff0c;\u5b89\u5168\u6027\u9ad8&#xff1b;\u4f46\u9700\u8981\u663e\u5361\u786c\u4ef6&#xff0c;\u6210\u672c\u9ad8\u3002<\/p>\n<p><span style=\"color:#be191c\">Ollama<\/span>:\u3000\u7b80\u5316\u5927\u6a21\u578b\u8bed\u8a00\u6a21\u578b&#xff08;\u672c\u5730\u90e8\u7f72&#xff09;&#043;&#xff08;\u8fd0\u884c\u8fc7\u7a0b&#xff09;\u5f00\u6e90\u8f6f\u4ef6\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"264\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260906192504-6a9dbe10714a2.png\" width=\"508\" \/><\/p>\n<p><span style=\"color:#511b78\">\u663e\u5361<\/span>\u662f\u4ec0\u4e48&#xff1a;\u5982\u679cCPU\u662f\u529e\u516c\u5ba4\u7684\u4e3b\u7ba1&#xff0c;\u64c5\u957f\u5904\u7406\u590d\u6742\u95ee\u9898&#xff0c;\u90a3\u663e\u5361\u597d\u6bd4\u4e00\u5927\u7fa4\u6d41\u6c34\u7ebf\u5de5\u4eba&#xff0c;\u64c5\u957f\u540c\u65f6\u5e72\u5927\u91cf\u91cd\u590d\u7b80\u5355\u7684\u5de5\u4f5c\u3002\u6700\u57fa\u7840\u7684\u662f\u753b\u9762\u8f93\u51fa&#xff0c;\u6211\u89c9\u5f97\u6211\u7684\u7535\u8111\u7684\u663e\u5361\u5e94\u8be5\u5f88\u4e00\u822c&#xff0c;\u56e0\u4e3a\u4e0d\u7ba1\u662f\u4e4b\u524d\u73a9\u6e38\u620f\u8fd8\u662f\u5236\u4f5c3D\u5efa\u6a21\u65f6\u611f\u89c9\u753b\u8d28\u90fd\u5f88\u4e00\u822c&#xff0c;AI\u8fd0\u7b97&#xff0c;\u6bd4\u5982\u5927\u6a21\u578b&#xff0c;\u672c\u5730AI\u7ed8\u56fe&#xff0c;RAG\u5411\u91cf\u8ba1\u7b97&#xff0c;\u9700\u8981\u6d77\u91cf\u6570\u636e\u8ba1\u7b97&#xff0c;\u9760\u7684\u662f\u663e\u5361\u8dd1\u3002<\/p>\n<p><span style=\"color:#0d0016\">openAI<\/span>\u662f\u4ec0\u4e48&#xff1a;\u662f\u4e00\u4e2a\u5927\u6a21\u578b&#xff0c;\u5236\u5b9aAPI\u89c4\u8303\u6210\u4e3a\u5927\u6a21\u578bAPI\u9ed8\u8ba4\u89c4\u8303&#xff0c;\u51e0\u4e4e\u5927\u6a21\u578b\u90fd\u517c\u5bb9openAI\u89c4\u8303\u3002<\/p>\n<p>\u5927\u6a21\u578b&#xff21;&#xff30;&#xff29;&#xff1a;\u8bbf\u95ee\u6a21\u578b\u5bf9\u5916\u66b4\u9732\u7684API\u63a5\u53e3&#xff0c;\u5b9e\u73b0\u4e0e\u5927\u6a21\u578b\u7684\u4ea4\u4e92\u3002<\/p>\n<\/p>\n<h4><span style=\"color:#0d0016\">\u4e8c.LangChain \u548cAgent\u5230\u5e95\u662f\u4ec0\u4e48\u5462&#xff1f;<\/span><\/h4>\n<p>LangChain:\u6211\u7684\u7406\u89e3\u5c31\u662f\u4e00\u4e2a\u5f00\u53d1\u667a\u80fd\u4f53\u7684\u5e73\u53f0&#xff08;python&#xff0c;TypeScript&#xff09;\u4f60\u662f\u5355\u4e00\u7684\u5e93&#xff0c;\u662f\u4e00\u6574\u5957\u3010\u667a\u80fd\u4f53\u5f00\u53d1\u5de5\u5177\u5168\u5bb6\u6876\u3011\u5176\u4e2d\u5206\u4e3a\u56db\u4e2a\u91cd\u8981\u90e8\u5206&#xff1a;<\/p>\n<p>LangChain&#xff1a;\u5feb\u901f\u642d\u5efa\u7b80\u5355\u667a\u80fd\u4f53\u539f\u578b<\/p>\n<p>LangGraph&#xff1a;\u7f16\u6392\u590d\u6742\u6d41\u7a0b&#xff0c;\u9002\u5408\u6709\u5206\u652f\u3001\u5faa\u73af\u3001\u72b6\u6001\u4fdd\u5b58\u7684\u4efb\u52a1<\/p>\n<p>Deep Agents&#xff1a;\u5904\u7406\u8d85\u957f\u3001\u591a\u6b65\u9aa4\u7684\u9ad8\u590d\u6742\u5ea6\u4efb\u52a1<\/p>\n<p>LangSmith&#xff1a;\u8c03\u8bd5\u3001\u6d4b\u8bd5\u3001\u8bc4\u4f30\u3001\u90e8\u7f72\u667a\u80fd\u4f53\u7684\u5e73\u53f0<\/p>\n<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"401\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260906192504-6a9dbe1089f0e.png\" width=\"905\" \/><\/p>\n<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Agent&#xff1a;\u667a\u80fd\u4f53&#xff0c;<span style=\"color:#0d0016\"><span style=\"background-color:#faa572\"> agent &#061; \u5927\u6a21\u578b&#043;\u5de5\u5177 &#043;\u8bb0\u5fc6<\/span><\/span>\u3002\u666e\u901a\u5927\u6a21\u578b\u53ea\u4f1a\u804a\u5929&#xff0c;Agent\u80fd\u81ea\u5df1\u5224\u65ad\u201c\u8981\u4e0d\u8981\u6267\u884c&#xff1f;\u201d\u81ea\u4e3b\u52a8\u8111\u5b50\u6765\u56de\u7b54\u4f60&#xff0c;\u5982\u679c\u9047\u5230\u590d\u6742\u60c5\u51b5\u8fd8\u4f1a\u8c03\u7528\u5de5\u5177&#xff0c;\u6700\u540e\u6574\u5408\u7b54\u6848\u7ed9\u4f60\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0pip install -U langchain<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0pip install -U langchain-openai<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0pip install -U langchain-deepseek<\/p>\n<\/p>\n<h4><span style=\"color:#0d0016\">\u4e09. \u6a21\u578b\u521d\u59cb\u5316\u4e0e\u8c03\u7528<\/span><\/h4>\n<p>model\u7684\u521d\u59cb\u5316&#xff1a;<span style=\"background-color:#f9eda6\">init_chat_model<\/span> \u6839\u636e\u6a21\u578b\u7684\u540d\u79f0\u81ea\u52a8\u8bc6\u522b\u5382\u5546&#xff0c;\u81ea\u52a8\u8bfb\u53d6\u73af\u5883\u53d8\u91cf&#xff0c;\u4e00\u952e\u521b\u5efa\u5bf9\u8c61\u3002\u6362\u6a21\u578b\u53ea\u6362\u6a21\u578b\u540d\u5b57\u5373\u53ef\u3002\u8bb0\u5f97\u5728\u73af\u5883\u53d8\u91cf\u4e2d\u90e8\u7f72\u5927\u6a21\u578b\u7684&#xff21;&#xff30;&#xff29;\u54e6\u3002<\/p>\n<p>\u6a21\u578b\u53c2\u6570&#xff1a;<\/p>\n<p>1.temperature:\u63a7\u5236\u751f\u6210\u6587\u672c\u968f\u673a\u6027&#xff0c;\u503c\u8d8a\u5c0f\u8d8a\u51c6&#xff0c;\u8d8a\u5927\u8d8a\u53d1\u6563\u3002<\/p>\n<p>2.max_tokens&#xff1a;\u751f\u6210\u6587\u672c\u957f\u5ea6<\/p>\n<p>3.top_p:\u63a7\u5236\u751f\u6210\u6587\u672c\u591a\u6837\u6027&#xff0c;\u503c\u8d8a\u5c0f\u8d8a\u7a33\u5b9a\u3002<\/p>\n<p>4.timeout&#xff1a;\u63a5\u53e3\u8bf7\u6c42\u8d85\u65f6\u65f6\u95f4<\/p>\n<p>5.max_retries:\u8bf7\u6c42\u5931\u8d25\u91cd\u8bd5\u6b21\u6570&#xff08;1~5&#xff09;<\/p>\n<\/p>\n<p>\u8c03\u7528\u6a21\u578b\u7684\u5f62\u5f0f&#xff1a;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 invoke\u963b\u585e\u5f0f&#xff1a;\u53d1\u5b8c\u8bf7\u6c42\u9700\u8981\u7b49\u5f85&#xff0c;\u6a21\u578b\u5168\u90e8\u751f\u6210\u5b8c\u5185\u5bb9\u4e00\u6b65\u8fd4\u56de&#xff0c;\u9002\u5408\u540e\u53f0\u5904\u7406\u6570\u636e\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 stream\u6d41\u5f0f\u8bbf\u95ee&#xff1a;\u6a21\u578b\u751f\u6210\u4e00\u4e2a\u5b57\u5c31\u8fd4\u56de\u4e00\u4e2a\u5b57&#xff0c;\u9002\u5408\u804a\u5929\u754c\u9762&#xff0c;\u7528\u6237\u611f\u4f53\u9a8c\u5f88\u597d\u3002<\/p>\n<p>\u5728Agent\u4e2d\u4f7f\u7528\u6a21\u578b&#xff1a;\u5f15\u7528create_agent \u5b8c\u6574\u4efb\u52a1\u6d41\u7a0b&#xff0c;\u6709\u8bb0\u5fc6&#xff0c;\u8fd4\u56de\u5b8c\u6574\u8fd0\u884c\u5feb\u7167\u3002<\/p>\n<\/p>\n<p><span style=\"color:#0d0016\">\u90a3\u6a21\u578b invoke \u8c03\u7528\u548c\u667a\u80fd\u4f53 invoke \u8c03\u7528\u6709\u4ec0\u4e48\u533a\u522b\u5462&#xff1f;<\/span><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6a21\u578b.invoke () \u662f\u76f4\u63a5\u8c03\u7528\u300c\u5927\u6a21\u578b\u672c\u8eab\u300d&#xff0c;\u5b83\u53ea\u8d1f\u8d23 \u201c\u751f\u6210\u6587\u672c\u201d&#xff1b;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u667a\u80fd\u4f53.invoke () \u662f\u8c03\u7528\u300c\u4e00\u6574\u5957\u667a\u80fd\u7cfb\u7edf\u300d&#xff0c;\u5b83\u4f1a\u81ea\u5df1\u89c4\u5212\u3001\u8c03\u7528\u5de5\u5177\u3001\u67e5\u8d44\u6599&#xff0c;\u6700\u7ec8\u7ed9\u4f60\u5b8c\u6210\u4efb\u52a1\u3002<\/p>\n<table>\n<tr>\u8c03\u7528\u65b9\u5f0f\u9002\u5408\u573a\u666f\u5178\u578b\u4f8b\u5b50<\/tr>\n<tbody>\n<tr>\n<td>\u6a21\u578b.invoke ()<\/td>\n<td>\u7b80\u5355\u3001\u5355\u6b65\u3001\u7eaf\u6587\u672c\u5904\u7406&#xff0c;\u4e0d\u9700\u8981\u5916\u90e8\u4fe1\u606f<\/td>\n<td>\u7ffb\u8bd1\u3001\u6da6\u8272\u3001\u6587\u672c\u5206\u7c7b\u3001\u7b80\u5355\u6587\u6848\u751f\u6210<\/td>\n<\/tr>\n<tr>\n<td>\u667a\u80fd\u4f53.invoke ()<\/td>\n<td>\u590d\u6742\u3001\u591a\u6b65\u9aa4\u3001\u9700\u8981\u5916\u90e8\u4fe1\u606f \/ \u5de5\u5177\u7684\u4efb\u52a1<\/td>\n<td>\u5ba2\u670d\u95ee\u7b54\u3001\u6570\u636e\u5206\u6790\u3001\u4fe1\u606f\u68c0\u7d22\u3001\u4efb\u52a1\u89c4\u5212\u3001\u5de5\u5177\u8c03\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4><span style=\"color:#0d0016\">\u56db.\u548c\u6a21\u578b\u6c9f\u901a\u7684\u4e09\u4ef6\u5957&#xff1a;\u6d88\u606f&#xff0c;\u63d0\u793a\u8bcd&#xff0c;\u8f93\u51fa\u89e3\u6790<\/span><\/h4>\n<p><span style=\"color:#0d0016\">\u6d88\u606f&#xff08;Message&#xff09;<\/span>:\u672c\u8d28\u5c31\u662f\u7ed9\u5927\u6a21\u578b\u53d1\u6d88\u606f&#xff0c;\u5927\u6a21\u578b\u8fd4\u56de\u6d88\u606f&#xff0c;\u5e76\u4e0d\u662f\u7eaf\u6587\u672c&#xff0c;\u662f\u9700\u8981\u5206\u89d2\u8272\u7684&#xff1a;\u7cfb\u7edf\u63d0\u793a&#xff0c;\u7528\u6237\u8f93\u5165&#xff0c;AI\u56de\u590d\u3002LangChain\u90fd\u5c01\u88c5\u6210\u4e86\u5bf9\u8c61&#xff0c;\u4e0d\u7528\u81ea\u5df1\u5199\u5b57\u5178\u3002\u8fd8\u652f\u6301\u53d1\u9001\u7167\u7247&#xff08;\u672c\u5730\u56fe\u7247\u88c5\u6210base64&#xff09;<\/p>\n<p>base64&#xff1a;\u901a\u7528\u7f16\u7801\u4ece\u4e8c\u8fdb\u5236\u6362\u6210\u7eaf\u6587\u672c<\/p>\n<p><span style=\"color:#0d0016\">\u63d0\u793a\u8bcd&#xff08;prompt&#xff09;<\/span>&#xff1a;\u53d1\u9001\u7ed9\u6a21\u578b\u7684\u6307\u4ee4\u3002\u60f3\u8981\u6709\u7a33\u5b9a\u7684\u8f93\u51fa&#xff0c;\u4e00\u5b9a\u8981\u4f1a\u5199\u63d0\u793a\u8bcd<\/p>\n<p><span style=\"background-color:null\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"background-color:#98c091\">\u63d0\u793a\u8bcd\u6a21\u677f &#061; \u8eab\u4efd &#043; \u6307\u4ee4 &#043; \u6837\u4f8b &#043;\u4e0a\u4e0b\u6587\u3000<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u8f93\u51fa\u89e3\u6790\u5668&#xff08;OutputParser&#xff09;<\/span>&#xff1a;\u6a21\u578b\u9ed8\u8ba4\u8fd4\u56de\u81ea\u7136\u8bed\u8a00&#xff0c;\u7a0b\u5e8f\u4e0d\u597d\u5904\u7406\u3002\u89e3\u6790\u5668\u5c31\u662f\u628a\u8f93\u51fa\u8f6c\u6210\u7a0b\u5e8f\u80fd\u7528\u7684\u683c\u5f0f&#xff1a;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u7eaf\u6587\u672c\u89e3\u6790\u5668&#xff1a;\u53ea\u63d0\u53d6\u6587\u5b57&#xff0c;\u53bb\u6389\u591a\u4f59\u5305\u88c5<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0JSON \u89e3\u6790\u5668&#xff1a;\u81ea\u52a8\u8f6c\u6210 Python \u5b57\u5178<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Pydantic \u89e3\u6790\u5668&#xff1a;\u4f01\u4e1a\u6700\u5e38\u7528&#xff0c;\u5f3a\u7c7b\u578b\u6821\u9a8c&#xff0c;\u5b57\u6bb5\u9519\u4e86\u76f4\u63a5\u62a5\u9519&#xff0c;\u9002\u5408\u590d\u6742\u4e1a\u52a1\u573a\u666f\u3002<\/p>\n<\/p>\n<h4><span style=\"color:#0d0016\">\u4e94&#xff0e;\u5de5\u5177<\/span><\/h4>\n<p>\u5de5\u5177\u5c31\u662f\u7ed9\u667a\u80fd\u4f53\u88c5\u4e0a\u4e86\u624b\u811a&#xff0c;\u5982\u679c\u6a21\u578b\u662f\u5927\u8111\u7684\u8bdd&#xff0c;\u90a3\u4e48\u5de5\u5177\u4e00\u5b9a\u662f\u8eaf\u5e72\u54c8\u54c8\u54c8\u3002<\/p>\n<p>\u5de5\u5177\u5206\u4e3a\u81ea\u5b9a\u4e49\u5de5\u5177\u548c\u7b2c\u4e09\u65b9\u5de5\u5177&#xff1a;<\/p>\n<p>\u81ea\u5b9a\u4e49\u5de5\u5177&#xff1a;\u5199\u4e2a\u666e\u901a\u7684\u53c2\u6570\u3000&#xff0b; &#064;Tool \u88c5\u9970\u5668\u5c31\u884c\u3002\u6a21\u578b\u4f1a\u81ea\u5df1\u5224\u65ad\u4ec0\u4e48\u65f6\u5019\u8c03\u7528\u4ec0\u4e48\u3002\u6ce8\u610f&#xff1a;config\u548cruntime\u662f\u4fdd\u7559\u53c2\u6570\u540d&#xff0c;\u4e0d\u80fd\u81ea\u5df1\u5b9a\u4e49\u3002<\/p>\n<p>\u7b2c\u4e09\u65b9\u5de5\u5177&#xff1a;LangChain\u5185\u7f6e\u4e86\u4e00\u5927\u5806\u73b0\u6210\u7684\u5de5\u5177&#xff0c;\u6bd4\u5982\u8bf4Tavily\u7f51\u9875\u641c\u7d22&#xff0c;Agent\u9047\u5230\u4e0d\u77e5\u9053\u7684\u4e8b\u4f1a\u81ea\u5df1\u5168\u7f51\u641c\u7d22&#xff0c;\u4e0d\u7528\u4f60\u5199\u722c\u866b\u3002<\/p>\n<\/p>\n<h4><span style=\"color:#0d0016\">\u516d.\u3000\u8bb0\u5fc6<\/span><\/h4>\n<p>\u8bb0\u5fc6\u5206\u4e3a\u77ed\u671f\u8bb0\u5fc6\u548c\u957f\u671f\u8bb0\u5fc6&#xff1a; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u77ed\u671f\u8bb0\u5fc6&#xff1a;\u5f53\u524d\u4f1a\u8bdd\u8bb0\u4f4f\u00a0 \u4e00\u822c\u5b58\u5728\u5185\u5b58 redis\u4e2d&#xff0c;\u7a0b\u5e8f\u5173\u4e86\u5c31\u6ca1\u4e86&#xff0c;\u9002\u5408\u5f00\u53d1\u6d4b\u8bd5\u3002\u7528<span style=\"color:#0d0016\"><span style=\"background-color:#fbd4d0\">InMemorySaver<\/span><\/span>\u5b9e\u73b0&#xff0c;\u9760<span style=\"color:#0d0016\"><span style=\"background-color:#fbd4d0\">thread_id<\/span><\/span>\u533a\u5206\u4e0d\u540c\u4eba\u7684\u5bf9\u8bdd\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u957f\u671f\u8bb0\u5fc6&#xff1a;\u5b58\u5728\u6570\u636e\u5e93\u91cc&#xff08;\u6bd4\u5982 SQLite&#xff09;&#xff0c;\u7a0b\u5e8f\u91cd\u542f\u4e5f\u8fd8\u5728&#xff0c;\u9002\u5408\u6b63\u5f0f\u4ea7\u54c1\u3002\u540c\u4e00\u4e2a<span style=\"background-color:#fbd4d0\">thread_id<\/span>\u4e0b\u6b21\u6253\u5f00\u8fd8\u80fd\u63a5\u7740\u804a\u3002<\/p>\n<\/p>\n<p>\u90a3\u4e48\u6700\u91cd\u8981\u7684\u662f\u4ec0\u4e48&#xff1f;\u5c31\u662f\u4e0d\u8ba9\u667a\u80fd\u4f53\u80e1\u8bf4\u516b\u9053\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898&#xff1a;<span style=\"color:#0d0016\">RAG<\/span><\/p>\n<\/p>\n<h4><span style=\"color:#0d0016\">\u4e03. RAG\u662f\u4ec0\u4e48&#xff1f;<\/span><\/h4>\n<p>\u5927\u6a21\u578b\u6709\u4e24\u4e2a\u6838\u5fc3\u75db\u70b9&#xff1a;<span style=\"color:#0d0016\">\u5e7b\u89c9&#043; \u77e5\u8bc6\u65f6\u6548\u6027\u4e0d\u8db3<\/span>&#xff08;\u4e5f\u5c31\u662f\u8bf4\u5047\u8bdd&#043;\u77e5\u8bc6\u8001\u65e7&#xff09;<\/p>\n<p>\u89e3\u51b3\u65b9\u6848&#xff1a;<span style=\"color:#0d0016\">\u5fae\u8c03\/ RAG<\/span><\/p>\n<p><span style=\"color:#0d0016\"><span style=\"background-color:#fff5e6\">\u5fae\u8c03&#xff1a;\u5728\u9884\u8bad\u7ec3\u5927\u6a21\u578b\u57fa\u7840\u4e0a&#xff0c;\u7528\u9886\u57df\u4e13\u5c5e\u6570\u636e\u8fdb\u4e00\u6b65\u8bad\u7ec3&#xff0c;\u8ba9\u5927\u6a21\u578b\u5185\u5316\u4e13\u4e1a\u77e5\u8bc6\u3002\u5c31\u662f\u8ba9\u77e5\u8bc6\u8bb0\u4f4f&#xff0c;\u6210\u672c\u9ad8&#xff0c;\u5468\u671f\u957f&#xff0c;\u66f4\u65b0\u9ebb\u70e6\u3002<\/span><\/span><\/p>\n<p><span style=\"color:#0d0016\"><span style=\"background-color:#edf6e8\">RAG:\u68c0\u7d22\u589e\u5f3a\u751f\u6210&#xff0c;\u751f\u6210\u524d\u5148\u4ece\u5916\u90e8\u77e5\u8bc6\u5e93&#xff08;\u6587\u6863\/\u6570\u636e\u5e93\/\u7f51\u9875&#xff09;\u68c0\u7d22\u76f8\u5173\u4e8b\u5b9e\u3002\u5c06\u68c0\u7d22\u7ed3\u679c\u4e0e\u7528\u6237\u95ee\u9898\u4e00\u540c\u8f93\u5165\u6a21\u578b\u3002\u5c31\u662f\u6a21\u578b\u5148\u53bb\u77e5\u8bc6\u5e93\u641c\u7d22\u76f8\u5173\u5185\u5bb9&#xff0c;\u518d\u6839\u636e\u641c\u5230\u7684\u5185\u5bb9\u751f\u6210\u7b54\u6848\u3002\u6210\u672c\u4f4e&#xff0c;\u66f4\u65b0\u65b9\u4fbf&#xff0c;\u8fd8\u80fd\u6eaf\u6e90\u7b54\u6848\u6765\u6e90&#xff0c;\u662f\u73b0\u5728\u7684\u4e3b\u6d41\u65b9\u6848\u3002<\/span><\/span><\/p>\n<\/p>\n<p>RAG \u5206\u4e24\u5927\u6b65&#xff1a;<\/p>\n<p>\u79bb\u7ebf\u5efa\u5e93&#xff1a;\u628a\u6587\u6863&#xff08;PDF\u3001Word\u3001TXT \u7b49&#xff09;\u8bfb\u8fdb\u6765\u2192\u5207\u6210\u5c0f\u5757\u2192\u8f6c\u6210\u5411\u91cf\u2192\u5b58\u5230\u5411\u91cf\u6570\u636e\u5e93&#xff0c;\u505a\u597d\u7d22\u5f15\u3002<\/p>\n<p>\u5728\u7ebf\u95ee\u7b54&#xff1a;\u7528\u6237\u63d0\u95ee\u2192\u628a\u95ee\u9898\u4e5f\u8f6c\u6210\u5411\u91cf\u2192\u53bb\u5411\u91cf\u5e93\u641c\u6700\u76f8\u4f3c\u7684\u51e0\u6bb5\u6587\u5b57\u2192\u628a\u95ee\u9898 &#043; \u641c\u5230\u7684\u8d44\u6599\u4e00\u8d77\u53d1\u7ed9\u5927\u6a21\u578b\u2192\u6a21\u578b\u6839\u636e\u8d44\u6599\u751f\u6210\u7b54\u6848\u3002<\/p>\n<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"653\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260906192504-6a9dbe10a957f.png\" width=\"1920\" \/><\/p>\n<\/p>\n<h4><span style=\"color:#0d0016\">\u516b.\u94fe\u5f0f\u8c03\u7528&#xff08;LCEL&#xff09;<\/span><\/h4>\n<p>\u628a\u7ec4\u4ef6\u4e32\u6210\u6d41\u6c34\u7ebf&#xff0c;\u8ba9\u6211\u611f\u89c9\u5f88\u50cfjava\u4e2d\u7684\u6d41\u3002<\/p>\n<p>\u6838\u5fc3\u903b\u8f91\u5c31\u662f\u94fe\u5f0f\u8c03\u7528\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0eg: <span style=\"background-color:#d4e9d5\">chain &#061; prompt | LLM | parser<\/span><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span style=\"background-color:#edf6e8\">\u63d0\u793a\u8bcd\u6a21\u677f|\u5927\u6a21\u578b|\u8f93\u51fa\u89e3\u6790\u5668<\/span><\/p>\n<p>\u7528\u3000|\u3000\u7b26\u53f7\u628a\u63d0\u793a\u8bcd\u6a21\u677f&#xff0c;\u5927\u6a21\u578b&#xff0c;\u8f93\u51fa\u89e3\u6790\u5668\u4e32\u8d77\u6765&#xff0c;\u50cf\u6d41\u6c34\u7ebf\u4e00\u6837\u81ea\u52a8\u4f20\u53c2\u3002<\/p>\n<p>\u53ea\u8981\u4f60\u4f20\u4f60\u6700\u5f00\u59cb\u7684\u53d8\u91cf&#xff0c;\u5b83\u4f1a\u81ea\u52a8\u4e00\u6b65\u5904\u7406&#xff0c;\u6700\u540e\u8fd4\u56de\u4f60\u60f3\u8981\u7684\u7ed3\u679c\u3002<\/p>\n<p>\u652f\u6301\u7684\u8c03\u7528\u65b9\u5f0f*3:<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u540c\u6b65\u8c03\u7528&#xff1a;invoke\u00a0<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6d41\u5f0f\u8f93\u51fa&#xff1a;stream<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6279\u91cf\u5904\u7406&#xff1a;batch<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#xff08;\u5fc5\u987b\u5b9e\u73b0\u7edf\u4e00\u89c4\u8303&#xff1a;Runnable\u63a5\u53e3&#xff09;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"230\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260906192505-6a9dbe1125f03.png\" width=\"1150\" \/><\/p>\n<\/p>\n<h4><span style=\"color:#0d0016\">\u4e5d.\u00a0RAG \u56db\u6b65\u8d70&#xff1a;\u52a0\u8f7d\u2192\u62c6\u5206\u2192\u5411\u91cf\u5316\u2192\u5b58\u5e93<\/span><\/h4>\n<p>1.<span style=\"color:#0d0016\">\u6587\u6863\u52a0\u8f7d\u5668<\/span>&#xff1a;\u8d1f\u8d23\u628a\u5404\u79cd\u683c\u5f0f\u7684\u6587\u4ef6\u8bfb\u6210 LangChain \u7edf\u4e00\u7684Document\u683c\u5f0f\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5e38\u7528\u7684&#xff1a;\u00a0 \u8bfb TXT \u7684TextLoader\u3001<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u8bfb PDF \u7684PyPDFLoader\u3001<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\u00a0\u8bfb Markdown \u7684UnstructuredMarkdownLoader<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8bfb CSV \u7684CSVLoader\u3002<\/p>\n<\/p>\n<p>2.<span style=\"color:#0d0016\">\u6587\u672c\u5206\u5272\u5668<\/span>&#xff1a;\u56e0\u4e3a\u5927\u6a21\u578b\u4e0a\u4e0b\u6587\u957f\u5ea6\u4f18\u5148&#xff0c;\u800c\u4e14\u6574\u6bb5\u6587\u6863\u68c0\u7d22\u4e0d\u51c6\u3002\u5207\u6210\u5c0f\u5757\u540e&#xff0c;\u6280\u80fd\u653e\u8fdb\u4e0a\u4e0b\u6587&#xff0c;\u53c8\u80fd\u7cbe\u51c6\u5339\u914d\u8bed\u4e49\u3002<\/p>\n<p>CharacterTextSplitter&#xff1a;\u6309\u56fa\u5b9a\u5b57\u7b26\u6570\u786c\u5207&#xff0c;\u7b80\u5355\u7c97\u66b4&#xff0c;\u5bb9\u6613\u628a\u4e00\u53e5\u8bdd\u5207\u4e24\u534a&#xff0c;\u9002\u5408\u7eaf\u6587\u672c\u65e5\u5fd7\u3002<\/p>\n<p>RecursiveCharacterTextSplitter&#xff1a;\u6700\u5e38\u7528&#xff0c;\u5206\u5c42\u5207\u5272&#xff0c;\u4f18\u5148\u6309\u6bb5\u843d\u3001\u518d\u6309\u53e5\u5b50\u3001\u518d\u6309\u8bcd&#xff0c;\u5c3d\u91cf\u4e0d\u7834\u574f\u8bed\u4e49&#xff0c;\u9002\u5408\u7edd\u5927\u591a\u6570\u6587\u6863\u3002<\/p>\n<\/p>\n<p>3.<span style=\"color:#0d0016\">\u5d4c\u5165\u6a21\u578b<\/span>&#xff1a;\u628a\u6587\u5b57\u8f6c\u6362\u6210\u4e00\u4e32\u6570\u5b57&#xff08;\u5411\u91cf&#xff09;&#xff0c;\u8bed\u4e49\u76f8\u8fd1\u7684\u6587\u5b57&#xff0c;\u5411\u91cf\u8ddd\u79bb\u5c31\u8fd1\u3002<\/p>\n<p>\u53ef\u4ee5\u7528\u963f\u91cc\u4e91\u767e\u70bc\u7684\u5728\u7ebf\u5d4c\u5165 API&#xff0c;\u65b9\u4fbf\u7a33\u5b9a\u3002<\/p>\n<p>\u4e5f\u53ef\u4ee5\u7528\u672c\u5730\u5f00\u6e90\u7684bge-m3\u6a21\u578b&#xff0c;\u7528 Ollama \u8dd1&#xff0c;\u514d\u8d39\u3001\u6570\u636e\u4e0d\u51fa\u53bb&#xff0c;\u6548\u679c\u5f88\u597d&#xff0c;\u662f\u73b0\u5728\u4e3b\u6d41\u7684\u5f00\u6e90\u9009\u62e9\u3002<\/p>\n<\/p>\n<p>4.<span style=\"color:#0d0016\">\u5411\u91cf\u6570\u636e\u5e93<\/span><\/p>\n<p>\u6587\u672c\u5411\u91cf\u5b58\u50a8&#xff1a;\u6587\u672c\u5d4c\u5165\u5411\u91cf &#061; \u5411\u91cf\u5b58\u50a8 &#043;\u8bed\u4e49\u76f8\u4f3c\u6027\u68c0\u7d22\u3000&#xff08;\u6838\u5fc3&#xff1a;\u8bed\u4e49\u76f8\u4f3c\u6027\u68c0\u7d22&#xff09;<\/p>\n<p>\u5165\u95e8\u63a8\u8350Chroma&#xff1a;\u8f7b\u91cf\u3001\u672c\u5730\u6587\u4ef6\u5b58\u50a8&#xff0c;\u4e0d\u7528\u88c5\u670d\u52a1&#xff0c;\u5f00\u7bb1\u5373\u7528\u3002<\/p>\n<p>\u751f\u4ea7\u73af\u5883\u5e38\u7528 Milvus\u3001Pinecone\u3001Redis \u5411\u91cf\u68c0\u7d22\u7b49\u3002<\/p>\n<\/p>\n<p>&#xff15;.<span style=\"color:#0d0016\">\u68c0\u7d22\u5668<\/span>&#xff1a;\u5c06\u6587\u6863\u5b58\u5165\u5411\u91cf\u6570\u636e\u5e93\u4e2d&#xff0c;\u6267\u884c\u8bed\u4e49\u68c0\u7d22&#xff0c;\u4ece\u77e5\u8bc6\u5e93\u4e2d\u5339\u914d\u4e0e\u7528\u6237\u95ee\u9898\u6700\u76f8\u5173\u7684\u6587\u672c\u7247\u6bb5\u3002\u3000\u529f\u80fd\u662f&#xff1a;\u4ece\u672c\u5730\u5411\u91cf\u5e93\u52a0\u8f7d\u5df2\u5b58\u50a8\u7684\u6587\u6863\u6570\u636e&#xff0c;\u6267\u884c\u76f8\u4f3c\u5ea6\u68c0\u7d22&#xff0c;\u652f\u6301\u8bbe\u7f6e\u8fd4\u56de\u6761\u6570\u3002\u652f\u6301\u76f8\u5173\u8bc4\u5206\u3002<\/p>\n<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"681\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260906192505-6a9dbe1145dcc.png\" width=\"1400\" \/><\/p>\n<\/p>\n<p>\u597d\u5566&#xff0c;\u7ec8\u4e8e\u6574\u7406\u5b8c\u4e86&#xff0c;\u77e5\u8bc6\u597d\u591a&#xff0c;\u5e0c\u671b\u77e5\u8bc6\u90fd\u80fd\u81ea\u52a8\u5438\u5165\u5927\u8111&#xff0c;\u597d\u4e86\u5927\u5bb6\u62dc\u62dc&#xff5e;<\/p>\n<\/p>\n<p>&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;&#xff0d;<\/p>\n<\/p>\n<\/p>\n<li>\u5927\u6a21\u578b\u5bf9\u63a5&#xff1a;\u516c\u6709 API&#xff08;\u4f4e\u6210\u672c\u5feb\u4e0a\u624b&#xff09;\/ \u672c\u5730 Ollama&#xff08;\u9ad8\u9690\u79c1\u9700\u786c\u4ef6&#xff09;&#xff0c;API \u666e\u904d\u517c\u5bb9 OpenAI \u683c\u5f0f\u3002<\/li>\n<li>LangChain \u56db\u5927\u4ef6&#xff1a;LangChain&#xff08;\u5feb\u901f\u539f\u578b&#xff09;\u3001LangGraph&#xff08;\u6d41\u7a0b\u7f16\u6392&#xff09;\u3001Deep Agents&#xff08;\u590d\u6742\u4efb\u52a1&#xff09;\u3001LangSmith&#xff08;\u8c03\u8bd5\u90e8\u7f72&#xff09;\u3002<\/li>\n<li>Agent &#061; \u5927\u6a21\u578b &#043; \u5de5\u5177 &#043; \u8bb0\u5fc6&#xff0c;\u81ea\u4e3b\u89c4\u5212\u8c03\u7528\u5de5\u5177\u5b8c\u6210\u4efb\u52a1\u3002<\/li>\n<li>\u6a21\u578b\u8c03\u7528&#xff1a;init_chat_model\u4e00\u952e\u521d\u59cb\u5316&#xff1b;invoke\u963b\u585e\u8fd4\u56de&#xff0c;stream\u6d41\u5f0f\u8f93\u51fa\u3002<\/li>\n<li>\u6d88\u606f\u56db\u89d2\u8272&#xff1a;system&#xff08;\u8eab\u4efd\u6307\u4ee4&#xff09;\u3001human&#xff08;\u7528\u6237\u8f93\u5165&#xff09;\u3001ai&#xff08;\u6a21\u578b\u56de\u590d&#xff09;\u3001tool&#xff08;\u5de5\u5177\u7ed3\u679c&#xff09;\u3002<\/li>\n<li>\u63d0\u793a\u8bcd\u56db\u8981\u7d20&#xff1a;\u8eab\u4efd\u3001\u6307\u4ee4\u3001\u6837\u4f8b\u3001\u4e0a\u4e0b\u6587&#xff1b;\u7528\u6a21\u677f\u590d\u7528&#xff0c;\u907f\u514d\u91cd\u590d\u7f16\u5199\u3002<\/li>\n<li>\u8f93\u51fa\u89e3\u6790\u5668&#xff1a;Str&#xff08;\u7eaf\u6587\u672c&#xff09;\u3001Json&#xff08;\u5b57\u5178&#xff09;\u3001Pydantic&#xff08;\u5f3a\u7c7b\u578b\u6821\u9a8c&#xff0c;\u4f01\u4e1a\u9996\u9009&#xff09;\u3002<\/li>\n<li>\u5de5\u5177\u5b9a\u4e49&#xff1a;\u51fd\u6570\u52a0&#064;tool\u88c5\u9970\u5668&#xff0c;\u53c2\u6570\u52a0\u7c7b\u578b\u6ce8\u89e3&#xff1b;\u7981\u7528config\/runtime\u53c2\u6570\u540d\u3002<\/li>\n<li>\u8bb0\u5fc6\u5206\u7c7b&#xff1a;\u77ed\u671f&#xff08;\u5185\u5b58 InMemorySaver&#xff09;\u3001\u957f\u671f&#xff08;\u6570\u636e\u5e93 SqliteSaver&#xff09;&#xff1b;\u9760thread_id\u6807\u8bc6\u4f1a\u8bdd\u3002<\/li>\n<li>RAG \u89e3\u51b3&#xff1a;\u5e7b\u89c9\u3001\u77e5\u8bc6\u8fc7\u65f6&#xff1b;\u65e0\u9700\u5fae\u8c03&#xff0c;\u5916\u6302\u77e5\u8bc6\u5e93&#xff0c;\u6210\u672c\u4f4e\u53ef\u6eaf\u6e90\u3002<\/li>\n<li>RAG \u4e24\u9636\u6bb5&#xff1a;\u79bb\u7ebf\u5efa\u5e93&#xff08;\u52a0\u8f7d\u2192\u62c6\u5206\u2192\u5411\u91cf\u5316\u2192\u5b58\u5e93&#xff09;&#xff1b;\u5728\u7ebf\u68c0\u7d22&#xff08;\u95ee\u9898\u5411\u91cf\u5316\u2192\u5339\u914d\u2192\u7ec4\u63d0\u793a\u2192\u751f\u6210&#xff09;\u3002<\/li>\n<li>LCEL \u94fe\u5f0f\u8c03\u7528&#xff1a;A | B | C\u7ba1\u9053\u5f0f\u4e32\u8054&#xff0c;\u81ea\u52a8\u4f20\u53c2&#xff1b;\u652f\u6301 invoke\/stream\/batch \u4e09\u79cd\u8c03\u7528\u3002<\/li>\n<li>\u6587\u6863\u52a0\u8f7d&#xff1a;\u7edf\u4e00\u8f6c Document \u5bf9\u8c61&#xff1b;\u5e38\u7528 Text\/PyPDF\/Markdown\/CSV \u52a0\u8f7d\u5668&#xff1b;Docling \u89e3\u6790\u5f3a\u4f46\u66f4\u91cd\u3002<\/li>\n<li>\u6587\u672c\u62c6\u5206&#xff1a;\u4f18\u5148\u7528 RecursiveCharacterTextSplitter&#xff0c;\u5206\u5c42\u8bed\u4e49\u5207\u5272&#xff0c;chunk_size&#043;chunk_overlap\u63a7\u5236\u5927\u5c0f\u548c\u91cd\u53e0\u3002<\/li>\n<li>\u5d4c\u5165\u6a21\u578b&#xff1a;\u6587\u672c\u8f6c\u5411\u91cf&#xff0c;\u7528\u4e8e\u8bed\u4e49\u5339\u914d&#xff1b;\u5728\u7ebf\u7528\u767e\u70bc&#xff0c;\u672c\u5730\u63a8\u8350 bge-m3&#xff08;Ollama \u90e8\u7f72&#xff09;\u3002<\/li>\n<li>\u5411\u91cf\u5e93&#xff1a;\u5165\u95e8\u7528 Chroma&#xff08;\u672c\u5730\u8f7b\u91cf&#xff09;&#xff1b;\u751f\u4ea7\u7528 Milvus\/Pinecone \u7b49&#xff1b;\u652f\u6301\u76f8\u4f3c\u5ea6\u68c0\u7d22 &#043; \u8bc4\u5206\u3002<\/li>\n<li>\u9879\u76ee\u843d\u5730&#xff1a;RAG \u68c0\u7d22\u5de5\u5177 &#043; Agent \u8bb0\u5fc6 &#043; \u6d41\u5f0f\u8f93\u51fa &#043; FastAPI \u63a5\u53e3 &#061; \u5b8c\u6574\u667a\u80fd\u95ee\u7b54\u7cfb\u7edf\u3002<\/li><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u968f\u7740\u65f6\u4ee3\u7684\u53d1\u5c55&#xff0c;\u667a\u80fd\u4f53\u5df2\u7ecf\u9010\u6e10\u8fdb\u5165\u5230\u4e86\u6211\u4eec\u7684\u89c6\u91ce&#xff0c;\u53ea\u8981\u6211\u4eec\u7d27\u8ddf\u65f6\u4ee3\u6b65\u4f10&#xff0c;\u65e0\u8bba\u672a\u6765\u600e\u6837&#xff0c;\u76f8\u4fe1\u81ea\u5df1&#xff0c;\u4f60\u90fd\u4e0d\u4f1a\u5dee\u3002\u4eca\u5929\u5b66\u4e60\u4e86\u5b8c\u6574\u7684LangChain\u662f\u4ec0\u4e48&#xff1f;\u91cc\u9762\u5305\u62ec\u4e86\u4ec0\u4e48&#xff0c;\u4ee5\u53ca\u9879\u76ee\u4e2d\u5e94\u8be5\u600e\u4e48\u5e94\u7528&#xff0c;\u8fd8\u662f&#xff0c;\u5982\u679c\u54ea\u4e9b\u5730\u65b9\u6709\u95ee\u9898&#xff0c;\u5927\u5bb6\u4e00\u5b9a\u8981\u591a\u591a\u6307\u51fa\u7ea0\u6b63\u6211\u3002 \u4e00.\u5927\u6a21\u578b \u5927\u6a21\u578b\u5206\u4e3a&#xff1a;\u516c\u5171\u5927\u6a21\u578b&amp;\u79c1\u6709\u5927\u6a21\u578b<br \/>\n\u516c\u7528\u5927\u6a21\u578b&#xff1a;\u4f8b\u5982d<\/p>\n","protected":false},"author":2,"featured_media":101613,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11608,997,50,371,2983],"topic":[],"class_list":["post-101618","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-chroma","tag-langchain","tag-50","tag-371","tag-2983"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5927\u5b66\u751f\u5c0f\u80a0\u5b66\u4e60\uff1aLangChain\u5b8c\u6574\u77e5\u8bc6\u70b9\uff08\u667a\u80fd\u4f53\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\/101618.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5927\u5b66\u751f\u5c0f\u80a0\u5b66\u4e60\uff1aLangChain\u5b8c\u6574\u77e5\u8bc6\u70b9\uff08\u667a\u80fd\u4f53\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u968f\u7740\u65f6\u4ee3\u7684\u53d1\u5c55&#xff0c;\u667a\u80fd\u4f53\u5df2\u7ecf\u9010\u6e10\u8fdb\u5165\u5230\u4e86\u6211\u4eec\u7684\u89c6\u91ce&#xff0c;\u53ea\u8981\u6211\u4eec\u7d27\u8ddf\u65f6\u4ee3\u6b65\u4f10&#xff0c;\u65e0\u8bba\u672a\u6765\u600e\u6837&#xff0c;\u76f8\u4fe1\u81ea\u5df1&#xff0c;\u4f60\u90fd\u4e0d\u4f1a\u5dee\u3002\u4eca\u5929\u5b66\u4e60\u4e86\u5b8c\u6574\u7684LangChain\u662f\u4ec0\u4e48&#xff1f;\u91cc\u9762\u5305\u62ec\u4e86\u4ec0\u4e48&#xff0c;\u4ee5\u53ca\u9879\u76ee\u4e2d\u5e94\u8be5\u600e\u4e48\u5e94\u7528&#xff0c;\u8fd8\u662f&#xff0c;\u5982\u679c\u54ea\u4e9b\u5730\u65b9\u6709\u95ee\u9898&#xff0c;\u5927\u5bb6\u4e00\u5b9a\u8981\u591a\u591a\u6307\u51fa\u7ea0\u6b63\u6211\u3002 \u4e00.\u5927\u6a21\u578b \u5927\u6a21\u578b\u5206\u4e3a&#xff1a;\u516c\u5171\u5927\u6a21\u578b&amp;\u79c1\u6709\u5927\u6a21\u578b \u516c\u7528\u5927\u6a21\u578b&#xff1a;\u4f8b\u5982d\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/101618.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-06T19:25:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260906192504-6a9dbe10714a2.png\" \/>\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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/101618.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/101618.html\",\"name\":\"\u5927\u5b66\u751f\u5c0f\u80a0\u5b66\u4e60\uff1aLangChain\u5b8c\u6574\u77e5\u8bc6\u70b9\uff08\u667a\u80fd\u4f53\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-06T19:25:06+00:00\",\"dateModified\":\"2026-09-06T19:25:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/101618.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/101618.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/101618.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5927\u5b66\u751f\u5c0f\u80a0\u5b66\u4e60\uff1aLangChain\u5b8c\u6574\u77e5\u8bc6\u70b9\uff08\u667a\u80fd\u4f53\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":"\u5927\u5b66\u751f\u5c0f\u80a0\u5b66\u4e60\uff1aLangChain\u5b8c\u6574\u77e5\u8bc6\u70b9\uff08\u667a\u80fd\u4f53\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\/101618.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5927\u5b66\u751f\u5c0f\u80a0\u5b66\u4e60\uff1aLangChain\u5b8c\u6574\u77e5\u8bc6\u70b9\uff08\u667a\u80fd\u4f53\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u968f\u7740\u65f6\u4ee3\u7684\u53d1\u5c55&#xff0c;\u667a\u80fd\u4f53\u5df2\u7ecf\u9010\u6e10\u8fdb\u5165\u5230\u4e86\u6211\u4eec\u7684\u89c6\u91ce&#xff0c;\u53ea\u8981\u6211\u4eec\u7d27\u8ddf\u65f6\u4ee3\u6b65\u4f10&#xff0c;\u65e0\u8bba\u672a\u6765\u600e\u6837&#xff0c;\u76f8\u4fe1\u81ea\u5df1&#xff0c;\u4f60\u90fd\u4e0d\u4f1a\u5dee\u3002\u4eca\u5929\u5b66\u4e60\u4e86\u5b8c\u6574\u7684LangChain\u662f\u4ec0\u4e48&#xff1f;\u91cc\u9762\u5305\u62ec\u4e86\u4ec0\u4e48&#xff0c;\u4ee5\u53ca\u9879\u76ee\u4e2d\u5e94\u8be5\u600e\u4e48\u5e94\u7528&#xff0c;\u8fd8\u662f&#xff0c;\u5982\u679c\u54ea\u4e9b\u5730\u65b9\u6709\u95ee\u9898&#xff0c;\u5927\u5bb6\u4e00\u5b9a\u8981\u591a\u591a\u6307\u51fa\u7ea0\u6b63\u6211\u3002 \u4e00.\u5927\u6a21\u578b \u5927\u6a21\u578b\u5206\u4e3a&#xff1a;\u516c\u5171\u5927\u6a21\u578b&amp;\u79c1\u6709\u5927\u6a21\u578b \u516c\u7528\u5927\u6a21\u578b&#xff1a;\u4f8b\u5982d","og_url":"https:\/\/www.wsisp.com\/helps\/101618.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-06T19:25:06+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260906192504-6a9dbe10714a2.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/101618.html","url":"https:\/\/www.wsisp.com\/helps\/101618.html","name":"\u5927\u5b66\u751f\u5c0f\u80a0\u5b66\u4e60\uff1aLangChain\u5b8c\u6574\u77e5\u8bc6\u70b9\uff08\u667a\u80fd\u4f53\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-06T19:25:06+00:00","dateModified":"2026-09-06T19:25:06+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/101618.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/101618.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/101618.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5927\u5b66\u751f\u5c0f\u80a0\u5b66\u4e60\uff1aLangChain\u5b8c\u6574\u77e5\u8bc6\u70b9\uff08\u667a\u80fd\u4f53\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\/101618","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=101618"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/101618\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/101613"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=101618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=101618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=101618"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=101618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}