{"id":96558,"date":"2026-08-27T21:16:45","date_gmt":"2026-08-27T13:16:45","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/96558.html"},"modified":"2026-08-27T21:16:45","modified_gmt":"2026-08-27T13:16:45","slug":"%e4%bb%8e%e5%90%8e%e7%ab%af%e8%a7%92%e5%ba%a6%e7%90%86%e8%a7%a3-ai-agent%ef%bc%9a%e7%90%86%e8%ae%ba-go-%e5%ae%9e%e6%88%98%ef%bc%88%e9%99%84-mcp-%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%ae%9e%e7%8e%b0%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/96558.html","title":{"rendered":"\u4ece\u540e\u7aef\u89d2\u5ea6\u7406\u89e3 AI Agent\uff1a\u7406\u8bba + Go \u5b9e\u6218\uff08\u9644 MCP \u670d\u52a1\u5668\u5b9e\u73b0\uff09"},"content":{"rendered":"<h2>&#x1f4a1;\u00a0\u672c\u6587\u9002\u5408&#xff1a;\u60f3\u7cfb\u7edf\u7406\u89e3 AI Agent \u7684\u540e\u7aef\u5de5\u7a0b\u5e08&#xff0c;\u5feb\u901f\u641e\u61c2 Agent \u672c\u8d28 &#043; \u638c\u63e1 MCP \u534f\u8bae &#043; \u770b\u61c2\u5de5\u5177\u7cfb\u7edf\u5b9e\u73b0<\/h2>\n<hr \/>\n<h3>\u4e00\u3001\u5148\u8bf4\u7ed3\u8bba&#xff1a;AI Agent \u5230\u5e95\u662f\u4ec0\u4e48<\/h3>\n<p>\u5f88\u591a\u4eba\u7406\u89e3\u9519\u4e86&#xff0c;\u5148\u6765&#034;\u7ea0\u504f&#034;\u3002<\/p>\n<h4>\u274c \u5e38\u89c1\u8bef\u533a<\/h4>\n<table border=\"1\">\n<tbody>\n<tr>\n<td>\n<p>\u9519\u8bef\u7406\u89e3<\/p>\n<\/td>\n<td>\n<p>\u4e3a\u4ec0\u4e48\u9519<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Agent &#061; \u804a\u5929\u673a\u5668\u4eba<\/p>\n<\/td>\n<td>\n<p>\u53ea\u662f\u5bf9\u8bdd&#xff0c;\u6ca1\u6709\u81ea\u4e3b\u51b3\u7b56<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Agent &#061; API \u8c03\u7528\u5668<\/p>\n<\/td>\n<td>\n<p>\u53ea\u662f\u5de5\u5177\u8c03\u7528&#xff0c;\u6ca1\u6709\u89c4\u5212\u80fd\u529b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Agent &#061; LLM<\/p>\n<\/td>\n<td>\n<p>\u6a21\u578b\u53ea\u662f&#034;\u5927\u8111&#034;&#xff0c;Agent \u662f\u5b8c\u6574\u7cfb\u7edf<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u2705 \u6807\u51c6\u5b9a\u4e49<\/h4>\n<p>AI Agent &#061; LLM&#xff08;\u63a8\u7406&#xff09;&#043; \u72b6\u6001\u673a&#xff08;\u63a7\u5236&#xff09;&#043; \u5de5\u5177\u7cfb\u7edf&#xff08;\u6267\u884c&#xff09;&#043; \u8bb0\u5fc6\u7cfb\u7edf&#xff08;\u4e0a\u4e0b\u6587&#xff09;<\/p>\n<p>\u4e00\u53e5\u8bdd\u603b\u7ed3&#xff1a;<\/p>\n<p>Agent \u662f\u4e00\u4e2a&#034;\u4f1a\u7528\u5de5\u5177\u7684\u5faa\u73af\u63a8\u7406\u7cfb\u7edf&#034;&#xff0c;\u7ed3\u5408\u516c\u53f8\u5b9e\u9645\u4e1a\u52a1\u5b9a\u5236\u65b9\u6848<\/p>\n<h4>&#x1f501; \u6838\u5fc3\u8fd0\u884c\u673a\u5236&#xff08;\u6700\u91cd\u8981&#xff01;&#xff09;<\/h4>\n<p>\u57fa\u4e8e\u00a0ReAct \u6a21\u5f0f&#xff0c;\u6838\u5fc3\u5faa\u73af&#xff1a;<\/p>\n<p>\u7528\u6237\u8f93\u5165<br \/>\n  \u2193<br \/>\nThought&#xff08;\u601d\u8003&#xff1a;\u8be5\u600e\u4e48\u505a&#xff1f;&#xff09;<br \/>\n  \u2193<br \/>\nAction&#xff08;\u51b3\u7b56&#xff1a;\u7528\u4ec0\u4e48\u5de5\u5177&#xff1f;&#xff09;<br \/>\n  \u2193<br \/>\nObservation&#xff08;\u89c2\u5bdf&#xff1a;\u5de5\u5177\u8fd4\u56de\u4e86\u4ec0\u4e48&#xff1f;&#xff09;<br \/>\n  \u2193<br \/>\n\u518d\u601d\u8003&#xff08;\u7ed3\u679c\u6ee1\u610f\u5417&#xff1f;\u9700\u8981\u8c03\u6574\u5417&#xff1f;&#xff09;<br \/>\n  \u2193<br \/>\n\u8f93\u51fa\u7ed3\u679c<\/p>\n<p>\u8fd9\u4e2a\u5faa\u73af\u4f1a\u6301\u7eed\u6267\u884c&#xff0c;\u76f4\u5230\u4efb\u52a1\u5b8c\u6210\u6216\u8fbe\u5230\u6700\u5927\u6b65\u6570\u9650\u5236\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001Agent \u5168\u666f\u67b6\u6784&#xff08;5\u5c42\u6a21\u578b&#xff09;<\/h3>\n<p>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502        \u5e94\u7528\u5c42             \u2502  \u2190 \u5ba2\u670d\/\u6570\u636e\u5206\u6790\/\u81ea\u52a8\u5316\u6d41\u7a0b<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502     Agent \u7f16\u6392\u5c42          \u2502  \u2190 \u591a Agent \u534f\u4f5c\/\u6d41\u7a0b\u63a7\u5236<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502     Agent \u6838\u5fc3\u5c42          \u2502  \u2190 Loop\/Planning\/Memory\/Tool<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502     \u6a21\u578b\u63a5\u5165\u5c42            \u2502  \u2190 \u767e\u70bc\/OpenAI\/\u672c\u5730\u6a21\u578b<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502     \u57fa\u7840\u8bbe\u65bd\u5c42            \u2502  \u2190 DB\/Redis\/\u5411\u91cf\u5e93<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<p>\u5173\u952e\u8ba4\u77e5&#xff1a;\u4f60\u8d1f\u8d23\u7684\u662f\u4e2d\u95f4\u4e09\u5c42&#xff08;\u6838\u5fc3\u7ade\u4e89\u529b&#xff09;&#xff0c;\u6a21\u578b\u53ea\u662f&#034;\u80fd\u529b\u6765\u6e90&#034;\u3002<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u6838\u5fc3\u6a21\u5757\u8be6\u89e3&#xff08;\u9644 Go \u4ee3\u7801\u5b9e\u73b0&#xff09;<\/h3>\n<h4>1\ufe0f\u20e3 Agent Loop&#xff08;\u5927\u8111\u5faa\u73af&#xff09;<\/h4>\n<p>\u672c\u8d28&#xff1a;\u4e00\u4e2a\u53ef\u63a7\u7684\u72b6\u6001\u673a<\/p>\n<p>\/\/ \u4f2a\u4ee3\u7801\u793a\u610f<br \/>\nfunc AgentLoop(task Task) Result {<br \/>\n    maxSteps :&#061; 10<br \/>\n    for i :&#061; 0; i &lt; maxSteps; i&#043;&#043; {<br \/>\n        thought :&#061; LLMThink(task.Context)<br \/>\n        action :&#061; DecideAction(thought)<br \/>\n        result :&#061; ExecuteTool(action)<\/p>\n<p>        if IsComplete(result) {<br \/>\n            return result<br \/>\n        }<\/p>\n<p>        task.Context &#061; UpdateContext(task.Context, result)<br \/>\n    }<br \/>\n    return Result{Error: &#034;Max steps exceeded&#034;}<br \/>\n}<\/p>\n<p>\u5de5\u7a0b\u8981\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u5fc5\u987b\u6709\u00a0maxSteps\u00a0\u9650\u5236&#xff08;\u9632\u6b7b\u5faa\u73af&#xff09;<\/li>\n<li>\u5fc5\u987b\u6709\u8d85\u65f6\u63a7\u5236&#xff0c;\u9632\u6b62\u5361\u6b7b\u8981\u6709\u56de\u5e94<\/li>\n<li>\u5fc5\u987b\u6709\u72b6\u6001\u6301\u4e45\u5316&#xff08;\u652f\u6301\u4e2d\u65ad\u6062\u590d&#xff09;<\/li>\n<\/ul>\n<h4>2\ufe0f\u20e3 Tool System&#xff08;\u5de5\u5177\u7cfb\u7edf&#xff09;<\/h4>\n<p>\u8fd9\u662f Agent \u4e4b\u6240\u4ee5\u5f3a\u5927\u7684\u5173\u952e&#xff1a;\u80fd&#034;\u8c03\u7528\u73b0\u5b9e\u4e16\u754c\u7684\u80fd\u529b&#034;\u3002<\/p>\n<p>\u8bbe\u8ba1\u539f\u5219<\/p>\n<p>\/\/ \u5de5\u5177\u63a5\u53e3\u5b9a\u4e49<br \/>\ntype Tool interface {<br \/>\n    Name() string              \/\/ \u5de5\u5177\u540d\u79f0<br \/>\n    Description() string       \/\/ \u529f\u80fd\u63cf\u8ff0&#xff08;LLM \u7406\u89e3\u7528&#xff09;<br \/>\n    InputSchema() InputSchema  \/\/ \u53c2\u6570 Schema&#xff08;JSON Schema \u683c\u5f0f&#xff09;<br \/>\n    Execute(args map[string]interface{}) (*ToolResult, error)<br \/>\n}<\/p>\n<p>\u5b9e\u6218&#xff1a;MCP \u5de5\u5177\u6ce8\u518c\u8868\u5b9e\u73b0<\/p>\n<p>\u5728\u6211\u7684\u9879\u76ee\u00a0chao-go\u00a0\u4e2d&#xff0c;\u5b9e\u73b0\u4e86\u5b8c\u6574\u7684\u5de5\u5177\u6ce8\u518c\u7cfb\u7edf&#xff1a;<\/p>\n<p>\/\/ \u5de5\u5177\u6ce8\u518c\u8868 &#8211; \u6838\u5fc3\u6570\u636e\u7ed3\u6784<br \/>\ntype ToolRegistry struct {<br \/>\n    tools    map[string]Tool        \/\/ \u5de5\u5177\u5b9a\u4e49<br \/>\n    handlers map[string]ToolHandler \/\/ \u5de5\u5177\u5904\u7406\u5668<br \/>\n}<\/p>\n<p>\/\/ \u6ce8\u518c\u5de5\u5177<br \/>\nfunc (r *ToolRegistry) Register(tool Tool, handler ToolHandler) {<br \/>\n    r.tools[tool.Name] &#061; tool<br \/>\n    r.handlers[tool.Name] &#061; handler<br \/>\n}<\/p>\n<p>\u5de5\u5177\u5b9a\u4e49\u793a\u4f8b<\/p>\n<p>\/\/ JSON \u683c\u5f0f\u5316\u5de5\u5177<br \/>\nr.Register(Tool{<br \/>\n    Name:        &#034;json_format&#034;,<br \/>\n    Description: &#034;\u683c\u5f0f\u5316 JSON \u5b57\u7b26\u4e32&#xff0c;\u4f7f\u5176\u66f4\u6613\u8bfb&#034;,<br \/>\n    InputSchema: InputSchema{<br \/>\n        Type: &#034;object&#034;,<br \/>\n        Properties: map[string]Property{<br \/>\n            &#034;input&#034;:  {Type: &#034;string&#034;, Description: &#034;\u8981\u683c\u5f0f\u5316\u7684 JSON \u5b57\u7b26\u4e32&#034;},<br \/>\n            &#034;indent&#034;: {Type: &#034;string&#034;, Description: &#034;\u7f29\u8fdb\u5b57\u7b26&#034;, Default: &#034;  &#034;},<br \/>\n        },<br \/>\n        Required: []string{&#034;input&#034;},<br \/>\n    },<br \/>\n}, func(args map[string]interface{}) (*ToolResult, error) {<br \/>\n    input :&#061; args[&#034;input&#034;].(string)<br \/>\n    \/\/ \u6267\u884c\u683c\u5f0f\u5316\u903b\u8f91&#8230;<br \/>\n    return &amp;ToolResult{Content: []Content{{Type: &#034;text&#034;, Text: formatted}}}, nil<br \/>\n})<\/p>\n<p>\u7c7b\u6bd4\u7406\u89e3&#xff1a;<\/p>\n<table border=\"1\">\n<tbody>\n<tr>\n<td>\n<p>Agent \u6982\u5ff5<\/p>\n<\/td>\n<td>\n<p>Go\/Java \u7406\u89e3<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Tool<\/p>\n<\/td>\n<td>\n<p>\u63a5\u53e3 &#043; \u5b9e\u73b0\u7c7b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ToolRegistry<\/p>\n<\/td>\n<td>\n<p>Bean \u5bb9\u5668 \/ DI \u5bb9\u5668<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ToolHandler<\/p>\n<\/td>\n<td>\n<p>\u7b56\u7565\u6a21\u5f0f\u7684\u5177\u4f53\u7b56\u7565<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>3\ufe0f\u20e3 MCP \u534f\u8bae&#xff08;\u6a21\u578b\u4e0a\u4e0b\u6587\u534f\u8bae&#xff09;<\/h4>\n<p>MCP \u662f\u4ec0\u4e48&#xff1a;Agent \u4e0e\u5de5\u5177\u4e4b\u95f4\u7684&#034;HTTP \u534f\u8bae&#034;<\/p>\n<p>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     MCP      \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502  LLM\/Agent  \u2502 \u2190\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2192  \u2502  MCP Server \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518              \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n                                   \u2502<br \/>\n                                   \u2193<br \/>\n                            \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n                            \u2502   Tools     \u2502<br \/>\n                            \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<p>MCP \u8bf7\u6c42\u683c\u5f0f&#xff08;JSON-RPC 2.0&#xff09;<\/p>\n<p>{<br \/>\n  &#034;jsonrpc&#034;: &#034;2.0&#034;,<br \/>\n  &#034;id&#034;: 1,<br \/>\n  &#034;method&#034;: &#034;tools\/call&#034;,<br \/>\n  &#034;params&#034;: {<br \/>\n    &#034;name&#034;: &#034;json_format&#034;,<br \/>\n    &#034;arguments&#034;: {<br \/>\n      &#034;input&#034;: &#034;{\\\\&#034;name\\\\&#034;:\\\\&#034;test\\\\&#034;}&#034;<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<p>MCP \u54cd\u5e94\u683c\u5f0f<\/p>\n<p>{<br \/>\n  &#034;jsonrpc&#034;: &#034;2.0&#034;,<br \/>\n  &#034;id&#034;: 1,<br \/>\n  &#034;result&#034;: {<br \/>\n    &#034;content&#034;: [<br \/>\n      {<br \/>\n        &#034;type&#034;: &#034;text&#034;,<br \/>\n        &#034;text&#034;: &#034;{\\\\n  \\\\&#034;name\\\\&#034;: \\\\&#034;test\\\\&#034;\\\\n}&#034;<br \/>\n      }<br \/>\n    ]<br \/>\n  }<br \/>\n}<\/p>\n<p>\u5b9e\u6218&#xff1a;Go \u5b9e\u73b0 MCP \u670d\u52a1\u5668<\/p>\n<p>\/\/ MCP \u6d88\u606f\u5904\u7406<br \/>\nfunc (s *Server) HandleMessage(body []byte) *Response {<br \/>\n    var req Request<br \/>\n    json.Unmarshal(body, &amp;req)<\/p>\n<p>    switch req.Method {<br \/>\n    case &#034;initialize&#034;:<br \/>\n        return s.handleInitialize(req)<br \/>\n    case &#034;tools\/list&#034;:<br \/>\n        return s.handleToolsList(req)    \/\/ \u5217\u51fa\u6240\u6709\u5de5\u5177<br \/>\n    case &#034;tools\/call&#034;:<br \/>\n        return s.handleToolsCall(req)    \/\/ \u6267\u884c\u5de5\u5177\u8c03\u7528<br \/>\n    case &#034;ping&#034;:<br \/>\n        return s.handlePing(req)<br \/>\n    default:<br \/>\n        return &amp;Response{Error: ErrMethodNotFound}<br \/>\n    }<br \/>\n}<\/p>\n<p>\/\/ \u5de5\u5177\u8c03\u7528\u6838\u5fc3\u903b\u8f91<br \/>\nfunc (s *Server) handleToolsCall(req Request) *Response {<br \/>\n    var params ToolCallParams<br \/>\n    json.Unmarshal(paramsBytes, &amp;params)<\/p>\n<p>    \/\/ \u4ece\u6ce8\u518c\u8868\u83b7\u53d6\u5904\u7406\u5668<br \/>\n    handler, ok :&#061; s.registry.GetHandler(params.Name)<br \/>\n    if !ok {<br \/>\n        return &amp;Response{Error: &amp;Error{Message: &#034;Tool not found&#034;}}<br \/>\n    }<\/p>\n<p>    \/\/ \u6267\u884c\u5de5\u5177<br \/>\n    result, err :&#061; handler(params.Arguments)<br \/>\n    \/\/ \u8fd4\u56de\u7ed3\u679c&#8230;<br \/>\n}<\/p>\n<h4>4\ufe0f\u20e3 Memory&#xff08;\u8bb0\u5fc6\u7cfb\u7edf&#xff09;<\/h4>\n<p>\u8fd9\u662f 90% \u9879\u76ee\u505a\u4e0d\u597d\u7684\u5730\u65b9<\/p>\n<p>\u4e09\u5c42\u8bb0\u5fc6\u67b6\u6784&#xff1a;<\/p>\n<table border=\"1\">\n<tbody>\n<tr>\n<td>\n<p>\u5c42\u7ea7<\/p>\n<\/td>\n<td>\n<p>\u5b58\u50a8\u65b9\u5f0f<\/p>\n<\/td>\n<td>\n<p>\u7528\u9014<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u77ed\u671f\u8bb0\u5fc6<\/p>\n<\/td>\n<td>\n<p>\u4e0a\u4e0b\u6587\u7a97\u53e3<\/p>\n<\/td>\n<td>\n<p>\u5f53\u524d\u5bf9\u8bdd<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u957f\u671f\u8bb0\u5fc6<\/p>\n<\/td>\n<td>\n<p>Redis\/DB<\/p>\n<\/td>\n<td>\n<p>\u7528\u6237\u5386\u53f2\u884c\u4e3a<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u77e5\u8bc6\u8bb0\u5fc6<\/p>\n<\/td>\n<td>\n<p>\u5411\u91cf\u6570\u636e\u5e93(RAG)<\/p>\n<\/td>\n<td>\n<p>\u9886\u57df\u77e5\u8bc6\u68c0\u7d22<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>RAG \u6d41\u7a0b&#xff1a;<\/p>\n<p>\u7528\u6237\u95ee\u9898 \u2192 \u5411\u91cf\u68c0\u7d22 \u2192 \u627e\u5230\u76f8\u5173\u6587\u6863 \u2192 \u62fc\u5165 Prompt \u2192 LLM \u56de\u7b54<\/p>\n<h4>5\ufe0f\u20e3 Planning&#xff08;\u89c4\u5212\u80fd\u529b&#xff09;<\/h4>\n<p>\u628a\u590d\u6742\u4efb\u52a1\u62c6\u89e3\u4e3a\u5b50\u4efb\u52a1&#xff1a;<\/p>\n<p>\u7528\u6237&#xff1a;\u5206\u6790\u67d0\u516c\u53f8\u80a1\u7968<\/p>\n<p>\u2192 \u89c4\u5212\u4e3a&#xff1a;<br \/>\n  1. \u67e5\u8be2\u8d22\u62a5\u6570\u636e&#xff08;\u8c03\u7528 search_financial_reports \u5de5\u5177&#xff09;<br \/>\n  2. \u8ba1\u7b97\u5173\u952e\u6307\u6807&#xff08;\u8c03\u7528 calculate_ratios \u5de5\u5177&#xff09;<br \/>\n  3. \u751f\u6210\u5206\u6790\u62a5\u544a&#xff08;\u8c03\u7528 generate_report \u5de5\u5177&#xff09;<\/p>\n<p>\u7c7b\u6bd4&#xff1a;\u7c7b\u4f3c\u5de5\u4f5c\u6d41\u5f15\u64ce&#xff08;Flowable \/ Airflow&#xff09;<\/p>\n<hr \/>\n<h3>\u56db\u3001Go \u5de5\u7a0b\u5e08\u843d\u5730\u6307\u5357<\/h3>\n<h4>\u67b6\u6784\u6620\u5c04\u8868<\/h4>\n<table border=\"1\">\n<tbody>\n<tr>\n<td>\n<p>AI \u6982\u5ff5<\/p>\n<\/td>\n<td>\n<p>Go \u5b9e\u73b0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Agent Loop<\/p>\n<\/td>\n<td>\n<p>for &#043; context.Context &#043; timeout<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Tool<\/p>\n<\/td>\n<td>\n<p>interface &#043; struct<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ToolRegistry<\/p>\n<\/td>\n<td>\n<p>map[string]ToolHandler<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Memory<\/p>\n<\/td>\n<td>\n<p>Redis &#043; PostgreSQL<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>RAG<\/p>\n<\/td>\n<td>\n<p>pgvector \/ Elasticsearch<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>MCP<\/p>\n<\/td>\n<td>\n<p>HTTP Server &#043; JSON-RPC<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Planning<\/p>\n<\/td>\n<td>\n<p>\u72b6\u6001\u673a &#043; DAG<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u63a8\u8350\u9879\u76ee\u7ed3\u6784<\/h4>\n<p>cmd\/<br \/>\n  \u2514\u2500\u2500 agent\/           # \u5165\u53e3<br \/>\ninternal\/<br \/>\n  \u251c\u2500\u2500 agent\/           # Agent \u6838\u5fc3<br \/>\n  \u2502   \u251c\u2500\u2500 loop.go      # \u6267\u884c\u5faa\u73af<br \/>\n  \u2502   \u251c\u2500\u2500 planner.go   # \u89c4\u5212\u5668<br \/>\n  \u2502   \u2514\u2500\u2500 memory.go    # \u8bb0\u5fc6\u7ba1\u7406<br \/>\n  \u251c\u2500\u2500 mcp\/             # MCP \u534f\u8bae\u5c42<br \/>\n  \u2502   \u251c\u2500\u2500 server.go    # \u670d\u52a1\u5668<br \/>\n  \u2502   \u251c\u2500\u2500 tools.go     # \u5de5\u5177\u6ce8\u518c<br \/>\n  \u2502   \u2514\u2500\u2500 types.go     # \u7c7b\u578b\u5b9a\u4e49<br \/>\n  \u251c\u2500\u2500 tools\/           # \u5177\u4f53\u5de5\u5177\u5b9e\u73b0<br \/>\n  \u2502   \u251c\u2500\u2500 json.go<br \/>\n  \u2502   \u251c\u2500\u2500 crypto.go<br \/>\n  \u2502   \u2514\u2500\u2500 ai.go<br \/>\n  \u2514\u2500\u2500 llm\/             # \u6a21\u578b\u63a5\u5165<br \/>\n      \u2514\u2500\u2500 client.go<br \/>\npkg\/<br \/>\n  \u2514\u2500\u2500 utils\/           # \u516c\u5171\u5de5\u5177<\/p>\n<h4>\u5e76\u53d1\u4f18\u5316&#xff08;Go \u7684\u4f18\u52bf&#xff09;<\/h4>\n<p>\/\/ \u5e76\u884c\u6267\u884c\u591a\u4e2a\u5de5\u5177<br \/>\nfunc ParallelExecute(tools []ToolCall) []ToolResult {<br \/>\n    var wg sync.WaitGroup<br \/>\n    results :&#061; make([]ToolResult, len(tools))<\/p>\n<p>    for i, tool :&#061; range tools {<br \/>\n        wg.Add(1)<br \/>\n        go func(idx int, t ToolCall) {<br \/>\n            defer wg.Done()<br \/>\n            ctx, cancel :&#061; context.WithTimeout(context.Background(), 30*time.Second)<br \/>\n            defer cancel()<br \/>\n            results[idx] &#061; ExecuteWithContext(ctx, t)<br \/>\n        }(i, tool)<br \/>\n    }<br \/>\n    wg.Wait()<br \/>\n    return results<br \/>\n}<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u6838\u5fc3\u96be\u70b9\u4e0e\u89e3\u51b3\u65b9\u6848<\/h3>\n<h4>\u26a0\ufe0f \u96be\u70b9 1&#xff1a;LLM \u8f93\u51fa\u4e0d\u786e\u5b9a\u6027<\/h4>\n<p>\u95ee\u9898&#xff1a;\u6a21\u578b\u53ef\u80fd\u8fd4\u56de\u683c\u5f0f\u9519\u8bef\u7684 JSON<\/p>\n<p>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<p>\/\/ 1. \u5f3a\u5236 JSON \u8f93\u51fa<br \/>\nprompt :&#061; &#034;\u8bf7\u4ee5 JSON \u683c\u5f0f\u8fd4\u56de\u7ed3\u679c&#xff0c;\u4e0d\u8981\u5305\u542b\u4efb\u4f55\u5176\u4ed6\u6587\u5b57&#034;<\/p>\n<p>\/\/ 2. \u591a\u6b21\u91cd\u8bd5 &#043; \u6821\u9a8c<br \/>\nfunc SafeExecute(prompt string) (Result, error) {<br \/>\n    for i :&#061; 0; i &lt; 3; i&#043;&#043; {<br \/>\n        result :&#061; LLMCall(prompt)<br \/>\n        if ValidateJSON(result) {<br \/>\n            return ParseResult(result)<br \/>\n        }<br \/>\n        prompt &#061; prompt &#043; &#034;\\\\n\u4e0a\u6b21\u8f93\u51fa\u683c\u5f0f\u9519\u8bef&#xff0c;\u8bf7\u4e25\u683c\u8fd4\u56de JSON&#034;<br \/>\n    }<br \/>\n    return Result{}, errors.New(&#034;max retries exceeded&#034;)<br \/>\n}<\/p>\n<h4>\u26a0\ufe0f \u96be\u70b9 2&#xff1a;Token \u6210\u672c<\/h4>\n<p>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<p>\/\/ \u4e0a\u4e0b\u6587\u88c1\u526a &#8211; \u53ea\u4fdd\u7559\u5173\u952e\u4fe1\u606f<br \/>\nfunc TrimContext(history []Message, maxTokens int) []Message {<br \/>\n    \/\/ \u4fdd\u7559\u6700\u8fd1 N \u6761 &#043; \u603b\u7ed3\u5386\u53f2<br \/>\n    recent :&#061; history[len(history)-5:]<br \/>\n    summary :&#061; Summarize(history[:len(history)-5])<br \/>\n    return append([]Message{summary}, recent&#8230;)<br \/>\n}<\/p>\n<h4>\u26a0\ufe0f \u96be\u70b9 3&#xff1a;\u5de5\u5177\u8c03\u7528\u5e7b\u89c9<\/h4>\n<p>\u95ee\u9898&#xff1a;LLM \u53ef\u80fd&#034;\u53d1\u660e&#034;\u4e0d\u5b58\u5728\u7684\u5de5\u5177<\/p>\n<p>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<p>\/\/ \u767d\u540d\u5355\u6821\u9a8c<br \/>\nfunc (r *ToolRegistry) ValidateToolCall(name string) error {<br \/>\n    if _, ok :&#061; r.tools[name]; !ok {<br \/>\n        return fmt.Errorf(&#034;\u5de5\u5177 %s \u4e0d\u5b58\u5728&#xff0c;\u53ef\u7528\u5de5\u5177&#xff1a;%v&#034;, name, r.ListToolNames())<br \/>\n    }<br \/>\n    return nil<br \/>\n}<\/p>\n<h4>\u26a0\ufe0f \u96be\u70b9 4&#xff1a;\u5ef6\u8fdf\u95ee\u9898<\/h4>\n<p>\u89e3\u51b3\u65b9\u6848&#xff1a;\u5f02\u6b65\u5316 &#043; \u6d41\u5f0f\u8f93\u51fa<\/p>\n<p>\/\/ \u6d41\u5f0f\u54cd\u5e94<br \/>\nfunc StreamExecute(ctx context.Context, task Task) &lt;-chan Event {<br \/>\n    events :&#061; make(chan Event, 100)<br \/>\n    go func() {<br \/>\n        defer close(events)<br \/>\n        for step :&#061; range task.Steps {<br \/>\n            result :&#061; ExecuteStep(step)<br \/>\n            events &lt;- Event{Type: &#034;step&#034;, Data: result}<br \/>\n        }<br \/>\n        events &lt;- Event{Type: &#034;complete&#034;, Data: task.Result}<br \/>\n    }()<br \/>\n    return events<br \/>\n}<\/p>\n<hr \/>\n<h3>\u516d\u3001\u5b66\u4e60\u8def\u5f84\u5efa\u8bae<\/h3>\n<h4>\u9636\u6bb5\u4e00&#xff1a;\u7406\u89e3\u672c\u8d28&#xff08;1 \u5468&#xff09;<\/h4>\n<ul>\n<li>\u2705 \u641e\u61c2 ReAct \u5faa\u73af<\/li>\n<li>\u2705 \u7406\u89e3 Tool Calling \u673a\u5236<\/li>\n<li>\u2705 \u5b66\u4e60 MCP \u534f\u8bae\u89c4\u8303<\/li>\n<\/ul>\n<h4>\u9636\u6bb5\u4e8c&#xff1a;\u52a8\u624b\u5b9e\u73b0&#xff08;2 \u5468&#xff09;<\/h4>\n<ul>\n<li>\u2705 \u63a5\u5165\u4e00\u4e2a LLM API&#xff08;\u767e\u70bc\/OpenAI&#xff09;<\/li>\n<li>\u2705 \u5b9e\u73b0\u7b80\u5355 Tool Registry<\/li>\n<li>\u2705 \u5b9e\u73b0\u57fa\u7840 Agent Loop<\/li>\n<\/ul>\n<h4>\u9636\u6bb5\u4e09&#xff1a;\u589e\u5f3a\u80fd\u529b&#xff08;1 \u4e2a\u6708&#xff09;<\/h4>\n<ul>\n<li>\u2705 \u5b9e\u73b0\u8bb0\u5fc6\u7cfb\u7edf<\/li>\n<li>\u2705 \u63a5\u5165\u5411\u91cf\u6570\u636e\u5e93\u5b9e\u73b0 RAG<\/li>\n<li>\u2705 \u5b9e\u73b0\u7b80\u5355 Planning<\/li>\n<\/ul>\n<h4>\u9636\u6bb5\u56db&#xff1a;\u5de5\u7a0b\u5316&#xff08;\u957f\u671f&#xff09;<\/h4>\n<ul>\n<li>\u2705 \u591a Agent \u534f\u4f5c<\/li>\n<li>\u2705 \u76d1\u63a7\u4e0e\u53ef\u89c2\u6d4b\u6027<\/li>\n<li>\u2705 \u8bc4\u6d4b\u4f53\u7cfb&#xff08;Prompt \u56de\u5f52\u6d4b\u8bd5&#xff09;<\/li>\n<\/ul>\n<hr \/>\n<h3>\u4e03\u3001\u603b\u7ed3<\/h3>\n<p>AI Agent \u4e0d\u662f\u4e00\u4e2a\u65b0\u6280\u672f&#xff0c;\u800c\u662f&#xff1a;<\/p>\n<p>LLM&#xff08;\u667a\u80fd&#xff09;&#043; \u8f6f\u4ef6\u5de5\u7a0b&#xff08;\u63a7\u5236&#xff09;&#043; \u7cfb\u7edf\u8bbe\u8ba1&#xff08;\u6269\u5c55&#xff09;<\/p>\n<p>\u4f5c\u4e3a\u540e\u7aef\u5de5\u7a0b\u5e08&#xff0c;\u4f60\u7684\u6838\u5fc3\u4ef7\u503c\u662f&#xff1a;<\/p>\n<p>\u628a&#034;\u4e0d\u7a33\u5b9a\u7684 AI&#034;\u53d8\u6210&#034;\u7a33\u5b9a\u53ef\u63a7\u7684\u7cfb\u7edf&#034;<\/p>\n<p>Go \u8bed\u8a00\u5728 Agent \u5f00\u53d1\u4e2d\u7684\u4f18\u52bf&#xff1a;<\/p>\n<li>\u5e76\u53d1\u80fd\u529b\u5f3a&#xff1a;\u5929\u7136\u9002\u5408\u591a\u5de5\u5177\u5e76\u884c\u6267\u884c<\/li>\n<li>\u90e8\u7f72\u7b80\u5355&#xff1a;\u5355\u4e8c\u8fdb\u5236\u6587\u4ef6&#xff0c;\u65e0\u9700\u8fd0\u884c\u65f6<\/li>\n<li>\u6027\u80fd\u4f18\u5f02&#xff1a;\u4f4e\u5ef6\u8fdf&#xff0c;\u9ad8\u541e\u5410<\/li>\n<li>\u751f\u6001\u6210\u719f&#xff1a;HTTP\/JSON\/\u6570\u636e\u5e93\u5ba2\u6237\u7aef\u5b8c\u5584<\/li>\n<hr \/>\n<h3>\u9644\u5f55&#xff1a;\u5f00\u6e90\u9879\u76ee\u63a8\u8350<\/h3>\n<table border=\"1\">\n<tbody>\n<tr>\n<td>\n<p>\u9879\u76ee<\/p>\n<\/td>\n<td>\n<p>\u8bf4\u660e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>mcp-go<\/p>\n<\/td>\n<td>\n<p>Go MCP SDK<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>langchaingo<\/p>\n<\/td>\n<td>\n<p>Go LangChain \u5b9e\u73b0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>chao-go<\/p>\n<\/td>\n<td>\n<p>\u672c\u6587\u793a\u4f8b\u9879\u76ee&#xff08;MCP \u5de5\u5177\u670d\u52a1\u5668&#xff09;\u6682\u672a\u5f00\u6e90<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p>&#x1f4cc;\u00a0\u53c2\u8003\u8d44\u6e90<\/p>\n<ul>\n<li>MCP \u534f\u8bae\u89c4\u8303<\/li>\n<\/ul>\n<ul>\n<li>Anthropic Agent \u6559\u7a0b<\/li>\n<\/ul>\n<ul>\n<li>ReAct \u8bba\u6587<\/li>\n<\/ul>\n<hr \/>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#x1f4a1;\u00a0\u672c\u6587\u9002\u5408&#xff1a;\u60f3\u7cfb\u7edf\u7406\u89e3 AI Agent \u7684\u540e\u7aef\u5de5\u7a0b\u5e08&#xff0c;\u5feb\u901f\u641e\u61c2 Agent \u672c\u8d28  \u638c\u63e1 MCP \u534f\u8bae  \u770b\u61c2\u5de5\u5177\u7cfb\u7edf\u5b9e\u73b0 \u4e00\u3001\u5148\u8bf4\u7ed3\u8bba&#xff1a;AI Agent \u5230\u5e95\u662f\u4ec0\u4e48<br \/>\n\u5f88\u591a\u4eba\u7406\u89e3\u9519\u4e86&#xff0c;\u5148\u6765\\&#8221;\u7ea0\u504f\\&#8221;\u3002<br \/>\n\u274c \u5e38\u89c1\u8bef\u533a \u9519\u8bef\u7406\u89e3  \u4e3a\u4ec0\u4e48\u9519  Agent  \u804a\u5929\u673a\u5668\u4eba  \u53ea\u662f\u5bf9\u8bdd&#xff0c;\u6ca1\u6709\u81ea\u4e3b\u51b3\u7b56  Agent  API \u8c03\u7528\u5668  \u53ea\u662f\u5de5\u5177\u8c03\u7528&#xff0c;\u6ca1\u6709\u89c4\u5212\u80fd\u529b  Agent  LL<\/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":[53,746,99],"topic":[],"class_list":["post-96558","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai","tag-golang","tag-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4ece\u540e\u7aef\u89d2\u5ea6\u7406\u89e3 AI Agent\uff1a\u7406\u8bba + Go \u5b9e\u6218\uff08\u9644 MCP \u670d\u52a1\u5668\u5b9e\u73b0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/96558.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4ece\u540e\u7aef\u89d2\u5ea6\u7406\u89e3 AI Agent\uff1a\u7406\u8bba + Go \u5b9e\u6218\uff08\u9644 MCP \u670d\u52a1\u5668\u5b9e\u73b0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"&#x1f4a1;\u00a0\u672c\u6587\u9002\u5408&#xff1a;\u60f3\u7cfb\u7edf\u7406\u89e3 AI Agent \u7684\u540e\u7aef\u5de5\u7a0b\u5e08&#xff0c;\u5feb\u901f\u641e\u61c2 Agent \u672c\u8d28 \u638c\u63e1 MCP \u534f\u8bae \u770b\u61c2\u5de5\u5177\u7cfb\u7edf\u5b9e\u73b0 \u4e00\u3001\u5148\u8bf4\u7ed3\u8bba&#xff1a;AI Agent \u5230\u5e95\u662f\u4ec0\u4e48 \u5f88\u591a\u4eba\u7406\u89e3\u9519\u4e86&#xff0c;\u5148\u6765&quot;\u7ea0\u504f&quot;\u3002 \u274c \u5e38\u89c1\u8bef\u533a \u9519\u8bef\u7406\u89e3 \u4e3a\u4ec0\u4e48\u9519 Agent \u804a\u5929\u673a\u5668\u4eba \u53ea\u662f\u5bf9\u8bdd&#xff0c;\u6ca1\u6709\u81ea\u4e3b\u51b3\u7b56 Agent API \u8c03\u7528\u5668 \u53ea\u662f\u5de5\u5177\u8c03\u7528&#xff0c;\u6ca1\u6709\u89c4\u5212\u80fd\u529b Agent LL\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/96558.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-27T13:16:45+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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/96558.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/96558.html\",\"name\":\"\u4ece\u540e\u7aef\u89d2\u5ea6\u7406\u89e3 AI Agent\uff1a\u7406\u8bba + Go \u5b9e\u6218\uff08\u9644 MCP \u670d\u52a1\u5668\u5b9e\u73b0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-27T13:16:45+00:00\",\"dateModified\":\"2026-08-27T13:16:45+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/96558.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/96558.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/96558.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4ece\u540e\u7aef\u89d2\u5ea6\u7406\u89e3 AI Agent\uff1a\u7406\u8bba + Go \u5b9e\u6218\uff08\u9644 MCP \u670d\u52a1\u5668\u5b9e\u73b0\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4ece\u540e\u7aef\u89d2\u5ea6\u7406\u89e3 AI Agent\uff1a\u7406\u8bba + Go \u5b9e\u6218\uff08\u9644 MCP \u670d\u52a1\u5668\u5b9e\u73b0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/96558.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4ece\u540e\u7aef\u89d2\u5ea6\u7406\u89e3 AI Agent\uff1a\u7406\u8bba + Go \u5b9e\u6218\uff08\u9644 MCP \u670d\u52a1\u5668\u5b9e\u73b0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"&#x1f4a1;\u00a0\u672c\u6587\u9002\u5408&#xff1a;\u60f3\u7cfb\u7edf\u7406\u89e3 AI Agent \u7684\u540e\u7aef\u5de5\u7a0b\u5e08&#xff0c;\u5feb\u901f\u641e\u61c2 Agent \u672c\u8d28 \u638c\u63e1 MCP \u534f\u8bae \u770b\u61c2\u5de5\u5177\u7cfb\u7edf\u5b9e\u73b0 \u4e00\u3001\u5148\u8bf4\u7ed3\u8bba&#xff1a;AI Agent \u5230\u5e95\u662f\u4ec0\u4e48 \u5f88\u591a\u4eba\u7406\u89e3\u9519\u4e86&#xff0c;\u5148\u6765\"\u7ea0\u504f\"\u3002 \u274c \u5e38\u89c1\u8bef\u533a \u9519\u8bef\u7406\u89e3 \u4e3a\u4ec0\u4e48\u9519 Agent \u804a\u5929\u673a\u5668\u4eba \u53ea\u662f\u5bf9\u8bdd&#xff0c;\u6ca1\u6709\u81ea\u4e3b\u51b3\u7b56 Agent API \u8c03\u7528\u5668 \u53ea\u662f\u5de5\u5177\u8c03\u7528&#xff0c;\u6ca1\u6709\u89c4\u5212\u80fd\u529b Agent LL","og_url":"https:\/\/www.wsisp.com\/helps\/96558.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-27T13:16:45+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/96558.html","url":"https:\/\/www.wsisp.com\/helps\/96558.html","name":"\u4ece\u540e\u7aef\u89d2\u5ea6\u7406\u89e3 AI Agent\uff1a\u7406\u8bba + Go \u5b9e\u6218\uff08\u9644 MCP \u670d\u52a1\u5668\u5b9e\u73b0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-27T13:16:45+00:00","dateModified":"2026-08-27T13:16:45+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/96558.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/96558.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/96558.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4ece\u540e\u7aef\u89d2\u5ea6\u7406\u89e3 AI Agent\uff1a\u7406\u8bba + Go \u5b9e\u6218\uff08\u9644 MCP \u670d\u52a1\u5668\u5b9e\u73b0\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/96558","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=96558"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/96558\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=96558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=96558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=96558"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=96558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}