{"id":93906,"date":"2026-08-13T11:32:48","date_gmt":"2026-08-13T03:32:48","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/93906.html"},"modified":"2026-08-13T11:32:48","modified_gmt":"2026-08-13T03:32:48","slug":"ai-agent%e5%ad%a6%e4%b9%a0-day14%ef%bc%9alanggraph%e8%bf%9b%e9%98%b6-%e6%9d%a1%e4%bb%b6%e5%88%86%e6%94%af%e3%80%81tool-node%e4%b8%8ememory%e6%8c%81%e4%b9%85%e5%8c%96","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/93906.html","title":{"rendered":"AI Agent\u5b66\u4e60 Day14\uff1aLangGraph\u8fdb\u9636 \u2014\u2014 \u6761\u4ef6\u5206\u652f\u3001Tool Node\u4e0eMemory\u6301\u4e45\u5316"},"content":{"rendered":"<h2>\u4e00\u3001\u4eca\u65e5\u5b66\u4e60\u76ee\u6807<\/h2>\n<p>\u5728 Day13 \u4e2d&#xff0c;\u6211\u4eec\u5b66\u4e60\u4e86 LangGraph \u57fa\u7840&#xff1a;<\/p>\n<ul>\n<li>\n<p>State&#xff08;\u72b6\u6001&#xff09;<\/p>\n<\/li>\n<li>\n<p>Node&#xff08;\u8282\u70b9&#xff09;<\/p>\n<\/li>\n<li>\n<p>Edge&#xff08;\u8fb9&#xff09;<\/p>\n<\/li>\n<li>\n<p>Graph&#xff08;\u5de5\u4f5c\u6d41&#xff09;<\/p>\n<\/li>\n<\/ul>\n<p>\u5b9e\u73b0\u4e86\u56fa\u5b9a\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u7528\u6237\u8f93\u5165<\/p>\n<p>\u2193<\/p>\n<p>Search Node<\/p>\n<p>\u2193<\/p>\n<p>Answer Node<\/p>\n<p>\u2193<\/p>\n<p>\u8fd4\u56de\u7ed3\u679c<\/p>\n<p>\u4f46\u662f\u5b9e\u9645\u9879\u76ee\u4e2d\u7684 Agent \u4e0d\u4f1a\u6c38\u8fdc\u6309\u7167\u56fa\u5b9a\u6d41\u7a0b\u6267\u884c\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237\u8f93\u5165&#xff1a;<\/p>\n<p>\u67e5\u8be2\u6f0f\u6d1e\u4fe1\u606f<\/p>\n<p>\u53ef\u80fd\u9700\u8981&#xff1a;<\/p>\n<p>\u7528\u6237<\/p>\n<p>\u2193<\/p>\n<p>\u5206\u6790\u95ee\u9898<\/p>\n<p>\u2193<\/p>\n<p>\u67e5\u8be2\u77e5\u8bc6\u5e93<\/p>\n<p>\u2193<\/p>\n<p>\u751f\u6210\u62a5\u544a<\/p>\n<p>\u7528\u6237\u8f93\u5165&#xff1a;<\/p>\n<p>\u8ba1\u7b97\u98ce\u9669\u8bc4\u5206<\/p>\n<p>\u53ef\u80fd\u9700\u8981&#xff1a;<\/p>\n<p>\u7528\u6237<\/p>\n<p>\u2193<\/p>\n<p>\u5206\u6790\u95ee\u9898<\/p>\n<p>\u2193<\/p>\n<p>\u8c03\u7528\u8ba1\u7b97\u5de5\u5177<\/p>\n<p>\u2193<\/p>\n<p>\u8fd4\u56de\u7ed3\u679c<\/p>\n<p>\u56e0\u6b64\u4eca\u5929\u7ee7\u7eed\u5b66\u4e60 LangGraph \u8fdb\u9636\u80fd\u529b&#xff1a;<\/p>\n<ul>\n<li>\n<p>Conditional Edge&#xff08;\u6761\u4ef6\u5206\u652f&#xff09;<\/p>\n<\/li>\n<li>\n<p>Tool Node&#xff08;\u5de5\u5177\u8282\u70b9&#xff09;<\/p>\n<\/li>\n<li>\n<p>Loop Agent&#xff08;\u5faa\u73afAgent&#xff09;<\/p>\n<\/li>\n<li>\n<p>Memory\u6301\u4e45\u5316<\/p>\n<\/li>\n<\/ul>\n<p>\u76ee\u6807&#xff1a;<\/p>\n<p>\u8ba9 Agent \u4ece\u56fa\u5b9a\u6d41\u7a0b\u5347\u7ea7\u4e3a\u80fd\u591f\u6839\u636e\u4efb\u52a1\u9009\u62e9\u6267\u884c\u8def\u5f84\u7684\u667a\u80fd\u5de5\u4f5c\u6d41\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u3001Conditional Edge&#xff08;\u6761\u4ef6\u8fb9&#xff09;<\/h2>\n<h3>1. \u4e3a\u4ec0\u4e48\u9700\u8981\u6761\u4ef6\u8fb9&#xff1f;<\/h3>\n<p>Day13\u4e2d\u7684\u6d41\u7a0b&#xff1a;<\/p>\n<p>Search Node<\/p>\n<p>\u2193<\/p>\n<p>Answer Node<\/p>\n<p>\u5c5e\u4e8e\u56fa\u5b9a\u6d41\u7a0b\u3002<\/p>\n<p>\u4f46\u662f\u5b9e\u9645 Agent \u9700\u8981\u6839\u636e\u7528\u6237\u8f93\u5165\u5224\u65ad\u4e0b\u4e00\u6b65\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u95ee\u98981&#xff1a;<\/p>\n<p>\u4ec0\u4e48\u662fRAG&#xff1f;<\/p>\n<p>\u6267\u884c&#xff1a;<\/p>\n<p>\u67e5\u8be2\u77e5\u8bc6\u5e93<\/p>\n<p>\u95ee\u98982&#xff1a;<\/p>\n<p>\u8ba1\u7b971&#043;2<\/p>\n<p>\u6267\u884c&#xff1a;<\/p>\n<p>\u8c03\u7528\u8ba1\u7b97\u5de5\u5177<\/p>\n<p>\u6240\u4ee5\u9700\u8981&#xff1a;<\/p>\n<p>\u7528\u6237\u95ee\u9898<\/p>\n<p>\u2193<\/p>\n<p>\u5224\u65ad\u8282\u70b9<\/p>\n<p>\u2193<\/p>\n<p>\u9009\u62e9\u4e0d\u540c\u8def\u5f84<\/p>\n<hr \/>\n<h2>\u4e09\u3001\u4ec0\u4e48\u662f Conditional Edge&#xff1f;<\/h2>\n<p>\u666e\u901a Edge&#xff1a;<\/p>\n<p>A<\/p>\n<p>\u2193<\/p>\n<p>B<\/p>\n<p>\u8868\u793a&#xff1a;<\/p>\n<p>A\u6267\u884c\u5b8c\u6210\u540e&#xff0c;\u4e00\u5b9a\u8fdb\u5165B\u3002<\/p>\n<p>Conditional Edge&#xff1a;<\/p>\n<p>          Router<\/p>\n<p>        \/       \\\\<\/p>\n<p>     Tool      Search<\/p>\n<p>\u8868\u793a&#xff1a;<\/p>\n<p>\u6839\u636e\u6761\u4ef6\u9009\u62e9\u4e0d\u540c\u8282\u70b9\u3002<\/p>\n<hr \/>\n<h2>\u56db\u3001Conditional Edge\u6267\u884c\u6d41\u7a0b<\/h2>\n<p>\u5b8c\u6574\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u7528\u6237\u8f93\u5165<\/p>\n<p>\u2193<\/p>\n<p>Router Node<\/p>\n<p>\u2193<\/p>\n<p>\u5224\u65ad\u4efb\u52a1\u7c7b\u578b<\/p>\n<p>\u2193<\/p>\n<p>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<\/p>\n<p>\u2193<\/p>\n<p>Tool Node<\/p>\n<p>\u6216\u8005<\/p>\n<p>\u2193<\/p>\n<p>Search Node<\/p>\n<p>\u2193<\/p>\n<p>Answer Node<\/p>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<p>Router\u8d1f\u8d23&#xff1a;<\/p>\n<p>\u5224\u65ad\u5e94\u8be5\u8d70\u54ea\u6761\u8def\u7ebf\u3002<\/p>\n<hr \/>\n<h2>\u4e94\u3001\u9879\u76ee\u7ed3\u6784<\/h2>\n<p>Day14\u9879\u76ee\u7ed3\u6784&#xff1a;<\/p>\n<p>day14<\/p>\n<p>\u251c\u2500\u2500 state.py<\/p>\n<p>\u251c\u2500\u2500 nodes.py<\/p>\n<p>\u251c\u2500\u2500 router.py<\/p>\n<p>\u251c\u2500\u2500 tools.py<\/p>\n<p>\u251c\u2500\u2500 graph.py<\/p>\n<p>\u2514\u2500\u2500 agent.py<\/p>\n<p>\u6a21\u5757\u4f5c\u7528&#xff1a;<\/p>\n<table>\n<tr>\u6587\u4ef6\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>state.py<\/td>\n<td>\u5b9a\u4e49Agent\u72b6\u6001<\/td>\n<\/tr>\n<tr>\n<td>router.py<\/td>\n<td>\u5224\u65ad\u6267\u884c\u8def\u7ebf<\/td>\n<\/tr>\n<tr>\n<td>nodes.py<\/td>\n<td>\u5b9a\u4e49\u5de5\u4f5c\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>tools.py<\/td>\n<td>\u5b9a\u4e49\u5de5\u5177<\/td>\n<\/tr>\n<tr>\n<td>graph.py<\/td>\n<td>\u521b\u5efa\u5de5\u4f5c\u6d41<\/td>\n<\/tr>\n<tr>\n<td>agent.py<\/td>\n<td>\u542f\u52a8Agent<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h2>\u516d\u3001State\u72b6\u6001\u8bbe\u8ba1<\/h2>\n<h3>state.py<\/h3>\n<p>\u4ee3\u7801&#xff1a;<\/p>\n<p>from typing import TypedDict<\/p>\n<p>class AgentState(TypedDict):<\/p>\n<p>    question:str<\/p>\n<p>    result:str<\/p>\n<p>    route:str<\/p>\n<p>\u76f8\u6bd4 Day13&#xff1a;<\/p>\n<p>\u65b0\u589e&#xff1a;<\/p>\n<p>route<\/p>\n<p>\u4f5c\u7528&#xff1a;<\/p>\n<p>\u4fdd\u5b58\u5f53\u524d Agent \u5e94\u8be5\u6267\u884c\u7684\u8def\u5f84\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>route&#061;&#034;tool&#034;<\/p>\n<p>\u8868\u793a&#xff1a;<\/p>\n<p>\u8fdb\u5165\u5de5\u5177\u8282\u70b9\u3002<\/p>\n<hr \/>\n<h2>\u4e03\u3001Router\u8282\u70b9<\/h2>\n<h3>router.py<\/h3>\n<p>\u4ee3\u7801&#xff1a;<\/p>\n<p>from state import AgentState<\/p>\n<p>def router_node(state:AgentState):<\/p>\n<p>    question &#061; state[&#034;question&#034;]<\/p>\n<p>    if &#034;\u8ba1\u7b97&#034; in question:<\/p>\n<p>        state[&#034;route&#034;]&#061;&#034;tool&#034;<\/p>\n<p>    else:<\/p>\n<p>        state[&#034;route&#034;]&#061;&#034;search&#034;<\/p>\n<p>    return state<\/p>\n<p>\u4f5c\u7528&#xff1a;<\/p>\n<p>\u5206\u6790\u7528\u6237\u95ee\u9898\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u8f93\u5165&#xff1a;<\/p>\n<p>\u8ba1\u7b971&#043;2<\/p>\n<p>\u8f93\u51fa&#xff1a;<\/p>\n<p>route&#061;&#034;tool&#034;<\/p>\n<p>\u8f93\u5165&#xff1a;<\/p>\n<p>\u4ec0\u4e48\u662fRAG&#xff1f;<\/p>\n<p>\u8f93\u51fa&#xff1a;<\/p>\n<p>route&#061;&#034;search&#034;<\/p>\n<hr \/>\n<h2>\u516b\u3001Tool Node<\/h2>\n<p>\u5728\u4e4b\u524d\u5b66\u4e60\u4e2d&#xff1a;<\/p>\n<p>Tool\u53ea\u662f\u666e\u901a\u51fd\u6570\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>calculator()<\/p>\n<p>\u73b0\u5728&#xff1a;<\/p>\n<p>\u5c06\u5de5\u5177\u52a0\u5165 LangGraph \u5de5\u4f5c\u6d41\u3002<\/p>\n<p>\u53d8\u6210&#xff1a;<\/p>\n<p>Tool Node<\/p>\n<hr \/>\n<h3>tools.py<\/h3>\n<p>\u4ee3\u7801&#xff1a;<\/p>\n<p>def calculator(expression):<\/p>\n<p>    result &#061; eval(expression)<\/p>\n<p>    return result<\/p>\n<hr \/>\n<p>Tool\u8282\u70b9&#xff1a;<\/p>\n<p>def tool_node(state):<\/p>\n<p>    result &#061; calculator(<br \/>\n        &#034;1&#043;2&#034;<br \/>\n    )<\/p>\n<p>    state[&#034;result&#034;]&#061;result<\/p>\n<p>    return state<\/p>\n<p>\u73b0\u5728&#xff1a;<\/p>\n<p>\u5de5\u5177\u6210\u4e3a Agent \u6d41\u7a0b\u4e2d\u7684\u4e00\u4e2a\u8282\u70b9\u3002<\/p>\n<hr \/>\n<h2>\u4e5d\u3001\u521b\u5efa\u6761\u4ef6\u5de5\u4f5c\u6d41<\/h2>\n<h3>graph.py<\/h3>\n<p>\u6838\u5fc3\u4ee3\u7801&#xff1a;<\/p>\n<p>workflow.add_conditional_edges(<\/p>\n<p>    &#034;router&#034;,<\/p>\n<p>    lambda state:state[&#034;route&#034;],<\/p>\n<p>    {<\/p>\n<p>        &#034;tool&#034;:&#034;tool&#034;,<\/p>\n<p>        &#034;search&#034;:&#034;search&#034;<\/p>\n<p>    }<\/p>\n<p>)<\/p>\n<p>\u4f5c\u7528&#xff1a;<\/p>\n<p>\u6839\u636e&#xff1a;<\/p>\n<p>state[&#034;route&#034;]<\/p>\n<p>\u51b3\u5b9a\u4e0b\u4e00\u6b65\u3002<\/p>\n<p>\u5982\u679c&#xff1a;<\/p>\n<p>route&#061;&#034;tool&#034;<\/p>\n<p>\u6267\u884c&#xff1a;<\/p>\n<p>Tool Node<\/p>\n<p>\u5982\u679c&#xff1a;<\/p>\n<p>route&#061;&#034;search&#034;<\/p>\n<p>\u6267\u884c&#xff1a;<\/p>\n<p>Search Node<\/p>\n<hr \/>\n<h2>\u5341\u3001Loop Agent&#xff08;\u5faa\u73afAgent&#xff09;<\/h2>\n<p>\u771f\u5b9e Agent \u5f88\u5c11\u4e00\u6b21\u6267\u884c\u5b8c\u6210\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u4ee3\u7801\u751f\u6210 Agent&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u6b21&#xff1a;<\/p>\n<p>\u751f\u6210\u4ee3\u7801<\/p>\n<p>\u2193<\/p>\n<p>\u6d4b\u8bd5&#xff1a;<\/p>\n<p>\u53d1\u73b0\u9519\u8bef<\/p>\n<p>\u2193<\/p>\n<p>\u4fee\u6539&#xff1a;<\/p>\n<p>\u91cd\u65b0\u751f\u6210<\/p>\n<p>\u2193<\/p>\n<p>\u518d\u6b21\u6d4b\u8bd5\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u5faa\u73af Agent\u3002<\/p>\n<hr \/>\n<h2>\u5341\u4e00\u3001\u5faa\u73afAgent\u6d41\u7a0b<\/h2>\n<p>\u666e\u901a\u6d41\u7a0b&#xff1a;<\/p>\n<p>A<\/p>\n<p>\u2193<\/p>\n<p>B<\/p>\n<p>\u2193<\/p>\n<p>C<\/p>\n<p>\u5faa\u73af\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u751f\u6210<\/p>\n<p>\u2193<\/p>\n<p>\u68c0\u67e5<\/p>\n<p>\u2193<\/p>\n<p>\u662f\u5426\u5b8c\u6210&#xff1f;<\/p>\n<p>   |<\/p>\n<p>   \u251c\u2500\u2500 \u662f \u2192\u7ed3\u675f<\/p>\n<p>   |<\/p>\n<p>   \u2514\u2500\u2500 \u5426 \u2192\u91cd\u65b0\u6267\u884c<\/p>\n<hr \/>\n<h2>\u5341\u4e8c\u3001Memory\u6301\u4e45\u5316<\/h2>\n<p>\u4e4b\u524d State&#xff1a;<\/p>\n<p>\u53ea\u5b58\u5728\u5f53\u524d\u8fd0\u884c\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7a0b\u5e8f\u5173\u95ed&#xff1a;<\/p>\n<p>\u7528\u6237\u4fe1\u606f\u6d88\u5931<\/p>\n<p>\u4f46\u662f\u5b9e\u9645 Agent&#xff1a;<\/p>\n<p>\u9700\u8981\u957f\u671f\u4fdd\u5b58\u4fe1\u606f\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237\u5b66\u4e60\u65b9\u5411&#xff1a;<\/p>\n<p>{<br \/>\n    &#034;interest&#034;:&#034;AI Agent&#034;,<br \/>\n    &#034;level&#034;:&#034;beginner&#034;<br \/>\n}<\/p>\n<p>\u4e0b\u6b21\u542f\u52a8&#xff1a;<\/p>\n<p>Agent\u4ecd\u7136\u77e5\u9053\u3002<\/p>\n<hr \/>\n<h2>\u5341\u4e09\u3001\u7b80\u5355Memory\u5b9e\u73b0<\/h2>\n<p>\u521b\u5efa&#xff1a;<\/p>\n<p>memory.json<\/p>\n<p>\u5185\u5bb9&#xff1a;<\/p>\n<p>{<br \/>\n    &#034;interest&#034;:&#034;AI Agent&#034;,<br \/>\n    &#034;level&#034;:&#034;beginner&#034;<br \/>\n}<\/p>\n<p>\u8bfb\u53d6&#xff1a;<\/p>\n<p>import json<\/p>\n<p>def load_memory():<\/p>\n<p>    with open(<\/p>\n<p>        &#034;memory.json&#034;,<\/p>\n<p>        &#034;r&#034;,<\/p>\n<p>        encoding&#061;&#034;utf-8&#034;<\/p>\n<p>    ) as f:<\/p>\n<p>        return json.load(f)<\/p>\n<hr \/>\n<h2>\u5341\u56db\u3001Day14 Agent\u67b6\u6784<\/h2>\n<p>\u5b8c\u6210\u540e&#xff1a;<\/p>\n<p>                 \u7528\u6237<\/p>\n<p>                  \u2193<\/p>\n<p>             Router Node<\/p>\n<p>             \/        \\\\<\/p>\n<p>        Tool Node    Search Node<\/p>\n<p>             \\\\        \/<\/p>\n<p>             Answer Node<\/p>\n<p>                  \u2193<\/p>\n<p>              Memory\u4fdd\u5b58<\/p>\n<p>\u76f8\u6bd4 Day13&#xff1a;<\/p>\n<p>\u589e\u52a0\u4e86&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5224\u65ad\u80fd\u529b<\/p>\n<\/li>\n<li>\n<p>\u5de5\u5177\u6267\u884c<\/p>\n<\/li>\n<li>\n<p>\u72b6\u6001\u4fdd\u5b58<\/p>\n<\/li>\n<li>\n<p>\u52a8\u6001\u6d41\u7a0b<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h2>\u5341\u4e94\u3001\u4eca\u65e5\u6838\u5fc3\u77e5\u8bc6\u603b\u7ed3<\/h2>\n<h3>1. Conditional Edge<\/h3>\n<p>\u4f5c\u7528&#xff1a;<\/p>\n<p>\u6839\u636e\u72b6\u6001\u9009\u62e9\u4e0d\u540c\u6267\u884c\u8def\u5f84\u3002<\/p>\n<p>\u89e3\u51b3&#xff1a;<\/p>\n<p>Agent\u51b3\u7b56\u95ee\u9898\u3002<\/p>\n<hr \/>\n<h3>2. Tool Node<\/h3>\n<p>\u4f5c\u7528&#xff1a;<\/p>\n<p>\u8ba9\u5de5\u5177\u6210\u4e3a\u5de5\u4f5c\u6d41\u7684\u4e00\u90e8\u5206\u3002<\/p>\n<p>\u5b9e\u73b0&#xff1a;<\/p>\n<p>Agent<\/p>\n<p>\u2193<\/p>\n<p>\u8c03\u7528\u5de5\u5177<\/p>\n<p>\u2193<\/p>\n<p>\u7ee7\u7eed\u6267\u884c<\/p>\n<hr \/>\n<h3>3. Loop Agent<\/h3>\n<p>\u4f5c\u7528&#xff1a;<\/p>\n<p>\u8ba9 Agent \u53ef\u4ee5&#xff1a;<\/p>\n<p>\u6267\u884c<\/p>\n<p>\u2193<\/p>\n<p>\u68c0\u67e5<\/p>\n<p>\u2193<\/p>\n<p>\u8c03\u6574<\/p>\n<p>\u2193<\/p>\n<p>\u518d\u6b21\u6267\u884c\u3002<\/p>\n<hr \/>\n<h3>4. Memory\u6301\u4e45\u5316<\/h3>\n<p>\u4f5c\u7528&#xff1a;<\/p>\n<p>\u8ba9 Agent \u62e5\u6709\u957f\u671f\u8bb0\u5fc6\u3002<\/p>\n<hr \/>\n<h2>\u5341\u516d\u3001Day14\u5b8c\u6210\u6807\u51c6<\/h2>\n<p>\u5b8c\u6210&#xff1a;<\/p>\n<p>\u2705 \u7406\u89e3 Conditional Edge<\/p>\n<p>\u2705 \u5b9e\u73b0 Router Node<\/p>\n<p>\u2705 \u7406\u89e3 Tool Node<\/p>\n<p>\u2705 \u7406\u89e3\u5faa\u73af Agent<\/p>\n<p>\u2705 \u5b9e\u73b0\u7b80\u5355 Memory \u4fdd\u5b58<\/p>\n<p>\u6700\u7ec8\u5b9e\u73b0&#xff1a;<\/p>\n<p>\u7528\u6237\u8f93\u5165<\/p>\n<p>\u2193<\/p>\n<p>Router\u5224\u65ad<\/p>\n<p>\u2193<\/p>\n<p>\u9009\u62e9\u8282\u70b9<\/p>\n<p>\u2193<\/p>\n<p>\u6267\u884c\u4efb\u52a1<\/p>\n<p>\u2193<\/p>\n<p>\u4fdd\u5b58\u7ed3\u679c<\/p>\n<hr \/>\n<h2>\u603b\u7ed3<\/h2>\n<p>Day14\u5b66\u4e60\u7684\u662f LangGraph \u4ece\u201c\u56fa\u5b9a\u6d41\u7a0b\u201d\u5230\u201c\u667a\u80fd\u6d41\u7a0b\u201d\u7684\u5347\u7ea7\u3002<\/p>\n<p>\u901a\u8fc7&#xff1a;<\/p>\n<ul>\n<li>\n<p>Conditional Edge<\/p>\n<\/li>\n<li>\n<p>Tool Node<\/p>\n<\/li>\n<li>\n<p>Loop Agent<\/p>\n<\/li>\n<li>\n<p>Memory\u6301\u4e45\u5316<\/p>\n<\/li>\n<\/ul>\n<p>Agent \u5df2\u7ecf\u5177\u5907&#xff1a;<\/p>\n<p>\u5224\u65ad<\/p>\n<p>\u2193<\/p>\n<p>\u9009\u62e9<\/p>\n<p>\u2193<\/p>\n<p>\u6267\u884c<\/p>\n<p>\u2193<\/p>\n<p>\u4fdd\u5b58<\/p>\n<p>\u4e0b\u4e00\u9636\u6bb5&#xff1a;<\/p>\n<p>Day15&#xff1a;Multi-Agent\u591a\u667a\u80fd\u4f53\u7cfb\u7edf<\/p>\n<p>\u5b66\u4e60&#xff1a;<\/p>\n<ul>\n<li>\n<p>Supervisor Agent<\/p>\n<\/li>\n<li>\n<p>Worker Agent<\/p>\n<\/li>\n<li>\n<p>Agent\u4e4b\u95f4\u901a\u4fe1<\/p>\n<\/li>\n<li>\n<p>\u591a\u89d2\u8272\u534f\u4f5c\u67b6\u6784<\/p>\n<\/li>\n<\/ul>\n<p>\u6784\u5efa\u66f4\u52a0\u63a5\u8fd1\u4f01\u4e1a\u5e94\u7528\u7684 Agent \u7cfb\u7edf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u4eca\u65e5\u5b66\u4e60\u76ee\u6807\u5728 Day13 \u4e2d&#xff0c;\u6211\u4eec\u5b66\u4e60\u4e86 LangGraph \u57fa\u7840&#xff1a;State&#xff08;\u72b6\u6001&#xff09;Node&#xff08;\u8282\u70b9&#xff09;Edge&#xff08;\u8fb9&#xff09;Graph&#xff08;\u5de5\u4f5c\u6d41&#xff09;\u5b9e\u73b0\u4e86\u56fa\u5b9a\u6d41\u7a0b&#xff1a;\u7528\u6237\u8f93\u5165\u2193Search Node\u2193Answer Node\u2193\u8fd4\u56de\u7ed3\u679c\u4f46\u662f\u5b9e\u9645\u9879\u76ee\u4e2d\u7684 Agent \u4e0d\u4f1a\u6c38\u8fdc\u6309\u7167\u56fa\u5b9a\u6d41\u7a0b\u6267\u884c\u3002\u4f8b\u5982&#xff1a;\u7528\u6237\u8f93\u5165&#xff1a;\u67e5<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[50,371],"topic":[],"class_list":["post-93906","post","type-post","status-publish","format-standard","hentry","category-server","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>AI Agent\u5b66\u4e60 Day14\uff1aLangGraph\u8fdb\u9636 \u2014\u2014 \u6761\u4ef6\u5206\u652f\u3001Tool Node\u4e0eMemory\u6301\u4e45\u5316 - \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\/93906.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AI Agent\u5b66\u4e60 Day14\uff1aLangGraph\u8fdb\u9636 \u2014\u2014 \u6761\u4ef6\u5206\u652f\u3001Tool Node\u4e0eMemory\u6301\u4e45\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u4eca\u65e5\u5b66\u4e60\u76ee\u6807\u5728 Day13 \u4e2d&#xff0c;\u6211\u4eec\u5b66\u4e60\u4e86 LangGraph \u57fa\u7840&#xff1a;State&#xff08;\u72b6\u6001&#xff09;Node&#xff08;\u8282\u70b9&#xff09;Edge&#xff08;\u8fb9&#xff09;Graph&#xff08;\u5de5\u4f5c\u6d41&#xff09;\u5b9e\u73b0\u4e86\u56fa\u5b9a\u6d41\u7a0b&#xff1a;\u7528\u6237\u8f93\u5165\u2193Search Node\u2193Answer Node\u2193\u8fd4\u56de\u7ed3\u679c\u4f46\u662f\u5b9e\u9645\u9879\u76ee\u4e2d\u7684 Agent \u4e0d\u4f1a\u6c38\u8fdc\u6309\u7167\u56fa\u5b9a\u6d41\u7a0b\u6267\u884c\u3002\u4f8b\u5982&#xff1a;\u7528\u6237\u8f93\u5165&#xff1a;\u67e5\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/93906.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-13T03:32:48+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/93906.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/93906.html\",\"name\":\"AI Agent\u5b66\u4e60 Day14\uff1aLangGraph\u8fdb\u9636 \u2014\u2014 \u6761\u4ef6\u5206\u652f\u3001Tool Node\u4e0eMemory\u6301\u4e45\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-13T03:32:48+00:00\",\"dateModified\":\"2026-08-13T03:32:48+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/93906.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/93906.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/93906.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI Agent\u5b66\u4e60 Day14\uff1aLangGraph\u8fdb\u9636 \u2014\u2014 \u6761\u4ef6\u5206\u652f\u3001Tool Node\u4e0eMemory\u6301\u4e45\u5316\"}]},{\"@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":"AI Agent\u5b66\u4e60 Day14\uff1aLangGraph\u8fdb\u9636 \u2014\u2014 \u6761\u4ef6\u5206\u652f\u3001Tool Node\u4e0eMemory\u6301\u4e45\u5316 - \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\/93906.html","og_locale":"zh_CN","og_type":"article","og_title":"AI Agent\u5b66\u4e60 Day14\uff1aLangGraph\u8fdb\u9636 \u2014\u2014 \u6761\u4ef6\u5206\u652f\u3001Tool Node\u4e0eMemory\u6301\u4e45\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u4eca\u65e5\u5b66\u4e60\u76ee\u6807\u5728 Day13 \u4e2d&#xff0c;\u6211\u4eec\u5b66\u4e60\u4e86 LangGraph \u57fa\u7840&#xff1a;State&#xff08;\u72b6\u6001&#xff09;Node&#xff08;\u8282\u70b9&#xff09;Edge&#xff08;\u8fb9&#xff09;Graph&#xff08;\u5de5\u4f5c\u6d41&#xff09;\u5b9e\u73b0\u4e86\u56fa\u5b9a\u6d41\u7a0b&#xff1a;\u7528\u6237\u8f93\u5165\u2193Search Node\u2193Answer Node\u2193\u8fd4\u56de\u7ed3\u679c\u4f46\u662f\u5b9e\u9645\u9879\u76ee\u4e2d\u7684 Agent \u4e0d\u4f1a\u6c38\u8fdc\u6309\u7167\u56fa\u5b9a\u6d41\u7a0b\u6267\u884c\u3002\u4f8b\u5982&#xff1a;\u7528\u6237\u8f93\u5165&#xff1a;\u67e5","og_url":"https:\/\/www.wsisp.com\/helps\/93906.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-13T03:32:48+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/93906.html","url":"https:\/\/www.wsisp.com\/helps\/93906.html","name":"AI Agent\u5b66\u4e60 Day14\uff1aLangGraph\u8fdb\u9636 \u2014\u2014 \u6761\u4ef6\u5206\u652f\u3001Tool Node\u4e0eMemory\u6301\u4e45\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-13T03:32:48+00:00","dateModified":"2026-08-13T03:32:48+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/93906.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/93906.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/93906.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"AI Agent\u5b66\u4e60 Day14\uff1aLangGraph\u8fdb\u9636 \u2014\u2014 \u6761\u4ef6\u5206\u652f\u3001Tool Node\u4e0eMemory\u6301\u4e45\u5316"}]},{"@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\/93906","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=93906"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/93906\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=93906"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=93906"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=93906"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=93906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}