{"id":105704,"date":"2026-09-15T21:57:03","date_gmt":"2026-09-15T13:57:03","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/105704.html"},"modified":"2026-09-15T21:57:03","modified_gmt":"2026-09-15T13:57:03","slug":"%e3%80%90langgraph%e5%ae%9e%e6%88%98%e3%80%91langgraph-%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%88%e4%b8%80%ef%bc%89%ef%bc%9a%e4%bb%8e%e9%93%be%e5%bc%8f%e5%88%b0%e5%9b%be%e5%bc%8f%ef%bc%8c%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/105704.html","title":{"rendered":"\u3010LangGraph\u5b9e\u6218\u3011LangGraph \u5b66\u4e60\u7b14\u8bb0\uff08\u4e00\uff09\uff1a\u4ece\u94fe\u5f0f\u5230\u56fe\u5f0f\uff0c\u7528\u201c\u5feb\u9012\u914d\u9001\u201c\u7406\u89e3\u5de5\u4f5c\u6d41"},"content":{"rendered":"<h2>\u00a0&#x1f44b; \u6b22\u8fce\u9605\u8bfb<\/h2>\n<p><span tabindex=\"-1\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1070\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135659-6aa94eab4d537.jpg\" width=\"1920\" \/><\/span><\/p>\n<p style=\"text-align:center\">\u00a0\u00a0&#x1f525;\u00a0<span style=\"color:#be191c\">\u613f\u65d6\u65ce<\/span><span style=\"color:#be191c\">\u00a0\u00b7<\/span> <span tabindex=\"-1\">\u4e2a\u4eba\u4e3b\u9875<\/span><\/p>\n<p style=\"text-align:center\">&#x1f4d8; <span style=\"color:#1a439c\">\u5b66\u4e60\u4e13\u680f&#xff1a;<\/span> <span tabindex=\"-1\">\u300a\u7b97\u6cd5\u4e13\u680f\u300b<\/span><span tabindex=\"-1\">\u300aLangChain\u5b66\u4e60\u300b<\/span><span tabindex=\"-1\">\u300a\u8d2a\u5fc3\u7b97\u6cd5\u300b<\/span><\/p>\n<p style=\"text-align:center\">&#x1f304; <span style=\"color:#e6b223\">\u94b1\u5858\u6c5f\u4e0a\u6f6e\u4fe1\u6765&#xff0c;\u4eca\u65e5\u65b9\u77e5\u6211\u662f\u6211<\/span><\/p>\n<p style=\"text-align:center\">\u2728<span style=\"color:#ad720d\">\u5f53\u524d\u5b66\u4e60\u5185\u5bb9&#xff1a;<\/span><span tabindex=\"-1\">LangGraph<\/span><\/p>\n<h2>&#x1f4d1; \u76ee\u5f55<\/h2>\n<ul>\n<li>\n<p>\u4e00\u3001\u524d\u7f6e\u8bb2\u89e3<\/p>\n<\/li>\n<li>\n<p>\u4e8c\u3001LangChain \u590d\u76d8\u4e0e LangGraph \u5f15\u5165<\/p>\n<\/li>\n<li>\n<p>\u4e09\u3001LangGraph \u7684\u6838\u5fc3\u6982\u5ff5<\/p>\n<\/li>\n<li>\n<p>\u56db\u3001LangGraph \u5982\u4f55\u5b9e\u73b0\u5de5\u4f5c\u6d41<\/p>\n<\/li>\n<li>\n<p>\u4e94\u3001LangGraph \u4ee3\u7801\u5b9e\u73b0<\/p>\n<\/li>\n<li>\n<p>\u516d\u3001\u590d\u76d8&#xff08;\u9644\u7b54\u6848&#xff09;<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h3>\u4e00\u3001\u524d\u7f6e\u8bb2\u89e3<\/h3>\n<p>\u5728\u8fdb\u5165\u6b63\u6587\u524d&#xff0c;\u5148\u82b1 10 \u79d2\u4e86\u89e3\u672c\u7bc7\u4f1a\u53cd\u590d\u7528\u5230\u7684\u6838\u5fc3\u6982\u5ff5&#xff0c;\u5e26\u7740\u5370\u8c61\u53bb\u8bfb\u6b63\u6587&#xff0c;\u5b66\u4e60\u6548\u7387\u66f4\u9ad8\u3002<\/p>\n<p><span style=\"color:#1c7331\">&#x1f9e0; \u524d\u7f6e\u77e5\u8bc6\u4e00&#xff1a;Agent \u4e0e Workflow<\/span><\/p>\n<p>Agent \u7531 LLM \u52a8\u6001\u51b3\u7b56\u8d70\u5411&#xff0c;Workflow \u8d70\u9884\u8bbe\u6d41\u7a0b&#xff0c;\u4e24\u8005\u662f\u4e24\u79cd\u7f16\u6392\u601d\u8def\u3002<\/p>\n<p><span style=\"color:#1c7331\">&#x1f4e6; \u524d\u7f6e\u77e5\u8bc6\u4e8c&#xff1a;State&#xff08;\u72b6\u6001&#xff09;<\/span><\/p>\n<p>\u8d2f\u7a7f\u6574\u4e2a\u6d41\u7a0b\u7684\u5171\u4eab\u6570\u636e&#xff0c;\u50cf\u5feb\u9012\u5305\u88f9\u4e0a\u7684\u6807\u7b7e&#xff0c;\u6240\u6709\u8282\u70b9\u90fd\u80fd\u8bfb\u6539\u3002<\/p>\n<p><span style=\"color:#1c7331\">&#x1f535; \u524d\u7f6e\u77e5\u8bc6\u4e09&#xff1a;Nodes&#xff08;\u8282\u70b9&#xff09;<\/span><\/p>\n<p>\u6bcf\u4e2a\u5904\u7406\u6b65\u9aa4\u5c31\u662f\u4e00\u4e2a\u51fd\u6570&#xff1a;\u63a5\u6536\u72b6\u6001\u3001\u8fd4\u56de\u72b6\u6001\u66f4\u65b0\u3002<\/p>\n<p><span style=\"color:#1c7331\">\u27a1\ufe0f \u524d\u7f6e\u77e5\u8bc6\u56db&#xff1a;Edges&#xff08;\u8fb9&#xff09;<\/span><\/p>\n<p>\u8282\u70b9\u4e4b\u95f4\u7684\u6d41\u52a8\u8def\u5f84&#xff0c;\u5206\u56fa\u5b9a\u8fb9\u4e0e\u6761\u4ef6\u8fb9\u3002<\/p>\n<p><span style=\"color:#1c7331\">&#x1f501; \u524d\u7f6e\u77e5\u8bc6\u4e94&#xff1a;Reducers&#xff08;\u72b6\u6001\u66f4\u65b0\u673a\u5236&#xff09;<\/span><\/p>\n<p>\u7528 Annotated[\u7c7b\u578b, \u5408\u5e76\u51fd\u6570] \u51b3\u5b9a\u65b0\u503c\u662f\u8986\u76d6\u8fd8\u662f\u8ffd\u52a0\/\u7d2f\u52a0\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001LangChain \u590d\u76d8\u4e0e LangGraph \u5f15\u5165<\/h3>\n<h4><span style=\"color:#1c7892\">2.1 \u590d\u76d8<\/span><\/h4>\n<p><span style=\"color:#511b78\">1. LangChain \u57fa\u7840\u4e0e RAG \u6d41\u7a0b<\/span><\/p>\n<p>LangChain \u662f AI \u5e94\u7528\u7684\u57fa\u7840\u6846\u67b6&#xff0c;\u6838\u5fc3\u7ec4\u4ef6\u5305\u62ec\u804a\u5929\u6a21\u578b\u3001\u5de5\u5177\u3001\u6587\u6863\u52a0\u8f7d\u5668\u3001\u68c0\u7d22\u5668\u7b49&#xff0c;\u91c7\u7528\u94fe\u5f0f\u7f16\u7a0b\u601d\u7ef4\u5c06\u6b65\u9aa4\u987a\u5e8f\u4e32\u8054\u3002\u5178\u578b\u7684 RAG&#xff08;\u68c0\u7d22\u589e\u5f3a\u751f\u6210&#xff09; \u6d41\u7a0b\u4e3a&#xff1a;\u6587\u6863\u5206\u5272 \u2192 \u5d4c\u5165 \u2192 \u5411\u91cf\u6570\u636e\u5e93&#xff1b;\u68c0\u7d22\u65f6\u7528\u6237\u8f93\u5165\u95ee\u9898 \u2192 \u68c0\u7d22\u6587\u6863 \u2192&#xff08;\u95ee\u9898&#043;\u68c0\u7d22\u7ed3\u679c&#xff09;\u751f\u6210\u7b54\u6848 \u2192 \u8f93\u51fa&#xff0c;\u8fd9\u662f\u6700\u57fa\u672c\u7684 AI Demo \u6a21\u5f0f\u3002<\/p>\n<p><span tabindex=\"-1\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"171\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135700-6aa94eac0d049.png\" width=\"830\" \/><span title=\"\u70b9\u51fb\u5e76\u62d6\u62fd\u4ee5\u6539\u53d8\u5c3a\u5bf8\">\u200b<\/span><\/span><\/p>\n<p><span style=\"color:#511b78\">2. LangChain \u94fe\u5f0f\u7f16\u7a0b\u7684\u5c40\u9650\u6027\u4e0e LangGraph \u7684\u89e3\u51b3<\/span><\/p>\n<p>\u94fe\u5f0f\u6d41\u7a0b\u7ebf\u6027\u4e14\u9884\u5148\u5b9a\u4e49&#xff0c;\u96be\u4ee5\u5904\u7406\u5206\u652f\u3001\u5faa\u73af\u7b49\u590d\u6742\u573a\u666f&#xff1b;\u5728\u590d\u6742 AI \u7cfb\u7edf\u4e2d&#xff0c;\u5e38\u9700\u4eba\u5de5\u4ecb\u5165\u5904\u7406\u5f02\u5e38&#xff08;\u5982\u7f3a\u5c11\u8eab\u4efd\u8bc1\u4fe1\u606f\u65f6\u9700\u4eba\u5de5\u8865\u5145&#xff09;&#xff0c;\u800c\u94fe\u5f0f\u9047\u5230\u95ee\u9898\u53ea\u80fd\u76f4\u63a5\u5931\u8d25&#xff0c;\u65e0\u6cd5\u6682\u505c\u7b49\u5f85\u5e72\u9884\u3002<\/p>\n<p>LangGraph \u91c7\u7528\u56fe\u5f0f\u7f16\u7a0b\u601d\u7ef4&#xff0c;\u5c06\u6d41\u7a0b\u5efa\u6a21\u4e3a\u56fe&#xff08;\u8282\u70b9\u548c\u8fb9&#xff09;&#xff0c;\u652f\u6301\u5206\u652f\u3001\u5faa\u73af\u3001\u5e76\u884c\u7b49\u590d\u6742\u63a7\u5236\u6d41&#xff0c;\u6838\u5fc3\u80fd\u529b\u5305\u62ec\u4eba\u5de5\u4ecb\u5165&#xff08;\u53ef\u5728\u6d41\u7a0b\u4e2d\u8bbe\u7f6e\u65ad\u70b9&#xff0c;\u6682\u505c\u5e76\u7b49\u5f85\u4eba\u5de5\u8f93\u5165\u6216\u51b3\u7b56\u540e\u7ee7\u7eed&#xff09;\u3002<\/p>\n<p><span style=\"color:#511b78\">3. \u5b66\u4e60\u8def\u5f84<\/span><\/p>\n<table>\n<tr>\u6846\u67b6\u7528\u9014<\/tr>\n<tbody>\n<tr>\n<td>LangChain<\/td>\n<td>\u638c\u63e1\u57fa\u7840\u7ec4\u4ef6\u548c\u94fe\u5f0f\u7f16\u7a0b&#xff0c;\u6784\u5efa\u7b80\u5355 Demo<\/td>\n<\/tr>\n<tr>\n<td>LangGraph<\/td>\n<td>\u6784\u5efa\u73b0\u4ee3\u5316\u590d\u6742 AI \u5e94\u7528\u7cfb\u7edf&#xff0c;\u5305\u62ec\u7f16\u7a0b\u601d\u7ef4\u63d0\u5347\u548c AI \u7cfb\u7edf\u90e8\u7f72<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7b80\u5355\u8bf4&#xff1a;LangChain \u89e3\u51b3&#034;\u600e\u4e48\u642d&#034;&#xff0c;LangGraph \u89e3\u51b3&#034;\u600e\u4e48\u642d\u5f97\u7075\u6d3b\u3001\u53ef\u9760\u4e14\u53ef\u7ef4\u62a4&#034;\u2014\u2014\u5b9e\u9645\u9879\u76ee\u4e2d\u4ece\u7b80\u5355\u94fe\u5f0f\u8d77\u6b65&#xff0c;\u590d\u6742\u573a\u666f\u5347\u7ea7\u4e3a\u56fe\u5f0f\u7f16\u6392\u3002<\/p>\n<p><span style=\"color:#511b78\">4. \u603b\u7ed3&#xff1a;LangChain \u9636\u6bb5\u6784\u5efa\u7684 AI \u7cfb\u7edf\u7279\u70b9<\/span><\/p>\n<table>\n<tr>\u7279\u70b9\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u5355\u6b21\u5bf9\u8bdd<\/td>\n<td>\u65e0\u6cd5\u957f\u671f\u8bb0\u5fc6&#xff0c;\u4e0a\u4e0b\u6587\u7a97\u53e3\u6709\u9650<\/td>\n<\/tr>\n<tr>\n<td>\u95ee\u7b54\u6a21\u5f0f\u4e3a\u4e3b<\/td>\n<td>\u4ea4\u4e92\u8f83\u4e3a\u76f4\u63a5<\/td>\n<\/tr>\n<tr>\n<td>\u9002\u7528\u7b80\u5355\u4efb\u52a1<\/td>\n<td>\u5982\u4fe1\u606f\u68c0\u7d22\u3001\u57fa\u7840\u95ee\u7b54<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4><span style=\"color:#1c7892\">2.2 Agent Server&#xff08;\u667a\u80fd\u670d\u52a1&#xff09;<\/span><\/h4>\n<p>\u60f3\u8c61\u4e00\u4e2a\u865a\u62df\u7684&#034;\u5c0f\u52a9\u624b&#034;&#xff0c;\u5b83\u4e0d\u4ec5\u80fd\u56de\u7b54\u95ee\u9898&#xff0c;\u8fd8\u80fd&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u8bb0\u4f4f\u548c\u4f60\u804a\u8fc7\u7684\u6240\u6709\u4e8b\u60c5<\/p>\n<\/li>\n<li>\n<p>\u6267\u884c\u4e00\u8fde\u4e32\u4efb\u52a1&#xff08;\u5982&#xff1a;\u67e5\u5929\u6c14 \u2192 \u63a8\u8350\u7a7f\u642d \u2192 \u63d0\u9192\u5e26\u4f1e&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u4e2d\u9014\u53ef\u4ee5\u7b49\u4f60\u7ed9\u51fa\u53cd\u9988<\/p>\n<\/li>\n<li>\n<p>\u957f\u65f6\u95f4\u8fd0\u884c\u4e0d\u4f1a&#034;\u5fd8\u8bb0&#034;<\/p>\n<\/li>\n<\/ul>\n<p><span tabindex=\"-1\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"850\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135700-6aa94eac28d73.png\" width=\"841\" \/><span title=\"\u70b9\u51fb\u5e76\u62d6\u62fd\u4ee5\u6539\u53d8\u5c3a\u5bf8\">\u200b<\/span><\/span><\/p>\n<h4><span style=\"color:#1c7892\">2.3 Agent Server \u9047\u5230\u7684\u56db\u5927\u96be\u9898<\/span><\/h4>\n<table>\n<tr>\u96be\u9898\u63cf\u8ff0\u5c31\u50cf\u2026<\/tr>\n<tbody>\n<tr>\n<td>\u72b6\u6001\u4e22\u5931<\/td>\n<td>AI \u5904\u7406\u957f\u4efb\u52a1\u65f6\u5bb9\u6613&#034;\u5fd8\u8bb0&#034;\u524d\u9762\u6b65\u9aa4<\/td>\n<td>\u5199\u957f\u6587\u7ae0\u65f6\u7535\u8111\u7a81\u7136\u5173\u673a<\/td>\n<\/tr>\n<tr>\n<td>\u96be\u4ee5\u8c03\u8bd5<\/td>\n<td>\u4e0d\u77e5\u9053 AI \u4e3a\u4ec0\u4e48\u505a\u51fa\u67d0\u4e2a\u51b3\u5b9a<\/td>\n<td>\u9ed1\u76d2\u5b50&#xff0c;\u770b\u4e0d\u5230\u5185\u90e8<\/td>\n<\/tr>\n<tr>\n<td>\u65e0\u6cd5\u5e72\u9884<\/td>\n<td>\u4e0d\u80fd\u4e2d\u9014\u7ed9 AI \u6307\u5bfc<\/td>\n<td>\u81ea\u52a8\u9a7e\u9a76\u4e0d\u80fd\u63a5\u7ba1<\/td>\n<\/tr>\n<tr>\n<td>\u90e8\u7f72\u56f0\u96be<\/td>\n<td>\u590d\u6742 Agent Server \u96be\u4ee5\u4e0a\u7ebf\u8fd0\u884c<\/td>\n<td>\u624b\u5de5\u5236\u4f5c vs \u5de5\u5382\u751f\u4ea7<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4><span style=\"color:#1c7892\">2.4 LangGraph \u7684\u5e94\u5bf9\u80fd\u529b<\/span><\/h4>\n<p><span style=\"color:#511b78\">1. \u8bb0\u5fc6\u5927\u5e08<\/span><\/p>\n<p>\u4ee3\u7801\u793a\u4f8b&#xff08;\u5bf9\u6bd4\u8bed\u4e49&#xff09;&#xff1a;<\/p>\n<p># \u4f20\u7edfAI&#xff1a;\u6bcf\u6b21\u5bf9\u8bdd\u90fd\u662f\u65b0\u7684\u5f00\u59cb<br \/>\nAI\u56de\u7b54(&#034;\u4f60\u597d&#034;) \u2192 &#034;\u4f60\u597d&#xff01;&#034;<br \/>\nAI\u56de\u7b54(&#034;\u6211\u53eb\u5c0f\u660e&#034;) \u2192 &#034;\u5f88\u9ad8\u5174\u8ba4\u8bc6\u4f60&#xff01;&#034;<br \/>\nAI\u56de\u7b54(&#034;\u6211\u53eb\u4ec0\u4e48&#xff1f;&#034;) \u2192 &#034;\u6211\u4e0d\u77e5\u9053\u4f60\u7684\u540d\u5b57&#034;<br \/>\n\u200b<br \/>\n# LangGraph Agent Server&#xff1a;\u8bb0\u4f4f\u4e00\u5207<br \/>\nAgent Server(&#034;\u4f60\u597d&#034;) \u2192 &#034;\u4f60\u597d&#xff01;&#034;<br \/>\nAgent Server(&#034;\u6211\u53eb\u5c0f\u660e&#034;) \u2192 &#034;\u4f60\u597d\u5c0f\u660e&#xff01;&#034;<br \/>\nAgent Server(&#034;\u6211\u53eb\u4ec0\u4e48&#xff1f;&#034;) \u2192 &#034;\u4f60\u53eb\u5c0f\u660e&#xff01;&#034; <\/p>\n<p><span style=\"color:#511b78\">2. \u6d41\u7a0b\u6e05\u6670<\/span><\/p>\n<p><span tabindex=\"-1\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"96\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135700-6aa94eac8c7c4.png\" width=\"840\" \/><span title=\"\u70b9\u51fb\u5e76\u62d6\u62fd\u4ee5\u6539\u53d8\u5c3a\u5bf8\">\u200b<\/span><\/span><\/p>\n<p><span style=\"color:#511b78\">3. \u5bb9\u9519\u7387\u9ad8<\/span><\/p>\n<table>\n<tr>\u80fd\u529b\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u6301\u4e45\u6267\u884c<\/td>\n<td>\u6784\u5efa\u80fd\u4ece\u6545\u969c\u4e2d\u6062\u590d\u3001\u957f\u65f6\u95f4\u8fd0\u884c\u7684 Agent Server<\/td>\n<\/tr>\n<tr>\n<td>\u4eba\u5de5\u4ecb\u5165<\/td>\n<td>\u5141\u8bb8\u5728\u6d41\u7a0b\u4e2d\u968f\u65f6\u68c0\u67e5\u548c\u4fee\u6539 Agent Server \u72b6\u6001<\/td>\n<\/tr>\n<tr>\n<td>\u5f3a\u5927\u7684\u8c03\u8bd5\u80fd\u529b<\/td>\n<td>\u4e0e LangSmith \u96c6\u6210&#xff0c;\u63d0\u4f9b\u53ef\u89c6\u5316\u8ffd\u8e2a\u548c\u6df1\u5ea6\u6d1e\u5bdf<\/td>\n<\/tr>\n<tr>\n<td>\u751f\u4ea7\u5c31\u7eea\u7684\u90e8\u7f72<\/td>\n<td>\u4e3a\u6709\u72b6\u6001\u3001\u957f\u65f6\u5de5\u4f5c\u6d41\u63d0\u4f9b\u53ef\u6269\u5c55\u7684\u90e8\u7f72\u65b9\u6848<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4e09\u3001LangGraph \u7684\u6838\u5fc3\u6982\u5ff5<\/h3>\n<h4><span style=\"color:#1c7892\">3.1 Agent&#xff08;\u667a\u80fd\u4f53&#xff09;<\/span><\/h4>\n<p>Agent&#xff08;\u667a\u80fd\u4f53&#xff09; \u662f\u4e00\u4e2a\u80fd\u591f\u611f\u77e5\u73af\u5883\u8f93\u5165\u3001\u81ea\u4e3b\u51b3\u7b56\u3001\u89c4\u5212\u884c\u52a8\u8def\u5f84&#xff0c;\u5e76\u53ef\u8c03\u7528\u5de5\u5177\u6216\u6267\u884c\u64cd\u4f5c\u4ee5\u8fbe\u6210\u76ee\u6807\u7684\u81ea\u4e3b\u6027\u8f6f\u4ef6\u5b9e\u4f53\u3002\u5176\u6838\u5fc3\u5728\u4e8e&#xff1a;\u7531\u5927\u8bed\u8a00\u6a21\u578b&#xff08;LLM&#xff09;\u52a8\u6001\u63a7\u5236\u6d41\u7a0b\u8d70\u5411\u3002<\/p>\n<p>\u60f3\u8c61\u4f60\u6709\u4e00\u4e2a\u8d85\u7ea7\u806a\u660e\u7684\u7a0b\u5e8f\u5458\u52a9\u624b&#xff0c;\u4f60\u53ea\u9700\u8bf4\u4e00\u53e5&#xff1a;&#034;\u628a\u8fd9\u4e2a\u9879\u76ee\u7684\u5355\u5143\u6d4b\u8bd5\u8986\u76d6\u7387\u63d0\u5347\u5230 80%\u3002&#034; \u7136\u540e\u4ed6\u5c31\u81ea\u5df1\u53bb\u770b\u4ee3\u7801\u3001\u5199\u6d4b\u8bd5\u3001\u8fd0\u884c\u6784\u5efa\u3001\u68c0\u67e5\u7ed3\u679c\u2026\u2026\u76f4\u5230\u8fbe\u6807\u4e3a\u6b62\u2014\u2014\u4e2d\u95f4\u4e0d\u9700\u8981\u4f60\u63d2\u624b\u3002\u8fd9\u4e2a&#034;\u80fd\u72ec\u7acb\u5b8c\u6210\u4efb\u52a1&#034;\u7684\u7a0b\u5e8f&#xff0c;\u5c31\u662f\u6211\u4eec\u6240\u8bf4\u7684 Agent&#xff08;\u667a\u80fd\u4f53&#xff09;\u3002\u6574\u4e2a\u8fc7\u7a0b\u6ca1\u6709\u56fa\u5b9a\u7684\u6d41\u7a0b\u56fe&#xff0c;\u800c\u662f\u5b83\u81ea\u5df1&#034;\u60f3&#034;\u51fa\u6765\u7684\u6b65\u9aa4\u2014\u2014\u8fd9\u5c31\u662f\u5178\u578b\u7684 Agent \u884c\u4e3a\u3002<\/p>\n<h4><span style=\"color:#1c7892\">3.2 Workflow&#xff08;\u5de5\u4f5c\u6d41&#xff09;<\/span><\/h4>\n<p>Workflow&#xff08;\u5de5\u4f5c\u6d41&#xff09; \u662f\u4e00\u4e2a\u5c06\u590d\u6742\u8fc7\u7a0b\u5206\u89e3\u4e3a\u5b9a\u4e49\u660e\u786e\u3001\u987a\u5e8f\u6267\u884c\u7684\u4efb\u52a1\u6d41\u7a0b&#xff0c;\u5e76\u5728\u5176\u4e2d\u81ea\u52a8\u5316\u4f20\u9012\u6570\u636e\u4e0e\u4efb\u52a1\u72b6\u6001&#xff0c;\u4ee5\u5b8c\u6210\u7279\u5b9a\u76ee\u6807\u3002<\/p>\n<p>\u5982\u679c\u8bf4 Agent \u662f\u806a\u660e\u7684\u6267\u884c\u8005&#xff0c;\u90a3\u5de5\u4f5c\u6d41\u5c31\u662f\u5b83\u7684\u884c\u52a8\u84dd\u56fe\u2014\u2014\u5b83\u5b9a\u4e49\u4e86&#034;\u5148\u505a\u4ec0\u4e48\u3001\u540e\u505a\u4ec0\u4e48\u3001\u5728\u4ec0\u4e48\u6761\u4ef6\u4e0b\u8df3\u8f6c\u6216\u7ec8\u6b62&#034;\u3002\u5176\u6838\u5fc3\u5728\u4e8e&#xff1a;\u9884\u8bbe\u7684\u3001\u53ef\u91cd\u590d\u7684\u6d41\u7a0b\u8def\u5f84\u3002<\/p>\n<p>\u4f8b\u5982\u516c\u53f8\u7684\u62a5\u9500\u6d41\u7a0b&#xff1a;\u63d0\u4ea4\u53d1\u7968 \u2192 \u9886\u5bfc\u5ba1\u6279 \u2192 \u8d22\u52a1\u5ba1\u6838 \u2192 \u8d22\u52a1\u7ed3\u7b97 \u2192 \u5f52\u6863\u5b8c\u6210\u3002<\/p>\n<p>\u6216\u4e00\u4e2a\u81ea\u52a8\u5316\u5ba2\u670d\u5de5\u5355\u7cfb\u7edf&#xff1a;\u7528\u6237\u63d0\u4ea4\u95ee\u9898 \u2192 \u7cfb\u7edf\u81ea\u52a8\u5206\u7c7b \u2192 \u5206\u914d\u7ed9\u5bf9\u5e94\u5ba2\u670d \u2192 \u5ba2\u670d\u5904\u7406 \u2192 \u7528\u6237\u8bc4\u4ef7 \u2192 \u5de5\u5355\u5173\u95ed\u3002<\/p>\n<p>\u8fd9\u79cd\u56fa\u5b9a\u8def\u5f84\u3001\u6574\u4e2a\u8fc7\u7a0b\u6cbf\u9884\u8bbe\u6d41\u7a0b\u8fd0\u884c&#xff0c;\u5c31\u662f\u5178\u578b\u7684\u5de5\u4f5c\u6d41\u884c\u4e3a\u3002LangGraph \u5b9e\u73b0\u7684\u6b63\u662f\u5de5\u4f5c\u6d41&#xff01;<\/p>\n<h4><span style=\"color:#1c7892\">3.3 \u5de5\u4f5c\u6d41\u548c Agent \u7684\u533a\u522b<\/span><\/h4>\n<p><span tabindex=\"-1\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"141\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135700-6aa94eaca6685.png\" width=\"796\" \/><span title=\"\u70b9\u51fb\u5e76\u62d6\u62fd\u4ee5\u6539\u53d8\u5c3a\u5bf8\">\u200b<\/span><\/span><\/p>\n<hr \/>\n<h3>\u56db\u3001LangGraph \u5982\u4f55\u5b9e\u73b0\u5de5\u4f5c\u6d41<\/h3>\n<h4><span style=\"color:#1c7892\">4.1 \u7406\u8bba<\/span><\/h4>\n<p>\u5728 LangGraph \u4e2d&#xff0c;\u5de5\u4f5c\u6d41\u57fa\u4e8e LLM \u4ee5\u53ca\u6dfb\u52a0\u5230\u5176\u4e2d\u7684\u5404\u79cd\u589e\u5f3a\u529f\u80fd&#xff08;\u5982\u5de5\u5177\u8c03\u7528\u3001\u7ed3\u6784\u5316\u8f93\u51fa\u548c\u77ed\u671f\u8bb0\u5fc6&#xff09;\u800c\u5b9e\u73b0\u3002<\/p>\n<p>\u518d\u6b21\u5f3a\u8c03&#xff1a;LangGraph \u662f\u4e00\u4e2a\u5f3a\u5927\u4e14\u7075\u6d3b\u7684 &#034;Agent Server \u64cd\u4f5c\u7cfb\u7edf\u5185\u6838&#034;\u3002\u5b83\u4e0d\u5173\u5fc3\u6211\u4eec\u5177\u4f53\u7528\u4ec0\u4e48\u6a21\u578b\u6216\u63d0\u793a\u8bcd&#xff0c;\u800c\u662f\u4e3a\u6211\u4eec\u89e3\u51b3\u6784\u5efa\u590d\u6742\u3001\u53ef\u9760\u3001\u53ef\u4ea4\u4e92\u7684 Agent Server \u65f6\u6240\u9762\u4e34\u7684\u72b6\u6001\u7ba1\u7406\u3001\u6d41\u7a0b\u7f16\u6392\u3001\u6301\u4e45\u5316\u548c\u4eba\u5de5\u76d1\u7763\u7b49\u5e95\u5c42\u5de5\u7a0b\u96be\u9898\u3002<\/p>\n<p><span tabindex=\"-1\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"285\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135700-6aa94eacc4395.png\" width=\"550\" \/><span title=\"\u70b9\u51fb\u5e76\u62d6\u62fd\u4ee5\u6539\u53d8\u5c3a\u5bf8\">\u200b<\/span><\/span><\/p>\n<h4><span style=\"color:#1c7892\">4.2 \u7406\u89e3\u56fe<\/span><\/h4>\n<p>\u5982\u4f55\u5b9e\u73b0\u5de5\u4f5c\u6d41\u903b\u8f91&#xff1f;\u56fe\u8ba1\u7b97\u662f\u4e00\u79cd\u7528\u8282\u70b9\u548c\u8fb9\u6765\u8868\u793a\u590d\u6742\u7cfb\u7edf\u7684\u65b9\u6cd5\u3002\u5728 AI \u9886\u57df&#xff0c;\u5b83\u7279\u522b\u9002\u5408\u6784\u5efa\u591a\u6b65\u9aa4\u3001\u6709\u72b6\u6001\u7684\u667a\u80fd\u5de5\u4f5c\u6d41\u3002<\/p>\n<p>\u60f3\u8c61\u4e00\u4e2a\u5feb\u9012\u914d\u9001\u7cfb\u7edf&#xff0c;\u4e0b\u56fe\u5c55\u793a\u4e86\u5305\u88f9\u4ece\u8f93\u5165&#xff08;\u63fd\u6536\u7ad9&#xff09; \u5230\u8f93\u51fa&#xff08;\u914d\u9001\u7ad9&#xff09; \u7684\u8fc7\u7a0b&#xff1a;<span tabindex=\"-1\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"396\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135700-6aa94eacda949.png\" width=\"885\" \/><span title=\"\u70b9\u51fb\u5e76\u62d6\u62fd\u4ee5\u6539\u53d8\u5c3a\u5bf8\">\u200b<\/span><\/span><\/p>\n<table>\n<tr>\u5feb\u9012\u6982\u5ff5LangGraph \u6982\u5ff5<\/tr>\n<tbody>\n<tr>\n<td>\u914d\u9001\u7ad9\u3001\u63fd\u6536\u7ad9\u3001\u5206\u62e3\u4e2d\u5fc3<\/td>\n<td>\u8282\u70b9&#xff08;Node&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u8fd0\u8f93\u8def\u7ebf<\/td>\n<td>\u8fb9&#xff08;Edge&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u5305\u88f9\u4fe1\u606f<\/td>\n<td>\u72b6\u6001&#xff08;State&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u5b8c\u6574\u914d\u9001\u7f51<\/td>\n<td>\u56fe&#xff08;Graph&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4><span style=\"color:#1c7892\">4.3 \u5de5\u4f5c\u6d41\u7684\u6838\u5fc3\u6982\u5ff5<\/span><\/h4>\n<h5><span style=\"color:#1a439c\">State&#xff08;\u72b6\u6001&#xff09;<\/span><\/h5>\n<p>State \u5c31\u50cf\u5feb\u9012\u5305\u88f9\u4e0a\u7684\u6807\u7b7e&#xff0c;\u8bb0\u5f55\u7740\u5305\u88f9\u7684\u5f53\u524d\u4f4d\u7f6e\u3001\u76ee\u7684\u5730\u3001\u914d\u9001\u72b6\u6001\u7b49\u4fe1\u606f\u3002\u5728\u6574\u4e2a\u914d\u9001\u8fc7\u7a0b\u4e2d&#xff0c;\u6240\u6709\u7ad9\u70b9\u90fd\u80fd\u67e5\u770b\u548c\u66f4\u65b0\u8fd9\u4e2a\u4fe1\u606f\u3002&#xff08;\u56e0\u6b64\u4f60\u53ef\u4ee5\u7406\u89e3\u4e3a\u7c7b\u7684\u516c\u5171\u5c5e\u6027&#xff09;<span tabindex=\"-1\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"269\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135701-6aa94ead182b8.png\" width=\"831\" \/><span title=\"\u70b9\u51fb\u5e76\u62d6\u62fd\u4ee5\u6539\u53d8\u5c3a\u5bf8\">\u200b<\/span><\/span><\/p>\n<p><span style=\"color:#511b78\">\u72b6\u6001\u7279\u6027&#xff1a;<\/span><\/p>\n<table>\n<tr>\u7279\u6027\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u5171\u4eab\u6027<\/td>\n<td>\u6240\u6709\u8282\u70b9&#xff08;\u5feb\u9012\u7ad9\u70b9&#xff09; \u90fd\u80fd\u8bfb\u53d6\u548c\u4fee\u6539<\/td>\n<\/tr>\n<tr>\n<td>\u6301\u4e45\u6027<\/td>\n<td>\u5728\u6574\u4e2a\u5de5\u4f5c\u6d41&#xff08;\u5feb\u9012\u8fd0\u8f93&#xff09; \u6267\u884c\u671f\u95f4\u6301\u7eed\u5b58\u5728<\/td>\n<\/tr>\n<tr>\n<td>\u7ed3\u6784\u5316<\/td>\n<td>\u6709\u660e\u786e\u7684\u5b57\u6bb5\u5b9a\u4e49<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#511b78\">\u4ee3\u7801\u793a\u4f8b&#xff1a;<\/span><\/p>\n<p> <span class=\"hljs-keyword\">from<\/span> typing <span class=\"hljs-keyword\">import<\/span> TypedDict<br \/>\n\u200b<br \/>\n<span class=\"hljs-keyword\">class<\/span> <span class=\"class_ hljs-title\">PackageState<\/span>(<span class=\"class_ hljs-title inherited__\">TypedDict<\/span>):<br \/>\n \u00a0 \u00a0<span class=\"hljs-comment\"># \u5305\u88f9\u57fa\u672c\u4fe1\u606f<\/span><br \/>\n \u00a0 \u00a0package_id: <span class=\"hljs-built_in\">str<\/span> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-comment\"># \u5305\u88f9id<\/span><br \/>\n \u00a0 \u00a0origin: <span class=\"hljs-built_in\">str<\/span> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-comment\"># \u59cb\u53d1\u7ad9<\/span><br \/>\n \u00a0 \u00a0destination: <span class=\"hljs-built_in\">str<\/span> \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\"># \u76ee\u7684\u5730<\/span><br \/>\n\u200b<br \/>\n \u00a0 \u00a0<span class=\"hljs-comment\"># \u914d\u9001\u72b6\u6001<\/span><br \/>\n \u00a0 \u00a0status: <span class=\"hljs-built_in\">str<\/span> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-comment\"># &#034;\u5f85\u63fd\u6536&#034;, &#034;\u8fd0\u8f93\u4e2d&#034;, &#034;\u6d3e\u9001\u4e2d&#034;, &#034;\u5df2\u7b7e\u6536&#034;<\/span><br \/>\n \u00a0 \u00a0history: <span class=\"hljs-built_in\">list<\/span>[<span class=\"hljs-built_in\">str<\/span>] \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\"># \u6d41\u8f6c\u5386\u53f2&#xff08;\u5b57\u7b26\u4e32\u5217\u8868&#xff09;&#xff0c;\u5217\u8868\u4e2d\u7684\u6bcf\u4e2a\u5b57\u7b26\u4e32\u8bb0\u5f55\u4e00\u6b21\u72b6\u6001\u53d8\u66f4<\/span><br \/>\n \u00a0 \u00a0total_distance: <span class=\"hljs-built_in\">int<\/span> \u00a0 \u00a0 \u00a0<span class=\"hljs-comment\"># \u603b\u91cc\u7a0b<\/span><br \/>\n\u200b<br \/>\n \u00a0 \u00a0<span class=\"hljs-comment\"># \u914d\u9001\u8be6\u60c5<\/span><br \/>\n \u00a0 \u00a0priority: <span class=\"hljs-built_in\">str<\/span> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-comment\"># &#034;\u666e\u901a&#034;, &#034;\u52a0\u6025&#034;<\/span> <\/p>\n<h5><span style=\"color:#1a439c\">Nodes&#xff08;\u8282\u70b9&#xff09;<\/span><\/h5>\n<p>\u8282\u70b9\u5c31\u50cf\u5feb\u9012\u914d\u9001\u7f51\u7edc\u4e2d\u7684\u5404\u4e2a\u7ad9\u70b9&#xff0c;\u6bcf\u4e2a\u7ad9\u70b9\u8d1f\u8d23\u7279\u5b9a\u7684\u5904\u7406\u6b65\u9aa4&#xff1a;<\/p>\n<p><span tabindex=\"-1\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"600\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135701-6aa94ead4e56f.png\" width=\"685\" \/><span title=\"\u70b9\u51fb\u5e76\u62d6\u62fd\u4ee5\u6539\u53d8\u5c3a\u5bf8\">\u200b<\/span><\/span><\/p>\n<p><span style=\"color:#511b78\">\u8282\u70b9\u7279\u5f81&#xff1a;<\/span><\/p>\n<table>\n<tr>\u7279\u5f81\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u5355\u4e00\u804c\u8d23<\/td>\n<td>\u6bcf\u4e2a\u8282\u70b9\u53ea\u505a\u4e00\u4ef6\u4e8b<\/td>\n<\/tr>\n<tr>\n<td>\u8f93\u5165\u8f93\u51fa<\/td>\n<td>\u63a5\u6536\u72b6\u6001&#xff0c;\u8fd4\u56de\u72b6\u6001\u66f4\u65b0<\/td>\n<\/tr>\n<tr>\n<td>\u72ec\u7acb\u6027<\/td>\n<td>\u8282\u70b9\u95f4\u4e0d\u76f4\u63a5\u901a\u4fe1&#xff0c;\u901a\u8fc7 State \u4ea4\u4e92<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#511b78\">\u4ee3\u7801\u793a\u4f8b&#xff1a;<\/span><\/p>\n<p> <span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">receive_package<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n \u00a0 \u00a0<span class=\"hljs-string\">&#034;&#034;&#034;<br \/>\n \u00a0  \u63fd\u6536\u7ad9\u5904\u7406\u51fd\u6570\u3002<br \/>\n \u00a0  \u5c06\u5305\u88f9\u72b6\u6001\u66f4\u65b0\u4e3a&#034;\u5df2\u63fd\u6536&#034;&#xff0c;\u5e76\u8bb0\u5f55\u63fd\u6536\u5730\u70b9&#xff08;\u53d6\u81ea state \u7684 origin \u5b57\u6bb5&#xff09;\u3002<br \/>\n \u00a0  Args:<br \/>\n \u00a0 \u00a0 \u00a0  state (PackageState): \u5f53\u524d\u5305\u88f9\u72b6\u6001\u5b57\u5178\u3002<br \/>\n \u00a0  Returns:<br \/>\n \u00a0 \u00a0 \u00a0  dict: \u66f4\u65b0\u540e\u7684\u72b6\u6001\u5b57\u6bb5&#xff0c;\u5305\u62ec status \u548c history\u3002<br \/>\n \u00a0  &#034;&#034;&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">return<\/span> {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;status&#034;<\/span>: <span class=\"hljs-string\">&#034;\u5df2\u63fd\u6536&#034;<\/span>,<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;history&#034;<\/span>: [<span class=\"hljs-string\">f&#034;\u5728<span class=\"hljs-subst\">{state[<span class=\"hljs-string\">&#039;origin&#039;<\/span>]}<\/span>\u63fd\u6536&#034;<\/span>], \u00a0<span class=\"hljs-comment\"># \u8bb0\u5f55\u63fd\u6536\u5730\u70b9<\/span><br \/>\n \u00a0  }<br \/>\n\u200b<br \/>\n<span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">sort_package<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n \u00a0 \u00a0<span class=\"hljs-string\">&#034;&#034;&#034;<br \/>\n \u00a0  \u5206\u62e3\u4e2d\u5fc3\u5904\u7406\u51fd\u6570\u3002<br \/>\n \u00a0  \u6839\u636e destination&#xff08;\u76ee\u7684\u5730&#xff09;\u5c06\u5305\u88f9\u5206\u62e3\u5230\u5bf9\u5e94\u7684\u5206\u62e3\u4e2d\u5fc3\u3002<br \/>\n \u00a0  Args:<br \/>\n \u00a0 \u00a0 \u00a0  state (PackageState): \u5f53\u524d\u5305\u88f9\u72b6\u6001\u5b57\u5178\u3002<br \/>\n \u00a0  Returns:<br \/>\n \u00a0 \u00a0 \u00a0  dict: \u66f4\u65b0\u540e\u7684\u72b6\u6001\u5b57\u6bb5&#xff0c;\u5305\u62ec status \u548c history\u3002<br \/>\n \u00a0  &#034;&#034;&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-comment\"># \u4ece\u5f53\u524d\u72b6\u6001\u5b57\u5178\u4e2d\u63d0\u53d6\u76ee\u6807\u5730\u5740&#xff0c;\u7528\u4e8e\u51b3\u5b9a\u5206\u62e3\u65b9\u5411<\/span><br \/>\n \u00a0 \u00a0destination &#061; state[<span class=\"hljs-string\">&#034;destination&#034;<\/span>] \u00a0<span class=\"hljs-comment\"># \u83b7\u53d6\u76ee\u7684\u5730\u5b57\u7b26\u4e32&#xff0c;\u5982 &#034;\u5317\u4eac\u671d\u9633\u533a&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">if<\/span> <span class=\"hljs-string\">&#034;\u5317\u4eac&#034;<\/span> <span class=\"hljs-keyword\">in<\/span> destination:<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0next_station &#061; <span class=\"hljs-string\">&#034;\u5317\u4eac\u5206\u62e3\u4e2d\u5fc3&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">elif<\/span> <span class=\"hljs-string\">&#034;\u4e0a\u6d77&#034;<\/span> <span class=\"hljs-keyword\">in<\/span> destination:<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0next_station &#061; <span class=\"hljs-string\">&#034;\u4e0a\u6d77\u5206\u62e3\u4e2d\u5fc3&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">else<\/span>:<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0next_station &#061; <span class=\"hljs-string\">&#034;\u5176\u4ed6\u5730\u533a\u5206\u62e3\u4e2d\u5fc3&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">return<\/span> {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;status&#034;<\/span>: <span class=\"hljs-string\">&#034;\u5df2\u5206\u62e3&#034;<\/span>,<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;history&#034;<\/span>: [<span class=\"hljs-string\">f&#034;\u5206\u62e3\u81f3<span class=\"hljs-subst\">{next_station}<\/span>&#034;<\/span>], \u00a0<span class=\"hljs-comment\"># \u8bb0\u5f55\u5206\u62e3\u7ed3\u679c<\/span><br \/>\n \u00a0  }<br \/>\n\u200b<br \/>\n<span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">final_delivery<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n \u00a0 \u00a0<span class=\"hljs-string\">&#034;&#034;&#034;<br \/>\n \u00a0  \u6d3e\u9001\u7ad9\u5904\u7406\u51fd\u6570\u3002<br \/>\n \u00a0  \u5c06\u5305\u88f9\u72b6\u6001\u66f4\u65b0\u4e3a&#034;\u5df2\u7b7e\u6536&#034;&#xff0c;\u5e76\u8bb0\u5f55\u9001\u8fbe\u76ee\u7684\u5730\u3002<br \/>\n \u00a0  Args:<br \/>\n \u00a0 \u00a0 \u00a0  state (PackageState): \u5f53\u524d\u5305\u88f9\u72b6\u6001\u5b57\u5178\u3002<br \/>\n \u00a0  Returns:<br \/>\n \u00a0 \u00a0 \u00a0  dict: \u66f4\u65b0\u540e\u7684\u72b6\u6001\u5b57\u6bb5&#xff0c;\u5305\u62ec status \u548c history\u3002<br \/>\n \u00a0  &#034;&#034;&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">return<\/span> {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;status&#034;<\/span>: <span class=\"hljs-string\">&#034;\u5df2\u7b7e\u6536&#034;<\/span>,<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;history&#034;<\/span>: [<span class=\"hljs-string\">f&#034;\u5df2\u9001\u8fbe<span class=\"hljs-subst\">{state[<span class=\"hljs-string\">&#039;destination&#039;<\/span>]}<\/span>&#034;<\/span>], \u00a0<span class=\"hljs-comment\"># \u8bb0\u5f55\u9001\u8fbe\u5730\u5740<\/span><br \/>\n \u00a0  } <\/p>\n<h5><span style=\"color:#1c7892\">Edges&#xff08;\u8fb9&#xff09;<\/span><\/h5>\n<p>\u8fb9\u5b9a\u4e49\u4e86\u5305\u88f9\u5728\u7ad9\u70b9\u4e4b\u95f4\u7684\u6d41\u52a8\u8def\u5f84&#xff0c;\u5c31\u50cf\u5feb\u9012\u516c\u53f8\u7684\u8fd0\u8f93\u8def\u7ebf\u56fe&#xff1a;<\/p>\n<table>\n<tr>\u8fb9\u7684\u7c7b\u578b\u8bf4\u660e\u5feb\u9012\u7c7b\u6bd4<\/tr>\n<tbody>\n<tr>\n<td>\u5f00\u59cb\/\u7ed3\u675f\u8fb9<\/td>\n<td>\u6d41\u7a0b\u7684\u5f00\u59cb\u548c\u7ed3\u675f\u70b9<\/td>\n<td>\u5305\u88f9\u7684\u8d77\u59cb\u7ad9\u4e0e\u7ec8\u70b9\u7ad9<\/td>\n<\/tr>\n<tr>\n<td>\u56fa\u5b9a\u8fb9<\/td>\n<td>\u603b\u662f\u4ece A \u5230 B<\/td>\n<td>\u63fd\u6536\u7ad9 \u2192 \u5206\u62e3\u4e2d\u5fc3&#xff08;\u6240\u6709\u5305\u88f9\u90fd\u8d70&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u6761\u4ef6\u8fb9<\/td>\n<td>\u6839\u636e\u72b6\u6001\u51b3\u5b9a\u4e0b\u4e00\u6b65<\/td>\n<td>\u6309\u76ee\u7684\u5730\u9009\u62e9\u4e0d\u540c\u5206\u62e3\u4e2d\u5fc3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span tabindex=\"-1\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"474\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135701-6aa94ead6daca.png\" width=\"765\" \/><span title=\"\u70b9\u51fb\u5e76\u62d6\u62fd\u4ee5\u6539\u53d8\u5c3a\u5bf8\">\u200b<\/span><\/span><\/p>\n<p><span tabindex=\"-1\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"590\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135701-6aa94ead8e01a.png\" width=\"815\" \/><span title=\"\u70b9\u51fb\u5e76\u62d6\u62fd\u4ee5\u6539\u53d8\u5c3a\u5bf8\">\u200b<\/span><\/span><\/p>\n<p><span tabindex=\"-1\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"635\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135701-6aa94eadcc526.png\" width=\"810\" \/><span title=\"\u70b9\u51fb\u5e76\u62d6\u62fd\u4ee5\u6539\u53d8\u5c3a\u5bf8\">\u200b<\/span><\/span><\/p>\n<p>\u56e0\u6b64&#xff0c;LangGraph \u901a\u8fc7\u8282\u70b9&#xff08;\u6bcf\u4e2a\u5904\u7406\u6b65\u9aa4&#xff09;\u3001\u8fb9&#xff08;\u6b65\u9aa4\u4e4b\u95f4\u7684\u8fde\u63a5&#xff09;\u548c\u72b6\u6001&#xff08;\u4fdd\u5b58\u6267\u884c\u8fc7\u7a0b&#xff09;&#xff0c;\u5373\u53ef\u6784\u5efa\u51fa\u4e00\u4e2a\u4efb\u52a1\u5de5\u4f5c\u6d41&#xff08;\u56fe&#xff09;\u3002<\/p>\n<hr \/>\n<h3>\u4e94\u3001LangGraph \u4ee3\u7801\u5b9e\u73b0<\/h3>\n<h4><span style=\"color:#1c7892\">\u6b65\u9aa41&#xff1a;\u5b9a\u4e49 State&#xff0c;\u8bbe\u7f6e\u5feb\u9012\u7684&#034;\u5305\u88f9\u4fe1\u606f&#034;<\/span><\/h4>\n<p> <span class=\"hljs-keyword\">from<\/span> typing <span class=\"hljs-keyword\">import<\/span> TypedDict, Annotated<br \/>\n<span class=\"hljs-keyword\">from<\/span> operator <span class=\"hljs-keyword\">import<\/span> add<br \/>\n\u200b<br \/>\n<span class=\"hljs-comment\"># 1. \u5b9a\u4e49\u5305\u88f9\u72b6\u6001<\/span><br \/>\n<span class=\"hljs-keyword\">class<\/span> <span class=\"class_ hljs-title\">PackageState<\/span>(<span class=\"class_ hljs-title inherited__\">TypedDict<\/span>):<br \/>\n \u00a0 \u00a0<span class=\"hljs-comment\"># \u5305\u88f9\u57fa\u672c\u4fe1\u606f<\/span><br \/>\n \u00a0 \u00a0package_id: <span class=\"hljs-built_in\">str<\/span> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-comment\"># \u5305\u88f9 ID<\/span><br \/>\n \u00a0 \u00a0origin: <span class=\"hljs-built_in\">str<\/span> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-comment\"># \u59cb\u53d1\u7ad9<\/span><br \/>\n \u00a0 \u00a0destination: <span class=\"hljs-built_in\">str<\/span> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\"># \u76ee\u7684\u5730<\/span><br \/>\n\u200b<br \/>\n \u00a0 \u00a0<span class=\"hljs-comment\"># \u914d\u9001\u72b6\u6001<\/span><br \/>\n \u00a0 \u00a0status: <span class=\"hljs-built_in\">str<\/span> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-comment\"># &#034;\u5f85\u63fd\u6536&#034;, &#034;\u8fd0\u8f93\u4e2d&#034;, &#034;\u6d3e\u9001\u4e2d&#034;, &#034;\u5df2\u7b7e\u6536&#034;<\/span><br \/>\n \u00a0 \u00a0history: Annotated[<span class=\"hljs-built_in\">list<\/span>[<span class=\"hljs-built_in\">str<\/span>], add] \u00a0 <span class=\"hljs-comment\"># \u6d41\u8f6c\u5386\u53f2&#xff08;\u81ea\u52a8\u8ffd\u52a0&#xff09;<\/span><br \/>\n \u00a0 \u00a0total_distance: Annotated[<span class=\"hljs-built_in\">int<\/span>, add] \u00a0<span class=\"hljs-comment\"># \u603b\u91cc\u7a0b&#xff08;\u81ea\u52a8\u7d2f\u52a0&#xff09;<\/span><br \/>\n\u200b<br \/>\n \u00a0 \u00a0<span class=\"hljs-comment\"># \u914d\u9001\u8be6\u60c5<\/span><br \/>\n \u00a0 \u00a0priority: <span class=\"hljs-built_in\">str<\/span> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-comment\"># &#034;\u666e\u901a&#034;, &#034;\u52a0\u6025&#034;<\/span> <\/p>\n<p><span style=\"color:#511b78\">\u3010\u77e5\u8bc6\u70b9\u3011State \u66f4\u65b0\u673a\u5236&#xff1a;Reducers<\/span><\/p>\n<p>\u72b6\u6001\u652f\u6301\u66f4\u65b0\u7684\u5173\u952e\u662f Reducers\u3002\u793a\u4f8b\u4e2d\u4f7f\u7528 Annotated \u7c7b\u578b\u4e3a history \u548c total_distance \u6307\u5b9a\u4e86 Reducer \u51fd\u6570&#xff08;operator.add&#xff09;&#xff0c;\u5b9a\u4e49\u4e86\u5982\u4f55\u66f4\u65b0\u5305\u88f9\u4fe1\u606f\u2014\u2014\u7279\u522b\u662f\u5f53\u591a\u4e2a\u7ad9\u70b9\u90fd\u8981\u8bb0\u5f55\u4fe1\u606f\u65f6&#xff0c;\u65b0\u503c\u4f1a\u8ffd\u52a0\u5230\u73b0\u6709\u503c\u4e2d&#xff0c;\u800c\u4e0d\u662f\u66ff\u6362&#xff1a;<\/p>\n<table>\n<tr>\u5199\u6cd5\u66f4\u65b0\u884c\u4e3a<\/tr>\n<tbody>\n<tr>\n<td>status: str<\/td>\n<td>\u8986\u76d6\u66f4\u65b0&#xff1a;\u6bcf\u6b21\u65b0\u72b6\u6001\u66ff\u6362\u65e7\u72b6\u6001<\/td>\n<\/tr>\n<tr>\n<td>history: Annotated[list[str], add]<\/td>\n<td>\u8ffd\u52a0\u66f4\u65b0&#xff1a;\u65b0\u7684\u6d41\u8f6c\u8bb0\u5f55\u6dfb\u52a0\u5230\u5386\u53f2\u5217\u8868<\/td>\n<\/tr>\n<tr>\n<td>total_distance: Annotated[int, add]<\/td>\n<td>\u6570\u503c\u7d2f\u52a0&#xff1a;\u91cc\u7a0b\u6570\u7d2f\u52a0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4><span style=\"color:#1c7892\">\u6b65\u9aa42&#xff1a;\u5b9a\u4e49 StateGraph \u56fe&#xff0c;\u6210\u7acb\u5feb\u9012\u516c\u53f8<\/span><\/h4>\n<ul>\n<li>\n<p>StateGraph \u662f\u4e00\u4e2a\u6709\u72b6\u6001\u56fe\u8ba1\u7b97\u6846\u67b6&#xff0c;\u57fa\u4e8e\u6709\u5411\u56fe&#xff08;Directed Graph&#xff09; \u6a21\u578b\u6784\u5efa&#xff0c;\u4e13\u95e8\u8bbe\u8ba1\u7528\u4e8e\u5904\u7406\u591a\u6b65\u9aa4\u3001\u6709\u72b6\u6001\u7684\u5de5\u4f5c\u6d41\u7a0b\u3002<\/p>\n<\/li>\n<li>\n<p>StateGraph \u7528\u4e8e\u5c06\u590d\u6742\u7684\u5de5\u4f5c\u6d41\u7a0b\u53ef\u89c6\u5316\u3001\u6a21\u5757\u5316&#xff0c;\u8ba9\u5f00\u53d1\u8005\u80fd\u591f\u50cf\u8bbe\u8ba1\u5feb\u9012\u914d\u9001\u7f51\u7edc\u4e00\u6837\u8bbe\u8ba1\u8f6f\u4ef6\u7cfb\u7edf\u3002<\/p>\n<\/li>\n<li>\n<p>\u9700\u8981\u4f7f\u7528 langgraph.graph.state.StateGraph \u6765\u5b9a\u4e49\u3002StateGraph \u4ec5\u662f\u4e00\u4e2a\u6784\u5efa\u5668\u7c7b&#xff0c;\u53ef\u4ee5\u4f7f\u7528 State \u6765\u6784\u5efa\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u4ee3\u7801\u793a\u4f8b&#xff1a;<\/p>\n<p> <span class=\"hljs-keyword\">from<\/span> langgraph.graph <span class=\"hljs-keyword\">import<\/span> StateGraph<br \/>\n\u200b<br \/>\n<span class=\"hljs-comment\"># 2. \u6210\u7acb\u5feb\u9012\u516c\u53f8<\/span><br \/>\ndelivery &#061; StateGraph(PackageState) <\/p>\n<h4><span style=\"color:#1c7892\">\u6b65\u9aa43&#xff1a;\u5b9a\u4e49 Nodes&#xff0c;\u521b\u5efa\u914d\u9001\u7ad9\u70b9<\/span><\/h4>\n<p>\u5728 LangGraph \u4e2d&#xff0c;\u8282\u70b9\u5c31\u662f\u4e00\u4e2a Python \u51fd\u6570&#xff08;\u540c\u6b65\u6216\u5f02\u6b65&#xff09;\u3002\u6ce8\u610f&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u8282\u70b9\u63a5\u6536\u72b6\u6001\u4f5c\u4e3a\u53c2\u6570<\/p>\n<\/li>\n<li>\n<p>\u8282\u70b9\u4e0d\u9700\u8981\u8fd4\u56de\u6574\u4e2a\u72b6\u6001\u6a21\u5f0f&#xff0c;\u53ea\u9700\u8fd4\u56de\u4e00\u4e2a\u66f4\u65b0&#xff08;\u5373\u72b6\u6001\u7684\u90e8\u5206\u5b57\u6bb5&#xff09;<\/p>\n<\/li>\n<\/ul>\n<p>\u4ee3\u7801\u793a\u4f8b&#xff1a;<\/p>\n<p> <span class=\"hljs-comment\"># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; \u914d\u9001\u7ad9\u70b9\u51fd\u6570 &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/span><br \/>\n<span class=\"hljs-comment\"># \u8fd9\u4e9b\u51fd\u6570\u6a21\u62df\u4e86\u5305\u88f9\u5728\u914d\u9001\u6d41\u7a0b\u4e2d\u7ecf\u8fc7\u7684\u4e0d\u540c\u7ad9\u70b9&#xff08;\u72b6\u6001\u8282\u70b9&#xff09;<\/span><br \/>\n<span class=\"hljs-comment\"># \u6bcf\u4e2a\u51fd\u6570\u63a5\u6536\u4e00\u4e2a PackageState \u5b57\u5178&#xff0c;\u5e76\u8fd4\u56de\u66f4\u65b0\u540e\u7684\u72b6\u6001\u5b57\u6bb5<\/span><br \/>\n\u200b<br \/>\n<span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">receive_package<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n \u00a0 \u00a0<span class=\"hljs-string\">&#034;&#034;&#034;<br \/>\n \u00a0  \u63fd\u6536\u7ad9\u5904\u7406\u51fd\u6570\u3002<br \/>\n \u00a0  \u5c06\u5305\u88f9\u72b6\u6001\u66f4\u65b0\u4e3a&#034;\u5df2\u63fd\u6536&#034;&#xff0c;\u5e76\u8bb0\u5f55\u63fd\u6536\u5730\u70b9&#xff08;\u6765\u81ea state \u7684 origin \u5b57\u6bb5&#xff09;\u3002<br \/>\n \u00a0  &#034;&#034;&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">return<\/span> {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;status&#034;<\/span>: <span class=\"hljs-string\">&#034;\u5df2\u63fd\u6536&#034;<\/span>,<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;history&#034;<\/span>: [<span class=\"hljs-string\">f&#034;\u5728<span class=\"hljs-subst\">{state[<span class=\"hljs-string\">&#039;origin&#039;<\/span>]}<\/span>\u63fd\u6536&#034;<\/span>], \u00a0<span class=\"hljs-comment\"># \u8bb0\u5f55\u63fd\u6536\u5730\u70b9<\/span><br \/>\n \u00a0  }<br \/>\n\u200b<br \/>\n<span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">sort_package<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n \u00a0 \u00a0<span class=\"hljs-string\">&#034;&#034;&#034;<br \/>\n \u00a0  \u5206\u62e3\u4e2d\u5fc3\u5904\u7406\u51fd\u6570\u3002<br \/>\n \u00a0  \u6839\u636e\u76ee\u7684\u5730&#xff08;destination&#xff09;\u5c06\u5305\u88f9\u5206\u62e3\u5230\u5bf9\u5e94\u7684\u5206\u62e3\u4e2d\u5fc3\u3002<br \/>\n \u00a0  &#034;&#034;&#034;<\/span><br \/>\n \u00a0 \u00a0destination &#061; state[<span class=\"hljs-string\">&#034;destination&#034;<\/span>] \u00a0<span class=\"hljs-comment\"># \u83b7\u53d6\u76ee\u7684\u5730\u5b57\u7b26\u4e32<\/span><br \/>\n\u200b<br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">if<\/span> <span class=\"hljs-string\">&#034;\u5317\u4eac&#034;<\/span> <span class=\"hljs-keyword\">in<\/span> destination:<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0next_station &#061; <span class=\"hljs-string\">&#034;\u5317\u4eac\u5206\u62e3\u4e2d\u5fc3&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">elif<\/span> <span class=\"hljs-string\">&#034;\u4e0a\u6d77&#034;<\/span> <span class=\"hljs-keyword\">in<\/span> destination:<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0next_station &#061; <span class=\"hljs-string\">&#034;\u4e0a\u6d77\u5206\u62e3\u4e2d\u5fc3&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">else<\/span>:<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0next_station &#061; <span class=\"hljs-string\">&#034;\u5176\u4ed6\u5730\u533a\u5206\u62e3\u4e2d\u5fc3&#034;<\/span><br \/>\n\u200b<br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">return<\/span> {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;status&#034;<\/span>: <span class=\"hljs-string\">&#034;\u5df2\u5206\u62e3&#034;<\/span>,<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;history&#034;<\/span>: [<span class=\"hljs-string\">f&#034;\u5206\u62e3\u81f3<span class=\"hljs-subst\">{next_station}<\/span>&#034;<\/span>], \u00a0<span class=\"hljs-comment\"># \u8bb0\u5f55\u5206\u62e3\u7ed3\u679c<\/span><br \/>\n \u00a0  }<br \/>\n\u200b<br \/>\n<span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">final_delivery<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n \u00a0 \u00a0<span class=\"hljs-string\">&#034;&#034;&#034;<br \/>\n \u00a0  \u6d3e\u9001\u7ad9\u5904\u7406\u51fd\u6570\u3002<br \/>\n \u00a0  \u5c06\u5305\u88f9\u72b6\u6001\u66f4\u65b0\u4e3a&#034;\u5df2\u7b7e\u6536&#034;&#xff0c;\u5e76\u8bb0\u5f55\u9001\u8fbe\u5730\u5740&#xff08;\u6765\u81ea state \u7684 destination \u5b57\u6bb5&#xff09;\u3002<br \/>\n \u00a0  &#034;&#034;&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">return<\/span> {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;status&#034;<\/span>: <span class=\"hljs-string\">&#034;\u5df2\u7b7e\u6536&#034;<\/span>,<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;history&#034;<\/span>: [<span class=\"hljs-string\">f&#034;\u5df2\u9001\u8fbe<span class=\"hljs-subst\">{state[<span class=\"hljs-string\">&#039;destination&#039;<\/span>]}<\/span>&#034;<\/span>], \u00a0<span class=\"hljs-comment\"># \u8bb0\u5f55\u9001\u8fbe\u5730\u5740<\/span><br \/>\n \u00a0  } <\/p>\n<h4><span style=\"color:#1c7892\">\u6b65\u9aa44&#xff1a;\u6dfb\u52a0 Nodes&#xff0c;\u5efa\u8bbe\u914d\u9001\u7ad9\u70b9<\/span><\/h4>\n<p>\u5c06\u5404\u8282\u70b9\u7ec4\u7ec7\u8fdb\u56fe\u4e2d\u2014\u2014\u4f7f\u7528 add_node() \u5c06\u65b0\u8282\u70b9\u6dfb\u52a0\u5230 StateGraph\u3002<\/p>\n<p>add_node() \u5e38\u7528\u53c2\u6570&#xff1a;<\/p>\n<table>\n<tr>\u53c2\u6570\u540d\u7c7b\u578b\u63cf\u8ff0<\/tr>\n<tbody>\n<tr>\n<td>node<\/td>\n<td>\u5b57\u7b26\u4e32 \u6216 StateNode \u5bf9\u8c61<\/td>\n<td>\u6307\u5b9a\u8282\u70b9\u8981\u8fd0\u884c\u7684\u51fd\u6570\u6216\u53ef\u6267\u884c\u5bf9\u8c61\u3002\u4f20\u5b57\u7b26\u4e32\u65f6\u8be5\u5b57\u7b26\u4e32\u4f5c\u4e3a\u8282\u70b9\u540d\u79f0&#xff0c;\u6b64\u65f6\u7528 action \u53c2\u6570\u4f5c\u4e3a\u5b9e\u9645\u6267\u884c\u51fd\u6570&#xff1b;\u4f20 StateNode \u5bf9\u8c61\u65f6\u76f4\u63a5\u4f7f\u7528\u8be5\u5bf9\u8c61\u5b9a\u4e49\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>action<\/td>\n<td>StateNode \u5bf9\u8c61\u6216 None&#xff08;\u9ed8\u8ba4&#xff09;<\/td>\n<td>\u5b9a\u4e49\u4e0e\u8282\u70b9\u5173\u8054\u7684\u52a8\u4f5c&#xff08;\u6267\u884c\u903b\u8f91&#xff09;\u3002node \u662f\u5b57\u7b26\u4e32\u65f6 action \u4f5c\u4e3a\u5b9e\u9645\u6267\u884c\u51fd\u6570&#xff1b;node \u5df2\u662f StateNode \u65f6\u901a\u5e38\u4e3a None<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4ee3\u7801\u793a\u4f8b&#xff1a;<\/p>\n<p> <span class=\"hljs-comment\"># 4. \u6dfb\u52a0\u914d\u9001\u7ad9\u70b9<\/span><br \/>\ndelivery.add_node(<span class=\"hljs-string\">&#034;\u63fd\u6536\u7ad9&#034;<\/span>, receive_package)<br \/>\ndelivery.add_node(<span class=\"hljs-string\">&#034;\u5206\u62e3\u4e2d\u5fc3&#034;<\/span>, sort_package)<br \/>\ndelivery.add_node(<span class=\"hljs-string\">&#034;\u6d3e\u9001\u7ad9&#034;<\/span>, final_delivery) <\/p>\n<h4><span style=\"color:#1c7892\">\u6b65\u9aa45&#xff1a;\u6dfb\u52a0 Edges&#xff0c;\u89c4\u5212\u8fd0\u8f93\u8def\u7ebf<\/span><\/h4>\n<p>\u5404\u8282\u70b9&#xff08;\u7ad9\u70b9&#xff09; \u51c6\u5907\u597d\u540e&#xff0c;\u5219\u9700\u8981\u4e3a\u5feb\u9012\u6d41\u8f6c\u89c4\u5212\u8def\u7ebf&#xff08;\u8fb9&#xff09;\u3002<\/p>\n<p><span tabindex=\"-1\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"565\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135702-6aa94eae154e3.png\" width=\"519\" \/><span title=\"\u70b9\u51fb\u5e76\u62d6\u62fd\u4ee5\u6539\u53d8\u5c3a\u5bf8\">\u200b<\/span><\/span><\/p>\n<p>\u5728 LangGraph \u4e2d&#xff1a;<\/p>\n<table>\n<tr>\u7279\u6b8a\u8282\u70b9\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>START \u8282\u70b9<\/td>\n<td>\u7279\u6b8a\u8282\u70b9&#xff0c;\u8868\u793a\u5c06\u7528\u6237\u8f93\u5165\u53d1\u9001\u5230\u56fe\u7684\u8282\u70b9&#xff0c;\u7528\u4e8e\u786e\u5b9a\u5e94\u8be5\u9996\u5148\u8c03\u7528\u54ea\u4e9b\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>END \u8282\u70b9<\/td>\n<td>\u8868\u793a\u7ec8\u7aef\u8282\u70b9&#xff0c;\u6307\u793a\u54ea\u4e9b\u8fb9\u5728\u5b8c\u6210\u540e\u6ca1\u6709\u540e\u7eed\u52a8\u4f5c<\/td>\n<\/tr>\n<tr>\n<td>\u6761\u4ef6\u5165\u53e3\u70b9<\/td>\n<td>\u8c03\u7528\u4e00\u4e2a\u51fd\u6570\u6765\u786e\u5b9a\u7528\u6237\u8f93\u5165\u5230\u8fbe\u65f6\u9996\u5148\u8c03\u7528\u54ea\u4e2a\u8282\u70b9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>add_edge() \u5e38\u7528\u53c2\u6570&#xff08;\u56fa\u5b9a\u8fb9&#xff09;&#xff1a;<\/p>\n<table>\n<tr>\u53c2\u6570\u540d\u7c7b\u578b\u63cf\u8ff0<\/tr>\n<tbody>\n<tr>\n<td>start_key<\/td>\n<td>\u5b57\u7b26\u4e32 \u6216 \u5b57\u7b26\u4e32\u5217\u8868<\/td>\n<td>\u8fb9\u7684\u8d77\u59cb\u8282\u70b9\u7684\u952e<\/td>\n<\/tr>\n<tr>\n<td>end_key<\/td>\n<td>\u5b57\u7b26\u4e32<\/td>\n<td>\u8fb9\u7684\u7ed3\u675f\u8282\u70b9\u7684\u952e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>add_conditional_edges() \u5e38\u7528\u53c2\u6570&#xff08;\u6761\u4ef6\u8fb9&#xff09;&#xff1a;<\/p>\n<table>\n<tr>\u53c2\u6570\u540d\u7c7b\u578b\u63cf\u8ff0<\/tr>\n<tbody>\n<tr>\n<td>source<\/td>\n<td>\u5b57\u7b26\u4e32<\/td>\n<td>\u8d77\u59cb\u8282\u70b9\u3002\u9000\u51fa\u6b64\u8282\u70b9\u65f6&#xff0c;\u5c06\u8fd0\u884c\u6b64\u6761\u4ef6\u8fb9<\/td>\n<\/tr>\n<tr>\n<td>path<\/td>\n<td>Callable \u6216 Runnable<\/td>\n<td>\u51b3\u5b9a\u4e0b\u4e00\u4e2a\u8282\u70b9\u6216\u591a\u4e2a\u8282\u70b9\u7684\u65b9\u6cd5\u3002\u672a\u6307\u5b9a path_map \u65f6\u5e94\u8fd4\u56de\u4e00\u4e2a\u6216\u591a\u4e2a\u8282\u70b9&#xff1b;\u8fd4\u56de &#034;END&#034; \u65f6\u56fe\u5c06\u505c\u6b62\u6267\u884c<\/td>\n<\/tr>\n<tr>\n<td>path_map<\/td>\n<td>\u5b57\u5178 \/ \u5b57\u7b26\u4e32\u5217\u8868 \/ None<\/td>\n<td>\u3010\u53ef\u9009\u3011\u5c06\u8def\u5f84\u6620\u5c04\u5230\u8282\u70b9\u540d\u3002\u7701\u7565\u65f6&#xff0c;path \u8fd4\u56de\u7684\u8def\u5f84\u5e94\u4e3a\u8282\u70b9\u540d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4ee3\u7801\u793a\u4f8b&#xff1a;<\/p>\n<p> <span class=\"hljs-comment\"># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; \u65b0\u589e\u8282\u70b9 &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/span><br \/>\n<span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">standard_delivery<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n \u00a0 \u00a0<span class=\"hljs-string\">&#034;&#034;&#034;<br \/>\n \u00a0  \u6807\u51c6\u914d\u9001\u8282\u70b9\u3002<br \/>\n \u00a0  \u5c06\u5305\u88f9\u72b6\u6001\u66f4\u65b0\u4e3a&#034;\u8fd0\u8f93\u4e2d&#034;&#xff0c;\u8bb0\u5f55\u6807\u51c6\u9646\u8fd0&#xff0c;\u603b\u91cc\u7a0b\u8bbe\u4e3a 500\u3002<br \/>\n \u00a0  &#034;&#034;&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">return<\/span> {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;status&#034;<\/span>: <span class=\"hljs-string\">&#034;\u8fd0\u8f93\u4e2d&#034;<\/span>,<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;history&#034;<\/span>: [<span class=\"hljs-string\">&#034;\u6807\u51c6\u9646\u8fd0&#034;<\/span>],<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;total_distance&#034;<\/span>: <span class=\"hljs-number\">500<\/span>,<br \/>\n \u00a0  }<br \/>\n\u200b<br \/>\n<span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">express_delivery<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n \u00a0 \u00a0<span class=\"hljs-string\">&#034;&#034;&#034;<br \/>\n \u00a0  \u52a0\u6025\u914d\u9001\u8282\u70b9\u3002<br \/>\n \u00a0  \u5c06\u5305\u88f9\u72b6\u6001\u66f4\u65b0\u4e3a&#034;\u52a0\u6025\u8fd0\u8f93&#034;&#xff0c;\u8bb0\u5f55\u7a7a\u8fd0\u52a0\u6025&#xff0c;\u603b\u91cc\u7a0b\u8bbe\u4e3a 800\u3002<br \/>\n \u00a0  &#034;&#034;&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">return<\/span> {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;status&#034;<\/span>: <span class=\"hljs-string\">&#034;\u52a0\u6025\u8fd0\u8f93&#034;<\/span>,<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;history&#034;<\/span>: [<span class=\"hljs-string\">&#034;\u7a7a\u8fd0\u52a0\u6025&#034;<\/span>],<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-string\">&#034;total_distance&#034;<\/span>: <span class=\"hljs-number\">800<\/span>,<br \/>\n \u00a0  }<br \/>\n\u200b<br \/>\n<span class=\"hljs-comment\"># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; 4. \u6dfb\u52a0\u914d\u9001\u7ad9\u70b9 &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/span><br \/>\ndelivery.add_node(<span class=\"hljs-string\">&#034;\u63fd\u6536\u7ad9&#034;<\/span>, receive_package)<br \/>\ndelivery.add_node(<span class=\"hljs-string\">&#034;\u5206\u62e3\u4e2d\u5fc3&#034;<\/span>, sort_package)<br \/>\ndelivery.add_node(<span class=\"hljs-string\">&#034;\u6807\u51c6\u914d\u9001&#034;<\/span>, standard_delivery)<br \/>\ndelivery.add_node(<span class=\"hljs-string\">&#034;\u52a0\u6025\u914d\u9001&#034;<\/span>, express_delivery)<br \/>\ndelivery.add_node(<span class=\"hljs-string\">&#034;\u6d3e\u9001\u7ad9&#034;<\/span>, final_delivery)<br \/>\n\u200b<br \/>\n<span class=\"hljs-comment\"># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; 5. \u8bbe\u8ba1\u914d\u9001\u8def\u7ebf &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/span><br \/>\ndelivery.add_edge(START, <span class=\"hljs-string\">&#034;\u63fd\u6536\u7ad9&#034;<\/span>)<br \/>\ndelivery.add_edge(<span class=\"hljs-string\">&#034;\u63fd\u6536\u7ad9&#034;<\/span>, <span class=\"hljs-string\">&#034;\u5206\u62e3\u4e2d\u5fc3&#034;<\/span>)<br \/>\n\u200b<br \/>\n<span class=\"hljs-comment\"># \u667a\u80fd\u8def\u7531&#xff1a;\u6839\u636e\u4f18\u5148\u7ea7\u9009\u62e9\u914d\u9001\u65b9\u5f0f<\/span><br \/>\n<span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">select_delivery<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n \u00a0 \u00a0<span class=\"hljs-string\">&#034;&#034;&#034;<br \/>\n \u00a0  \u667a\u80fd\u8def\u7531\u51b3\u7b56\u51fd\u6570\u3002<br \/>\n \u00a0  \u6839\u636e\u5305\u88f9\u7684 priority \u5b57\u6bb5\u51b3\u5b9a\u4e0b\u4e00\u6b65\u8fdb\u5165\u54ea\u4e2a\u914d\u9001\u8282\u70b9&#xff1a;<br \/>\n \u00a0 \u00a0  &#8211; \u82e5\u4e3a &#034;\u52a0\u6025&#034;&#xff0c;\u5219\u8fdb\u5165 &#034;\u52a0\u6025\u914d\u9001&#034;<br \/>\n \u00a0 \u00a0  &#8211; \u5426\u5219\u8fdb\u5165 &#034;\u6807\u51c6\u914d\u9001&#034;<br \/>\n \u00a0  Returns:<br \/>\n \u00a0 \u00a0 \u00a0  str: \u4e0b\u4e00\u4e2a\u8282\u70b9\u7684\u540d\u79f0\u3002<br \/>\n \u00a0  &#034;&#034;&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">if<\/span> state[<span class=\"hljs-string\">&#034;priority&#034;<\/span>] &#061;&#061; <span class=\"hljs-string\">&#034;\u52a0\u6025&#034;<\/span>:<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-string\">&#034;\u52a0\u6025\u914d\u9001&#034;<\/span><br \/>\n \u00a0 \u00a0<span class=\"hljs-keyword\">else<\/span>:<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-string\">&#034;\u6807\u51c6\u914d\u9001&#034;<\/span><br \/>\n\u200b<br \/>\n<span class=\"hljs-comment\"># \u6dfb\u52a0\u6761\u4ef6\u8fb9&#xff1a;<\/span><br \/>\n<span class=\"hljs-comment\"># \u00a0 &#8211; source: \u4ece &#034;\u5206\u62e3\u4e2d\u5fc3&#034; \u8282\u70b9\u9000\u51fa\u65f6\u89e6\u53d1<\/span><br \/>\n<span class=\"hljs-comment\"># \u00a0 &#8211; path: \u8c03\u7528 select_delivery \u51b3\u5b9a\u4e0b\u4e00\u4e2a\u8282\u70b9<\/span><br \/>\n<span class=\"hljs-comment\"># \u00a0 &#8211; path_map: \u660e\u786e\u5217\u51fa\u6240\u6709\u53ef\u80fd\u7684\u8fd4\u56de\u503c&#xff08;\u7528\u4e8e\u6821\u9a8c\u548c\u53ef\u89c6\u5316&#xff09;<\/span><br \/>\ndelivery.add_conditional_edges(<br \/>\n \u00a0 \u00a0<span class=\"hljs-string\">&#034;\u5206\u62e3\u4e2d\u5fc3&#034;<\/span>, \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"hljs-comment\"># source&#xff1a;\u8d77\u59cb\u8282\u70b9<\/span><br \/>\n \u00a0 \u00a0select_delivery, \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\"># path&#xff1a;\u786e\u5b9a\u4e0b\u4e00\u4e2a\u8282\u70b9\u7684\u53ef\u8c03\u7528\u5bf9\u8c61<\/span><br \/>\n \u00a0  [<span class=\"hljs-string\">&#034;\u52a0\u6025\u914d\u9001&#034;<\/span>, <span class=\"hljs-string\">&#034;\u6807\u51c6\u914d\u9001&#034;<\/span>], \u00a0 <span class=\"hljs-comment\"># path_map&#xff1a;\u53ef\u80fd\u7684\u8fd4\u56de\u503c\u5217\u8868<\/span><br \/>\n)<br \/>\n\u200b<br \/>\ndelivery.add_edge(<span class=\"hljs-string\">&#034;\u6807\u51c6\u914d\u9001&#034;<\/span>, <span class=\"hljs-string\">&#034;\u6d3e\u9001\u7ad9&#034;<\/span>)<br \/>\ndelivery.add_edge(<span class=\"hljs-string\">&#034;\u52a0\u6025\u914d\u9001&#034;<\/span>, <span class=\"hljs-string\">&#034;\u6d3e\u9001\u7ad9&#034;<\/span>)<br \/>\ndelivery.add_edge(<span class=\"hljs-string\">&#034;\u6d3e\u9001\u7ad9&#034;<\/span>, END) <\/p>\n<h4><span style=\"color:#1c7892\">\u6b65\u9aa46&#xff1a;\u7f16\u8bd1\u56fe&#xff0c;\u4ece\u516c\u53f8\u521b\u5efa\u5230\u8fd0\u884c<\/span><\/h4>\n<p>\u5728\u6b65\u9aa42\u4e2d&#xff0c;\u6211\u4eec\u4ec5\u662f\u6784\u5efa\u51fa StateGraph&#xff0c;\u8fd8\u65e0\u6cd5\u76f4\u63a5\u7528\u4e8e\u6267\u884c\u3002LangGraph \u8981\u6c42&#xff1a;\u5fc5\u987b\u5148\u7f16\u8bd1\u56fe&#xff0c;\u7136\u540e\u624d\u80fd\u4f7f\u7528\u5b83\u3002\u7f16\u8bd1\u63d0\u4f9b\u4e86\u5bf9\u56fe\u7ed3\u6784\u7684\u4e00\u4e9b\u57fa\u672c\u68c0\u67e5&#xff0c;\u4f1a\u9a8c\u8bc1&#xff1a;<\/p>\n<table>\n<tr>\u68c0\u67e5\u9879\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u53ef\u8fbe\u6027&#xff08;TOP&#xff09;<\/td>\n<td>\u4ece START \u5230\u6240\u6709\u8282\u70b9\u7684\u53ef\u8fbe\u6027<\/td>\n<\/tr>\n<tr>\n<td>\u53ef\u8fbe\u6027&#xff08;BOTTOM&#xff09;<\/td>\n<td>\u4ece\u6240\u6709\u8282\u70b9\u5230 END \u7684\u53ef\u8fbe\u6027<\/td>\n<\/tr>\n<tr>\n<td>\u7ed3\u6784\u5b8c\u6574\u6027<\/td>\n<td>\u6ca1\u6709\u5b64\u7acb\u8282\u70b9\u6216\u6b7b\u5faa\u73af<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4f7f\u7528 compile() \u65b9\u6cd5\u5373\u53ef\u7f16\u8bd1\u56fe&#xff0c;\u5c06 StateGraph \u7f16\u8bd1\u4e3a CompiledStateGraph \u5bf9\u8c61\u3002\u7f16\u8bd1\u540e\u7684\u56fe\u5b9e\u73b0\u4e86 Runnable \u63a5\u53e3&#xff0c;\u53ef\u4ee5\u5f02\u6b65\u8c03\u7528\u3001\u6d41\u5f0f\u4f20\u8f93\u3001\u6279\u5904\u7406\u548c\u8fd0\u884c\u3002<\/p>\n<p>\u4ee3\u7801\u793a\u4f8b&#xff1a;<\/p>\n<p> <span class=\"hljs-comment\"># 6. \u7f16\u8bd1\u7cfb\u7edf<\/span><br \/>\ndelivery_system &#061; delivery.<span class=\"hljs-built_in\">compile<\/span>() <\/p>\n<h4><span style=\"color:#1a439c\">\u5b8c\u6574\u4ee3\u7801<\/span><\/h4>\n<p> <span class=\"hljs-keyword\">from<\/span> typing <span class=\"hljs-keyword\">import<\/span> TypedDict, Annotated<br \/>\n<span class=\"hljs-keyword\">from<\/span> operator <span class=\"hljs-keyword\">import<\/span> add<br \/>\n<span class=\"hljs-keyword\">from<\/span> langgraph.graph <span class=\"hljs-keyword\">import<\/span> StateGraph, START, END<\/p>\n<p><span class=\"hljs-comment\"># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; 1. \u5b9a\u4e49\u5305\u88f9\u72b6\u6001 &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/span><br \/>\n<span class=\"hljs-keyword\">class<\/span> <span class=\"class_ hljs-title\">PackageState<\/span>(<span class=\"class_ hljs-title inherited__\">TypedDict<\/span>):<br \/>\n    <span class=\"hljs-string\">&#034;&#034;&#034;\u5305\u88f9\u5728\u6574\u4e2a\u914d\u9001\u6d41\u7a0b\u4e2d\u7684\u72b6\u6001\u6570\u636e\u7ed3\u6784\u3002&#034;&#034;&#034;<\/span><br \/>\n    <span class=\"hljs-comment\"># \u5305\u88f9\u57fa\u672c\u4fe1\u606f<\/span><br \/>\n    package_id: <span class=\"hljs-built_in\">str<\/span>                     <span class=\"hljs-comment\"># \u5305\u88f9 ID<\/span><br \/>\n    origin: <span class=\"hljs-built_in\">str<\/span>                         <span class=\"hljs-comment\"># \u59cb\u53d1\u7ad9<\/span><br \/>\n    destination: <span class=\"hljs-built_in\">str<\/span>                    <span class=\"hljs-comment\"># \u76ee\u7684\u5730<\/span><\/p>\n<p>    <span class=\"hljs-comment\"># \u914d\u9001\u72b6\u6001<\/span><br \/>\n    status: <span class=\"hljs-built_in\">str<\/span>                         <span class=\"hljs-comment\"># &#034;\u5f85\u63fd\u6536&#034;, &#034;\u8fd0\u8f93\u4e2d&#034;, &#034;\u6d3e\u9001\u4e2d&#034;, &#034;\u5df2\u7b7e\u6536&#034;<\/span><br \/>\n    <span class=\"hljs-comment\"># Annotated[list[str], add] \u8868\u793a\u8be5\u5b57\u6bb5\u505a\u72b6\u6001\u66f4\u65b0\u65f6\u7528 add \u51fd\u6570\u5408\u5e76&#xff08;\u8ffd\u52a0\u800c\u975e\u8986\u76d6&#xff09;<\/span><br \/>\n    history: Annotated[<span class=\"hljs-built_in\">list<\/span>[<span class=\"hljs-built_in\">str<\/span>], add]  <span class=\"hljs-comment\"># \u6d41\u8f6c\u5386\u53f2&#xff08;\u81ea\u52a8\u8ffd\u52a0&#xff09;<\/span><br \/>\n    <span class=\"hljs-comment\"># \u540c\u7406&#xff0c;int \u7c7b\u578b\u4f7f\u7528 add \u4f1a\u5c06\u65b0\u65e7\u503c\u7d2f\u52a0<\/span><br \/>\n    total_distance: Annotated[<span class=\"hljs-built_in\">int<\/span>, add] <span class=\"hljs-comment\"># \u603b\u91cc\u7a0b&#xff08;\u81ea\u52a8\u7d2f\u52a0&#xff09;<\/span><\/p>\n<p>    <span class=\"hljs-comment\"># \u914d\u9001\u8be6\u60c5<\/span><br \/>\n    priority: <span class=\"hljs-built_in\">str<\/span>                       <span class=\"hljs-comment\"># &#034;\u666e\u901a&#034;, &#034;\u52a0\u6025&#034;<\/span><\/p>\n<p><span class=\"hljs-comment\"># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; 2. \u6210\u7acb\u5feb\u9012\u516c\u53f8&#xff08;\u521b\u5efa\u72b6\u6001\u56fe&#xff09; &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/span><br \/>\ndelivery &#061; StateGraph(PackageState)<\/p>\n<p><span class=\"hljs-comment\"># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; 3. \u5b9a\u4e49\u5404\u4e2a\u914d\u9001\u7ad9\u70b9\u51fd\u6570 &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/span><br \/>\n<span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">receive_package<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n    <span class=\"hljs-string\">&#034;&#034;&#034;\u63fd\u6536\u7ad9&#xff1a;\u66f4\u65b0\u4e3a&#034;\u5df2\u63fd\u6536&#034;&#xff0c;\u8bb0\u5f55\u63fd\u6536\u5730\u70b9\u3002&#034;&#034;&#034;<\/span><br \/>\n    <span class=\"hljs-keyword\">return<\/span> {<br \/>\n        <span class=\"hljs-string\">&#034;status&#034;<\/span>: <span class=\"hljs-string\">&#034;\u5df2\u63fd\u6536&#034;<\/span>,<br \/>\n        <span class=\"hljs-string\">&#034;history&#034;<\/span>: [<span class=\"hljs-string\">f&#034;\u5728<span class=\"hljs-subst\">{state[<span class=\"hljs-string\">&#039;origin&#039;<\/span>]}<\/span>\u63fd\u6536&#034;<\/span>],<br \/>\n    }<\/p>\n<p><span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">sort_package<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n    <span class=\"hljs-string\">&#034;&#034;&#034;\u5206\u62e3\u4e2d\u5fc3&#xff1a;\u6309\u76ee\u7684\u5730\u5206\u62e3\u3002&#034;&#034;&#034;<\/span><br \/>\n    destination &#061; state[<span class=\"hljs-string\">&#034;destination&#034;<\/span>]<br \/>\n    <span class=\"hljs-keyword\">if<\/span> <span class=\"hljs-string\">&#034;\u5317\u4eac&#034;<\/span> <span class=\"hljs-keyword\">in<\/span> destination:<br \/>\n        next_station &#061; <span class=\"hljs-string\">&#034;\u5317\u4eac\u5206\u62e3\u4e2d\u5fc3&#034;<\/span><br \/>\n    <span class=\"hljs-keyword\">elif<\/span> <span class=\"hljs-string\">&#034;\u4e0a\u6d77&#034;<\/span> <span class=\"hljs-keyword\">in<\/span> destination:<br \/>\n        next_station &#061; <span class=\"hljs-string\">&#034;\u4e0a\u6d77\u5206\u62e3\u4e2d\u5fc3&#034;<\/span><br \/>\n    <span class=\"hljs-keyword\">else<\/span>:<br \/>\n        next_station &#061; <span class=\"hljs-string\">&#034;\u5176\u4ed6\u5730\u533a\u5206\u62e3\u4e2d\u5fc3&#034;<\/span><br \/>\n    <span class=\"hljs-keyword\">return<\/span> {<br \/>\n        <span class=\"hljs-string\">&#034;status&#034;<\/span>: <span class=\"hljs-string\">&#034;\u5df2\u5206\u62e3&#034;<\/span>,<br \/>\n        <span class=\"hljs-string\">&#034;history&#034;<\/span>: [<span class=\"hljs-string\">f&#034;\u5206\u62e3\u81f3<span class=\"hljs-subst\">{next_station}<\/span>&#034;<\/span>],<br \/>\n    }<\/p>\n<p><span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">standard_delivery<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n    <span class=\"hljs-string\">&#034;&#034;&#034;\u6807\u51c6\u914d\u9001&#xff1a;\u8fd0\u8f93\u4e2d&#xff0c;\u603b\u91cc\u7a0b 500\u3002&#034;&#034;&#034;<\/span><br \/>\n    <span class=\"hljs-keyword\">return<\/span> {<br \/>\n        <span class=\"hljs-string\">&#034;status&#034;<\/span>: <span class=\"hljs-string\">&#034;\u8fd0\u8f93\u4e2d&#034;<\/span>,<br \/>\n        <span class=\"hljs-string\">&#034;history&#034;<\/span>: [<span class=\"hljs-string\">&#034;\u6807\u51c6\u9646\u8fd0&#034;<\/span>],<br \/>\n        <span class=\"hljs-string\">&#034;total_distance&#034;<\/span>: <span class=\"hljs-number\">500<\/span>,<br \/>\n    }<\/p>\n<p><span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">express_delivery<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n    <span class=\"hljs-string\">&#034;&#034;&#034;\u52a0\u6025\u914d\u9001&#xff1a;\u52a0\u6025\u8fd0\u8f93&#xff0c;\u603b\u91cc\u7a0b 800\u3002&#034;&#034;&#034;<\/span><br \/>\n    <span class=\"hljs-keyword\">return<\/span> {<br \/>\n        <span class=\"hljs-string\">&#034;status&#034;<\/span>: <span class=\"hljs-string\">&#034;\u52a0\u6025\u8fd0\u8f93&#034;<\/span>,<br \/>\n        <span class=\"hljs-string\">&#034;history&#034;<\/span>: [<span class=\"hljs-string\">&#034;\u7a7a\u8fd0\u52a0\u6025&#034;<\/span>],<br \/>\n        <span class=\"hljs-string\">&#034;total_distance&#034;<\/span>: <span class=\"hljs-number\">800<\/span>,<br \/>\n    }<\/p>\n<p><span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">final_delivery<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n    <span class=\"hljs-string\">&#034;&#034;&#034;\u6d3e\u9001\u7ad9&#xff1a;\u66f4\u65b0\u4e3a&#034;\u5df2\u7b7e\u6536&#034;&#xff0c;\u8bb0\u5f55\u9001\u8fbe\u5730\u5740\u3002&#034;&#034;&#034;<\/span><br \/>\n    <span class=\"hljs-keyword\">return<\/span> {<br \/>\n        <span class=\"hljs-string\">&#034;status&#034;<\/span>: <span class=\"hljs-string\">&#034;\u5df2\u7b7e\u6536&#034;<\/span>,<br \/>\n        <span class=\"hljs-string\">&#034;history&#034;<\/span>: [<span class=\"hljs-string\">f&#034;\u5df2\u9001\u8fbe<span class=\"hljs-subst\">{state[<span class=\"hljs-string\">&#039;destination&#039;<\/span>]}<\/span>&#034;<\/span>],<br \/>\n    }<\/p>\n<p><span class=\"hljs-comment\"># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; 4. \u6dfb\u52a0\u914d\u9001\u7ad9\u70b9&#xff08;\u8282\u70b9&#xff09; &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/span><br \/>\ndelivery.add_node(<span class=\"hljs-string\">&#034;\u63fd\u6536\u7ad9&#034;<\/span>, receive_package)<br \/>\ndelivery.add_node(<span class=\"hljs-string\">&#034;\u5206\u62e3\u4e2d\u5fc3&#034;<\/span>, sort_package)          <span class=\"hljs-comment\"># \u6ce8\u610f&#xff1a;\u7edf\u4e00\u4f7f\u7528 &#034;\u5206\u62e3\u4e2d\u5fc3&#034;&#xff08;\u907f\u514d\u5f02\u4f53\u5b57&#xff09;<\/span><br \/>\ndelivery.add_node(<span class=\"hljs-string\">&#034;\u6807\u51c6\u914d\u9001&#034;<\/span>, standard_delivery)<br \/>\ndelivery.add_node(<span class=\"hljs-string\">&#034;\u52a0\u6025\u914d\u9001&#034;<\/span>, express_delivery)<br \/>\ndelivery.add_node(<span class=\"hljs-string\">&#034;\u6d3e\u9001\u7ad9&#034;<\/span>, final_delivery)<\/p>\n<p><span class=\"hljs-comment\"># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; 5. \u8bbe\u8ba1\u914d\u9001\u8def\u7ebf&#xff08;\u8fb9&#xff09; &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/span><br \/>\n<span class=\"hljs-keyword\">def<\/span> <span class=\"function_ hljs-title\">select_delivery<\/span>(<span class=\"hljs-params\">state: PackageState<\/span>):<br \/>\n    <span class=\"hljs-string\">&#034;&#034;&#034;\u667a\u80fd\u8def\u7531&#xff1a;\u6309 priority \u51b3\u5b9a\u8d70\u52a0\u6025\u8fd8\u662f\u6807\u51c6\u914d\u9001\u3002&#034;&#034;&#034;<\/span><br \/>\n    <span class=\"hljs-keyword\">if<\/span> state[<span class=\"hljs-string\">&#034;priority&#034;<\/span>] &#061;&#061; <span class=\"hljs-string\">&#034;\u52a0\u6025&#034;<\/span>:<br \/>\n        <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-string\">&#034;\u52a0\u6025\u914d\u9001&#034;<\/span><br \/>\n    <span class=\"hljs-keyword\">else<\/span>:<br \/>\n        <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-string\">&#034;\u6807\u51c6\u914d\u9001&#034;<\/span><\/p>\n<p><span class=\"hljs-comment\"># \u987a\u5e8f\u8fb9&#xff1a;START \u2192 \u63fd\u6536\u7ad9 \u2192 \u5206\u62e3\u4e2d\u5fc3<\/span><br \/>\ndelivery.add_edge(START, <span class=\"hljs-string\">&#034;\u63fd\u6536\u7ad9&#034;<\/span>)<br \/>\ndelivery.add_edge(<span class=\"hljs-string\">&#034;\u63fd\u6536\u7ad9&#034;<\/span>, <span class=\"hljs-string\">&#034;\u5206\u62e3\u4e2d\u5fc3&#034;<\/span>)<\/p>\n<p><span class=\"hljs-comment\"># \u6761\u4ef6\u8fb9&#xff1a;\u4ece &#034;\u5206\u62e3\u4e2d\u5fc3&#034; \u51fa\u53d1&#xff0c;\u7531 select_delivery \u51b3\u5b9a\u4e0b\u4e00\u6b65<\/span><br \/>\ndelivery.add_conditional_edges(<br \/>\n    <span class=\"hljs-string\">&#034;\u5206\u62e3\u4e2d\u5fc3&#034;<\/span>,                 <span class=\"hljs-comment\"># source&#xff1a;\u8d77\u59cb\u8282\u70b9<\/span><br \/>\n    select_delivery,            <span class=\"hljs-comment\"># path&#xff1a;\u786e\u5b9a\u4e0b\u4e00\u4e2a\u8282\u70b9\u7684\u53ef\u8c03\u7528\u5bf9\u8c61<\/span><br \/>\n    [<span class=\"hljs-string\">&#034;\u52a0\u6025\u914d\u9001&#034;<\/span>, <span class=\"hljs-string\">&#034;\u6807\u51c6\u914d\u9001&#034;<\/span>],    <span class=\"hljs-comment\"># path_map&#xff1a;\u53ef\u80fd\u7684\u8fd4\u56de\u503c\u5217\u8868<\/span><br \/>\n)<\/p>\n<p><span class=\"hljs-comment\"># \u4e24\u6761\u914d\u9001\u8def\u5f84\u90fd\u6c47\u5165\u6d3e\u9001\u7ad9&#xff0c;\u6700\u540e\u7ed3\u675f<\/span><br \/>\ndelivery.add_edge(<span class=\"hljs-string\">&#034;\u6807\u51c6\u914d\u9001&#034;<\/span>, <span class=\"hljs-string\">&#034;\u6d3e\u9001\u7ad9&#034;<\/span>)<br \/>\ndelivery.add_edge(<span class=\"hljs-string\">&#034;\u52a0\u6025\u914d\u9001&#034;<\/span>, <span class=\"hljs-string\">&#034;\u6d3e\u9001\u7ad9&#034;<\/span>)<br \/>\ndelivery.add_edge(<span class=\"hljs-string\">&#034;\u6d3e\u9001\u7ad9&#034;<\/span>, END)<\/p>\n<p><span class=\"hljs-comment\"># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; 6. \u7f16\u8bd1\u7cfb\u7edf &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/span><br \/>\ndelivery_system &#061; delivery.<span class=\"hljs-built_in\">compile<\/span>() <\/p>\n<h4><span style=\"color:#1c7892\">\u6d4b\u8bd5\u4ee3\u7801<\/span><\/h4>\n<p> <span class=\"hljs-comment\"># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; \u6d4b\u8bd5\u914d\u9001 &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/span><br \/>\n<span class=\"hljs-comment\"># \u51c6\u5907\u4e24\u4e2a\u6d4b\u8bd5\u5305\u88f9&#xff0c;\u5206\u522b\u5bf9\u5e94&#034;\u666e\u901a&#034;\u548c&#034;\u52a0\u6025&#034;\u4e24\u79cd\u4f18\u5148\u7ea7<\/span><br \/>\ntest_packages &#061; [<br \/>\n    {<br \/>\n        <span class=\"hljs-string\">&#034;package_id&#034;<\/span>: <span class=\"hljs-string\">&#034;P001&#034;<\/span>,<br \/>\n        <span class=\"hljs-string\">&#034;origin&#034;<\/span>: <span class=\"hljs-string\">&#034;\u5317\u4eac&#034;<\/span>,<br \/>\n        <span class=\"hljs-string\">&#034;destination&#034;<\/span>: <span class=\"hljs-string\">&#034;\u4e0a\u6d77&#034;<\/span>,<br \/>\n        <span class=\"hljs-string\">&#034;priority&#034;<\/span>: <span class=\"hljs-string\">&#034;\u666e\u901a&#034;<\/span>,<br \/>\n        <span class=\"hljs-string\">&#034;history&#034;<\/span>: [],           <span class=\"hljs-comment\"># \u521d\u59cb\u6d41\u8f6c\u5386\u53f2\u4e3a\u7a7a<\/span><br \/>\n        <span class=\"hljs-string\">&#034;total_distance&#034;<\/span>: <span class=\"hljs-number\">0<\/span>,     <span class=\"hljs-comment\"># \u521d\u59cb\u603b\u91cc\u7a0b\u4e3a 0<\/span><br \/>\n    },<br \/>\n    {<br \/>\n        <span class=\"hljs-string\">&#034;package_id&#034;<\/span>: <span class=\"hljs-string\">&#034;P002&#034;<\/span>,<br \/>\n        <span class=\"hljs-string\">&#034;origin&#034;<\/span>: <span class=\"hljs-string\">&#034;\u5e7f\u5dde&#034;<\/span>,<br \/>\n        <span class=\"hljs-string\">&#034;destination&#034;<\/span>: <span class=\"hljs-string\">&#034;\u4e4c\u9c81\u6728\u9f50&#034;<\/span>,<br \/>\n        <span class=\"hljs-string\">&#034;priority&#034;<\/span>: <span class=\"hljs-string\">&#034;\u52a0\u6025&#034;<\/span>,<br \/>\n        <span class=\"hljs-string\">&#034;history&#034;<\/span>: [],<br \/>\n        <span class=\"hljs-string\">&#034;total_distance&#034;<\/span>: <span class=\"hljs-number\">0<\/span>,<br \/>\n    },<br \/>\n]<\/p>\n<p><span class=\"hljs-comment\"># \u904d\u5386\u6bcf\u4e2a\u6d4b\u8bd5\u5305\u88f9&#xff0c;\u8c03\u7528\u7f16\u8bd1\u597d\u7684\u914d\u9001\u7cfb\u7edf&#xff0c;\u6253\u5370\u6700\u7ec8\u72b6\u6001\u3001\u5386\u53f2\u548c\u603b\u91cc\u7a0b<\/span><br \/>\n<span class=\"hljs-keyword\">for<\/span> package <span class=\"hljs-keyword\">in<\/span> test_packages:<br \/>\n    <span class=\"hljs-built_in\">print<\/span>(<span class=\"hljs-string\">f&#034;\\\\n\u914d\u9001\u5305\u88f9: <span class=\"hljs-subst\">{package[<span class=\"hljs-string\">&#039;package_id&#039;<\/span>]}<\/span>&#034;<\/span>)<br \/>\n    result &#061; delivery_system.invoke(package)<br \/>\n    <span class=\"hljs-built_in\">print<\/span>(<span class=\"hljs-string\">&#034;\u6700\u7ec8\u72b6\u6001:&#034;<\/span>, result[<span class=\"hljs-string\">&#034;status&#034;<\/span>])<br \/>\n    <span class=\"hljs-built_in\">print<\/span>(<span class=\"hljs-string\">&#034;\u914d\u9001\u5386\u53f2:&#034;<\/span>, result[<span class=\"hljs-string\">&#034;history&#034;<\/span>])<br \/>\n    <span class=\"hljs-built_in\">print<\/span>(<span class=\"hljs-string\">&#034;\u603b\u91cc\u7a0b:&#034;<\/span>, result[<span class=\"hljs-string\">&#034;total_distance&#034;<\/span>]) <\/p>\n<p>\u9884\u671f\u8fd0\u884c\u7ed3\u679c&#xff1a;<\/p>\n<p> \u914d\u9001\u5305\u88f9: P001<br \/>\n\u6700\u7ec8\u72b6\u6001: \u5df2\u7b7e\u6536<br \/>\n\u914d\u9001\u5386\u53f2: [<span class=\"hljs-string\">&#039;\u5728\u5317\u4eac\u63fd\u6536&#039;<\/span>, <span class=\"hljs-string\">&#039;\u5206\u62e3\u81f3\u4e0a\u6d77\u5206\u62e3\u4e2d\u5fc3&#039;<\/span>, <span class=\"hljs-string\">&#039;\u6807\u51c6\u9646\u8fd0&#039;<\/span>, <span class=\"hljs-string\">&#039;\u5df2\u9001\u8fbe\u4e0a\u6d77&#039;<\/span>]<br \/>\n\u603b\u91cc\u7a0b: <span class=\"hljs-number\">500<\/span><\/p>\n<p>\u914d\u9001\u5305\u88f9: P002<br \/>\n\u6700\u7ec8\u72b6\u6001: \u5df2\u7b7e\u6536<br \/>\n\u914d\u9001\u5386\u53f2: [<span class=\"hljs-string\">&#039;\u5728\u5e7f\u5dde\u63fd\u6536&#039;<\/span>, <span class=\"hljs-string\">&#039;\u5206\u62e3\u81f3\u5176\u4ed6\u5730\u533a\u5206\u62e3\u4e2d\u5fc3&#039;<\/span>, <span class=\"hljs-string\">&#039;\u7a7a\u8fd0\u52a0\u6025&#039;<\/span>, <span class=\"hljs-string\">&#039;\u5df2\u9001\u8fbe\u4e4c\u9c81\u6728\u9f50&#039;<\/span>]<br \/>\n\u603b\u91cc\u7a0b: <span class=\"hljs-number\">800<\/span> <\/p>\n<p>&#x1f4a1; \u6ce8\u610f history \u662f\u8ffd\u52a0\u800c\u975e\u8986\u76d6&#xff08;\u9760 Reducer add&#xff09;&#xff0c;\u6240\u4ee5\u80fd\u770b\u5230\u5b8c\u6574\u7684\u6d41\u8f6c\u94fe\u8def&#xff1b;total_distance \u540c\u7406\u7d2f\u52a0\u3002<\/p>\n<hr \/>\n<h3>\u516d\u3001\u590d\u76d8&#xff08;\u9644\u7b54\u6848&#xff09;<\/h3>\n<h4>&#x1f4a1; \u601d\u8003\u9898<\/h4>\n<li>\n<p>LangChain \u94fe\u5f0f\u7f16\u7a0b\u6709\u4ec0\u4e48\u5c40\u9650\u6027&#xff1f;LangGraph \u5982\u4f55\u89e3\u51b3&#xff1f;<\/p>\n<\/li>\n<li>\n<p>Agent&#xff08;\u667a\u80fd\u4f53&#xff09;\u548c Workflow&#xff08;\u5de5\u4f5c\u6d41&#xff09;\u7684\u533a\u522b\u662f\u4ec0\u4e48&#xff1f;LangGraph \u5b9e\u73b0\u7684\u662f\u54ea\u4e00\u4e2a&#xff1f;<\/p>\n<\/li>\n<li>\n<p>State\u3001Nodes\u3001Edges \u5206\u522b\u662f\u4ec0\u4e48&#xff1f;\u8bf7\u7528\u5feb\u9012\u914d\u9001\u7684\u4f8b\u5b50\u8bf4\u660e\u3002<\/p>\n<\/li>\n<li>\n<p>Reducers \u662f\u4ec0\u4e48&#xff1f;Annotated[list[str], add] \u548c status: str \u5728\u66f4\u65b0\u884c\u4e3a\u4e0a\u6709\u4ec0\u4e48\u533a\u522b&#xff1f;<\/p>\n<\/li>\n<li>\n<p>\u4e3a\u4ec0\u4e48\u56fe\u5fc5\u987b\u5148 compile() \u624d\u80fd\u6267\u884c&#xff1f;\u7f16\u8bd1\u4f1a\u505a\u54ea\u4e9b\u68c0\u67e5&#xff1f;<\/p>\n<\/li>\n<h4>&#x1f4dd; \u7b54\u6848<\/h4>\n<li>\n<p>\u94fe\u5f0f\u6d41\u7a0b\u7ebf\u6027\u4e14\u9884\u5148\u5b9a\u4e49&#xff0c;\u96be\u4ee5\u5904\u7406\u5206\u652f\u3001\u5faa\u73af\u7b49\u590d\u6742\u573a\u666f&#xff1b;\u9047\u5230\u5f02\u5e38\u53ea\u80fd\u76f4\u63a5\u5931\u8d25&#xff0c;\u65e0\u6cd5\u6682\u505c\u7b49\u5f85\u4eba\u5de5\u4ecb\u5165\u3002LangGraph \u7528\u56fe\u5f0f\u7f16\u7a0b\u601d\u7ef4&#xff1a;\u5c06\u6d41\u7a0b\u5efa\u6a21\u4e3a\u56fe&#xff08;\u8282\u70b9 &#043; \u8fb9&#xff09;&#xff0c;\u652f\u6301\u5206\u652f\u3001\u5faa\u73af\u3001\u5e76\u884c\u7b49\u590d\u6742\u63a7\u5236\u6d41&#xff0c;\u5e76\u652f\u6301\u4eba\u5de5\u4ecb\u5165&#xff08;\u8bbe\u7f6e\u65ad\u70b9\u6682\u505c\u3001\u7b49\u4eba\u5de5\u51b3\u7b56\u540e\u7ee7\u7eed&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>Workflow \u8d70\u9884\u8bbe\u7684\u3001\u53ef\u91cd\u590d\u7684\u6d41\u7a0b\u8def\u5f84&#xff08;\u5982\u62a5\u9500\u5ba1\u6279\u3001\u5ba2\u670d\u5de5\u5355&#xff09;&#xff0c;\u9002\u5408\u660e\u786e\u6d41\u7a0b\u7684\u4efb\u52a1&#xff1b;Agent \u7531\u5927\u6a21\u578b\u52a8\u6001\u63a7\u5236\u6d41\u7a0b\u8d70\u5411&#xff0c;\u7075\u6d3b\u5ea6\u9ad8&#xff08;\u5982\u8ba9 AI \u81ea\u5df1\u60f3\u529e\u6cd5\u628a\u5355\u6d4b\u8986\u76d6\u7387\u63d0\u5230 80%&#xff09;\u3002LangGraph \u5b9e\u73b0\u7684\u662f\u5de5\u4f5c\u6d41&#xff08;Workflow&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>State &#061; \u5feb\u9012\u5305\u88f9\u4e0a\u7684\u6807\u7b7e&#xff08;\u8d2f\u7a7f\u5168\u7a0b\u7684\u5171\u4eab\u6570\u636e&#xff0c;\u6240\u6709\u8282\u70b9\u53ef\u8bfb\u53ef\u6539&#xff0c;\u6709\u7ed3\u6784\u5316\u5b57\u6bb5\u5b9a\u4e49&#xff09;&#xff1b;Nodes &#061; \u63fd\u6536\u7ad9\/\u5206\u62e3\u4e2d\u5fc3\/\u6d3e\u9001\u7ad9&#xff08;\u6bcf\u4e2a\u8282\u70b9\u662f\u4e00\u4e2a\u51fd\u6570&#xff0c;\u5355\u4e00\u804c\u8d23&#xff0c;\u63a5\u6536\u72b6\u6001\u3001\u8fd4\u56de\u72b6\u6001\u66f4\u65b0&#xff0c;\u8282\u70b9\u95f4\u4e0d\u76f4\u63a5\u901a\u4fe1&#xff09;&#xff1b;Edges &#061; \u8fd0\u8f93\u8def\u7ebf&#xff08;\u56fa\u5b9a\u8fb9\u5982&#034;\u63fd\u6536\u7ad9\u2192\u5206\u62e3\u4e2d\u5fc3&#034;&#xff0c;\u6761\u4ef6\u8fb9\u5982\u6309\u76ee\u7684\u5730\/\u4f18\u5148\u7ea7\u9009\u62e9\u4e0b\u4e00\u6b65&#xff0c;\u53e6\u6709 START\/END \u7279\u6b8a\u8282\u70b9&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>Reducers \u662f\u72b6\u6001\u66f4\u65b0\u7684\u5173\u952e\u673a\u5236&#xff0c;\u7528 Annotated[\u7c7b\u578b, \u5408\u5e76\u51fd\u6570] \u6307\u5b9a\u5982\u4f55\u5408\u5e76\u65b0\u503c\u3002status: str \u662f\u8986\u76d6\u66f4\u65b0&#xff08;\u65b0\u503c\u66ff\u6362\u65e7\u503c&#xff09;&#xff1b;Annotated[list[str], add] \u662f\u8ffd\u52a0\u66f4\u65b0&#xff08;\u65b0\u8bb0\u5f55\u8ffd\u52a0\u8fdb\u5217\u8868&#xff09;&#xff1b;Annotated[int, add] \u5219\u505a\u6570\u503c\u7d2f\u52a0&#xff08;\u591a\u7ad9\u70b9\u7684\u91cc\u7a0b\u4f1a\u7d2f\u52a0\u800c\u4e0d\u662f\u4e92\u76f8\u8986\u76d6&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u56e0\u4e3a StateGraph \u53ea\u662f\u6784\u5efa\u5668\u7c7b&#xff0c;\u4e0d\u80fd\u76f4\u63a5\u6267\u884c&#xff1b;compile() \u4f1a\u628a\u5b83\u7f16\u8bd1\u6210 CompiledStateGraph&#xff08;\u5b9e\u73b0 Runnable \u63a5\u53e3&#xff0c;\u652f\u6301\u5f02\u6b65\u8c03\u7528\u3001\u6d41\u5f0f\u3001\u6279\u5904\u7406&#xff09;\u3002\u7f16\u8bd1\u65f6\u505a\u7ed3\u6784\u68c0\u67e5&#xff1a;START \u5230\u6240\u6709\u8282\u70b9\u7684\u53ef\u8fbe\u6027\u3001\u6240\u6709\u8282\u70b9\u5230 END \u7684\u53ef\u8fbe\u6027\u3001\u6ca1\u6709\u5b64\u7acb\u8282\u70b9\u6216\u6b7b\u5faa\u73af\u3002<\/p>\n<\/li>\n<hr \/>\n<h3>&#x1f3af; \u95ed\u5e55<\/h3>\n<p>\u200b<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"478\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135702-6aa94eae327e9.jpg\" width=\"355\" \/><span title=\"\u70b9\u51fb\u5e76\u62d6\u62fd\u4ee5\u6539\u53d8\u5c3a\u5bf8\">\u200b<\/span><\/p>\n<p>\u5982\u679c\u672c\u6587\u5bf9\u4f60\u6709\u5e2e\u52a9&#xff0c;\u6b22\u8fce&#xff1a;<\/p>\n<p>&#x1f44d; \u70b9\u8d5e &#xff5c; \u2b50 \u6536\u85cf &#xff5c; &#x1f464; \u5173\u6ce8\u4f5c\u8005 &#xff5c; &#x1f4ac; \u7559\u8a00\u4ea4\u6d41\u4f60\u7684\u7591\u95ee\u6216\u8865\u5145<\/p>\n<p>\u4f60\u7684\u6bcf\u4e00\u6b21\u4e92\u52a8\u90fd\u662f\u6211\u7ee7\u7eed\u66f4\u65b0\u7684\u52a8\u529b&#xff0c;\u6211\u4eec\u4e0b\u4e00\u7bc7\u89c1&#xff01;&#x1f680;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#x1f44b; \u6b22\u8fce\u9605\u8bfb &#x1f525;\u00a0\u613f\u65d6\u65ce\u00a0\u00b7 \u4e2a\u4eba\u4e3b\u9875<br \/>\n&#x1f4d8; \u5b66\u4e60\u4e13\u680f&#xff1a; \u300a\u7b97\u6cd5\u4e13\u680f\u300b\u300aLangChain\u5b66\u4e60\u300b\u300a\u8d2a\u5fc3\u7b97\u6cd5\u300b<br \/>\n&#x1f304; \u94b1\u5858\u6c5f\u4e0a\u6f6e\u4fe1\u6765&#xff0c;\u4eca\u65e5\u65b9\u77e5\u6211\u662f\u6211<br \/>\n\u2728\u5f53\u524d\u5b66\u4e60\u5185\u5bb9&#xff1a;LangGraph<br \/>\n&#x1f4d1; \u76ee\u5f55 \u4e00\u3001\u524d\u7f6e\u8bb2\u89e3  \u4e8c\u3001LangChain \u590d\u76d8\u4e0e LangGraph \u5f15\u5165  \u4e09\u3001LangGraph \u7684\u6838\u5fc3\u6982\u5ff5  \u56db\u3001LangGraph \u5982\u4f55\u5b9e\u73b0\u5de5\u4f5c\u6d41  \u4e94\u3001<\/p>\n","protected":false},"author":2,"featured_media":105690,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11653,53,3503,81,50,371],"topic":[],"class_list":["post-105704","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-11653","tag-ai","tag-langgraph","tag-python","tag-50","tag-371"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010LangGraph\u5b9e\u6218\u3011LangGraph \u5b66\u4e60\u7b14\u8bb0\uff08\u4e00\uff09\uff1a\u4ece\u94fe\u5f0f\u5230\u56fe\u5f0f\uff0c\u7528\u201c\u5feb\u9012\u914d\u9001\u201c\u7406\u89e3\u5de5\u4f5c\u6d41 - \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\/105704.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010LangGraph\u5b9e\u6218\u3011LangGraph \u5b66\u4e60\u7b14\u8bb0\uff08\u4e00\uff09\uff1a\u4ece\u94fe\u5f0f\u5230\u56fe\u5f0f\uff0c\u7528\u201c\u5feb\u9012\u914d\u9001\u201c\u7406\u89e3\u5de5\u4f5c\u6d41 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"&#x1f44b; \u6b22\u8fce\u9605\u8bfb &#x1f525;\u00a0\u613f\u65d6\u65ce\u00a0\u00b7 \u4e2a\u4eba\u4e3b\u9875 &#x1f4d8; \u5b66\u4e60\u4e13\u680f&#xff1a; \u300a\u7b97\u6cd5\u4e13\u680f\u300b\u300aLangChain\u5b66\u4e60\u300b\u300a\u8d2a\u5fc3\u7b97\u6cd5\u300b &#x1f304; \u94b1\u5858\u6c5f\u4e0a\u6f6e\u4fe1\u6765&#xff0c;\u4eca\u65e5\u65b9\u77e5\u6211\u662f\u6211 \u2728\u5f53\u524d\u5b66\u4e60\u5185\u5bb9&#xff1a;LangGraph &#x1f4d1; \u76ee\u5f55 \u4e00\u3001\u524d\u7f6e\u8bb2\u89e3 \u4e8c\u3001LangChain \u590d\u76d8\u4e0e LangGraph \u5f15\u5165 \u4e09\u3001LangGraph \u7684\u6838\u5fc3\u6982\u5ff5 \u56db\u3001LangGraph \u5982\u4f55\u5b9e\u73b0\u5de5\u4f5c\u6d41 \u4e94\u3001\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/105704.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-15T13:57:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135659-6aa94eab4d537.jpg\" \/>\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=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/105704.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/105704.html\",\"name\":\"\u3010LangGraph\u5b9e\u6218\u3011LangGraph \u5b66\u4e60\u7b14\u8bb0\uff08\u4e00\uff09\uff1a\u4ece\u94fe\u5f0f\u5230\u56fe\u5f0f\uff0c\u7528\u201c\u5feb\u9012\u914d\u9001\u201c\u7406\u89e3\u5de5\u4f5c\u6d41 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-15T13:57:03+00:00\",\"dateModified\":\"2026-09-15T13:57:03+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/105704.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/105704.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/105704.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010LangGraph\u5b9e\u6218\u3011LangGraph \u5b66\u4e60\u7b14\u8bb0\uff08\u4e00\uff09\uff1a\u4ece\u94fe\u5f0f\u5230\u56fe\u5f0f\uff0c\u7528\u201c\u5feb\u9012\u914d\u9001\u201c\u7406\u89e3\u5de5\u4f5c\u6d41\"}]},{\"@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":"\u3010LangGraph\u5b9e\u6218\u3011LangGraph \u5b66\u4e60\u7b14\u8bb0\uff08\u4e00\uff09\uff1a\u4ece\u94fe\u5f0f\u5230\u56fe\u5f0f\uff0c\u7528\u201c\u5feb\u9012\u914d\u9001\u201c\u7406\u89e3\u5de5\u4f5c\u6d41 - \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\/105704.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010LangGraph\u5b9e\u6218\u3011LangGraph \u5b66\u4e60\u7b14\u8bb0\uff08\u4e00\uff09\uff1a\u4ece\u94fe\u5f0f\u5230\u56fe\u5f0f\uff0c\u7528\u201c\u5feb\u9012\u914d\u9001\u201c\u7406\u89e3\u5de5\u4f5c\u6d41 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"&#x1f44b; \u6b22\u8fce\u9605\u8bfb &#x1f525;\u00a0\u613f\u65d6\u65ce\u00a0\u00b7 \u4e2a\u4eba\u4e3b\u9875 &#x1f4d8; \u5b66\u4e60\u4e13\u680f&#xff1a; \u300a\u7b97\u6cd5\u4e13\u680f\u300b\u300aLangChain\u5b66\u4e60\u300b\u300a\u8d2a\u5fc3\u7b97\u6cd5\u300b &#x1f304; \u94b1\u5858\u6c5f\u4e0a\u6f6e\u4fe1\u6765&#xff0c;\u4eca\u65e5\u65b9\u77e5\u6211\u662f\u6211 \u2728\u5f53\u524d\u5b66\u4e60\u5185\u5bb9&#xff1a;LangGraph &#x1f4d1; \u76ee\u5f55 \u4e00\u3001\u524d\u7f6e\u8bb2\u89e3 \u4e8c\u3001LangChain \u590d\u76d8\u4e0e LangGraph \u5f15\u5165 \u4e09\u3001LangGraph \u7684\u6838\u5fc3\u6982\u5ff5 \u56db\u3001LangGraph \u5982\u4f55\u5b9e\u73b0\u5de5\u4f5c\u6d41 \u4e94\u3001","og_url":"https:\/\/www.wsisp.com\/helps\/105704.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-15T13:57:03+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915135659-6aa94eab4d537.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/105704.html","url":"https:\/\/www.wsisp.com\/helps\/105704.html","name":"\u3010LangGraph\u5b9e\u6218\u3011LangGraph \u5b66\u4e60\u7b14\u8bb0\uff08\u4e00\uff09\uff1a\u4ece\u94fe\u5f0f\u5230\u56fe\u5f0f\uff0c\u7528\u201c\u5feb\u9012\u914d\u9001\u201c\u7406\u89e3\u5de5\u4f5c\u6d41 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-15T13:57:03+00:00","dateModified":"2026-09-15T13:57:03+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/105704.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/105704.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/105704.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010LangGraph\u5b9e\u6218\u3011LangGraph \u5b66\u4e60\u7b14\u8bb0\uff08\u4e00\uff09\uff1a\u4ece\u94fe\u5f0f\u5230\u56fe\u5f0f\uff0c\u7528\u201c\u5feb\u9012\u914d\u9001\u201c\u7406\u89e3\u5de5\u4f5c\u6d41"}]},{"@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\/105704","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=105704"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/105704\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/105690"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=105704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=105704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=105704"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=105704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}