{"id":100248,"date":"2026-09-04T09:08:49","date_gmt":"2026-09-04T01:08:49","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/100248.html"},"modified":"2026-09-04T09:08:49","modified_gmt":"2026-09-04T01:08:49","slug":"%e7%ac%ac4%e8%ae%b2%ef%bc%9a%e8%ae%b0%e5%bf%86%e5%b1%82-%e8%ae%a9-agent-%e4%b8%8d%e5%81%a5%e5%bf%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/100248.html","title":{"rendered":"\u7b2c4\u8bb2\uff1a\u8bb0\u5fc6\u5c42\u2014\u2014\u8ba9 Agent \u4e0d\u5065\u5fd8"},"content":{"rendered":"<h3><\/h3>\n<hr \/>\n<h4>\u4e00\u3001\u4e00\u4e2a\u5c34\u5c2c\u7684\u573a\u666f<\/h4>\n<p>\u4f60\u548c Agent \u5bf9\u8bdd&#xff1a;<\/p>\n<p>\u4f60&#xff1a;&#034;\u6211\u53eb\u5f20\u4e09&#xff0c;\u662f\u4e00\u540d\u540e\u7aef\u5f00\u53d1\u8005&#xff0c;\u4e3b\u8981\u7528 Go\u3002&#034;<\/p>\n<p>Agent&#xff1a;&#034;\u597d\u7684&#xff0c;\u5f20\u4e09&#xff0c;\u6211\u8bb0\u4f4f\u4e86\u3002&#034;<\/p>\n<p>\u4f60&#xff1a;&#034;\u5e2e\u6211\u770b\u770b\u6211\u7684\u9879\u76ee\u91cc\u6709\u6ca1\u6709\u5185\u5b58\u6cc4\u6f0f\u3002&#034;<\/p>\n<p>Agent \u5f00\u59cb\u5206\u6790\u4ee3\u7801&#8230;<\/p>\n<p>\u4f60&#xff1a;&#034;\u987a\u4fbf\u95ee\u4e00\u4e0b&#xff0c;\u6211\u53eb\u4ec0\u4e48\u540d\u5b57&#xff1f;&#034;<\/p>\n<p>Agent&#xff1a;&#034;\u62b1\u6b49&#xff0c;\u6211\u4e0d\u77e5\u9053\u60a8\u7684\u540d\u5b57\u3002\u8bf7\u95ee\u60a8\u600e\u4e48\u79f0\u547c&#xff1f;&#034;<\/p>\n<p>\u8fd9\u5c31\u662f\u6ca1\u6709\u8bb0\u5fc6\u7684 Agent\u2014\u2014\u6bcf\u6b21\u5bf9\u8bdd\u90fd\u662f\u4e00\u5f20\u767d\u7eb8\u3002<\/p>\n<hr \/>\n<h4>\u4e8c\u3001Agent \u7684\u8bb0\u5fc6\u5206\u5c42<\/h4>\n<p>\u4eba\u7684\u8bb0\u5fc6\u5206\u4e09\u5c42&#xff1a;\u5de5\u4f5c\u8bb0\u5fc6\u3001\u77ed\u671f\u8bb0\u5fc6\u3001\u957f\u671f\u8bb0\u5fc6\u3002Agent \u4e5f\u4e00\u6837\u3002<\/p>\n<table>\n<tr>\n<p>\u5c42\u7ea7<\/p>\n<p>\u4eba\u7c7b\u7c7b\u6bd4<\/p>\n<p>Agent \u5b9e\u73b0<\/p>\n<p>\u5b58\u50a8\u4f4d\u7f6e<\/p>\n<p>\u6301\u4e45\u6027<\/p>\n<\/tr>\n<tbody>\n<tr>\n<td>\n<p>L1 \u4e0a\u4e0b\u6587\u7a97\u53e3\u200b<\/p>\n<\/td>\n<td>\n<p>\u5de5\u4f5c\u8bb0\u5fc6<\/p>\n<\/td>\n<td>\n<p>\u5f53\u524d\u5bf9\u8bdd\u7684\u5168\u90e8\u6d88\u606f<\/p>\n<\/td>\n<td>\n<p>LLM \u4e0a\u4e0b\u6587<\/p>\n<\/td>\n<td>\n<p>\u5bf9\u8bdd\u7ed3\u675f\u5373\u5931<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>L2 \u4f1a\u8bdd\u8bb0\u5fc6\u200b<\/p>\n<\/td>\n<td>\n<p>\u77ed\u671f\u8bb0\u5fc6<\/p>\n<\/td>\n<td>\n<p>\u5f53\u524d\u4f1a\u8bdd\u7684\u5173\u952e\u4e8b\u5b9e<\/p>\n<\/td>\n<td>\n<p>\u5185\u5b58 \/ Redis<\/p>\n<\/td>\n<td>\n<p>\u4f1a\u8bdd\u7ed3\u675f\u540e\u5931\u6548<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>L3 \u957f\u671f\u8bb0\u5fc6\u200b<\/p>\n<\/td>\n<td>\n<p>\u957f\u671f\u8bb0\u5fc6<\/p>\n<\/td>\n<td>\n<p>\u8de8\u4f1a\u8bdd\u7684\u7528\u6237\u753b\u50cf\u3001\u77e5\u8bc6<\/p>\n<\/td>\n<td>\n<p>\u5411\u91cf\u6570\u636e\u5e93 \/ \u5173\u7cfb\u6570\u636e\u5e93<\/p>\n<\/td>\n<td>\n<p>\u6c38\u4e45\u4fdd\u5b58<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h4>\u4e09\u3001L1&#xff1a;\u4e0a\u4e0b\u6587\u7a97\u53e3\u2014\u2014\u6700\u57fa\u7840\u7684\u8bb0\u5fc6<\/h4>\n<p>\u8fd9\u662f\u6bcf\u4e2a LLM \u5929\u7136\u5177\u5907\u7684&#034;\u8bb0\u5fc6&#034;\u80fd\u529b\u2014\u2014\u5b83\u80fd\u770b\u5230\u5f53\u524d\u5bf9\u8bdd\u4e2d\u7684\u6240\u6709\u6d88\u606f\u3002<\/p>\n<h5>3.1 \u7a97\u53e3\u5927\u5c0f<\/h5>\n<table>\n<tr>\n<p>\u6a21\u578b<\/p>\n<p>\u4e0a\u4e0b\u6587\u7a97\u53e3<\/p>\n<p>\u7ea6\u7b49\u4e8e\u591a\u5c11\u6c49\u5b57<\/p>\n<\/tr>\n<tbody>\n<tr>\n<td>\n<p>GPT-5<\/p>\n<\/td>\n<td>\n<p>256K tokens<\/p>\n<\/td>\n<td>\n<p>~17 \u4e07\u5b57<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Claude Opus<\/p>\n<\/td>\n<td>\n<p>200K tokens<\/p>\n<\/td>\n<td>\n<p>~13 \u4e07\u5b57<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>DeepSeek-V3<\/p>\n<\/td>\n<td>\n<p>128K tokens<\/p>\n<\/td>\n<td>\n<p>~8.5 \u4e07\u5b57<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Gemini 2.0<\/p>\n<\/td>\n<td>\n<p>1M tokens<\/p>\n<\/td>\n<td>\n<p>~67 \u4e07\u5b57<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5>3.2 \u7a97\u53e3\u6ee1\u4e86\u600e\u4e48\u529e<\/h5>\n<p>\u5f53\u5bf9\u8bdd\u592a\u957f\u8d85\u51fa\u4e0a\u4e0b\u6587\u7a97\u53e3&#xff0c;\u6709\u4e09\u79cd\u7b56\u7565&#xff1a;<\/p>\n<p>\u7b56\u7565\u4e00&#xff1a;\u6ed1\u52a8\u7a97\u53e3&#xff08;Sliding Window&#xff09;<\/p>\n<p>\u4fdd\u7559\u6700\u8fd1\u7684 N \u6761\u6d88\u606f&#xff0c;\u4e22\u5f03\u6700\u65e9\u7684\u6d88\u606f\u3002<\/p>\n<p>[\u6d88\u606f1] \u7528\u6237&#xff1a;\u6211\u53eb\u5f20\u4e09<br \/>\n[\u6d88\u606f2] \u52a9\u624b&#xff1a;\u4f60\u597d\u5f20\u4e09<br \/>\n[\u6d88\u606f3] \u7528\u6237&#xff1a;\u5e2e\u6211\u67e5\u5929\u6c14<br \/>\n[\u6d88\u606f4] \u52a9\u624b&#xff1a;\u5317\u4eac\u6674<br \/>\n&#8230;<br \/>\n[\u6d88\u606f99] \u7528\u6237&#xff1a;\u6211\u53eb\u4ec0\u4e48\u540d\u5b57&#xff1f;<br \/>\n[\u6d88\u606f100] \u52a9\u624b&#xff1a;&#xff1f;&#xff1f;&#xff1f;&#xff08;\u56e0\u4e3a\u6d88\u606f1\u5df2\u88ab\u4e22\u5f03&#xff09;<\/p>\n<p>\u4f18\u70b9&#xff1a;\u5b9e\u73b0\u7b80\u5355<\/p>\n<p>\u7f3a\u70b9&#xff1a;\u4e22\u5931\u65e9\u671f\u5173\u952e\u4fe1\u606f<\/p>\n<p>\u7b56\u7565\u4e8c&#xff1a;\u6458\u8981\u538b\u7f29&#xff08;Summarization&#xff09;<\/p>\n<p>\u5f53\u7a97\u53e3\u5373\u5c06\u6ee1\u65f6&#xff0c;\u628a\u65e9\u671f\u6d88\u606f\u538b\u7f29\u6210\u4e00\u6bb5\u6458\u8981\u3002<\/p>\n<p>[\u6458\u8981] \u7528\u6237\u53eb\u5f20\u4e09&#xff0c;\u540e\u7aef\u5f00\u53d1\u8005&#xff0c;\u6b63\u5728\u505a\u4e00\u4e2a\u7535\u5546\u9879\u76ee\u3002<br \/>\n[\u6d88\u606f50] \u7528\u6237&#xff1a;\u5e2e\u6211\u770b\u770b\u8ba2\u5355\u670d\u52a1\u7684\u4ee3\u7801<br \/>\n[\u6d88\u606f51] \u52a9\u624b&#xff1a;\u597d\u7684&#xff0c;\u6b63\u5728\u5206\u6790&#8230;<\/p>\n<p>\u4f18\u70b9&#xff1a;\u4fdd\u7559\u5173\u952e\u4fe1\u606f<\/p>\n<p>\u7f3a\u70b9&#xff1a;\u6458\u8981\u53ef\u80fd\u4e22\u5931\u7ec6\u8282&#xff1b;\u6458\u8981\u672c\u8eab\u4e5f\u5360 token<\/p>\n<p>\u7b56\u7565\u4e09&#xff1a;\u7ed3\u6784\u5316\u8bb0\u5fc6&#xff08;Structured Memory&#xff09;<\/p>\n<p>\u628a\u5173\u952e\u4fe1\u606f\u63d0\u53d6\u6210\u7ed3\u6784\u5316\u6570\u636e&#xff0c;\u5b58\u5728\u4e0a\u4e0b\u6587\u4e4b\u5916\u3002<br \/>\n\u53ea\u5728\u9700\u8981\u65f6\u6ce8\u5165\u56de\u4e0a\u4e0b\u6587\u3002<\/p>\n<p>{<br \/>\n  &#034;user_profile&#034;: {<br \/>\n    &#034;name&#034;: &#034;\u5f20\u4e09&#034;,<br \/>\n    &#034;role&#034;: &#034;\u540e\u7aef\u5f00\u53d1\u8005&#034;,<br \/>\n    &#034;tech_stack&#034;: [&#034;Go&#034;, &#034;PostgreSQL&#034;],<br \/>\n    &#034;project&#034;: &#034;\u7535\u5546\u5e73\u53f0&#034;<br \/>\n  },<br \/>\n  &#034;conversation_state&#034;: {<br \/>\n    &#034;current_topic&#034;: &#034;\u8ba2\u5355\u670d\u52a1\u4ee3\u7801\u5ba1\u67e5&#034;,<br \/>\n    &#034;files_reviewed&#034;: [&#034;internal\/order\/service.go&#034;],<br \/>\n    &#034;pending_actions&#034;: [&#034;\u68c0\u67e5\u5185\u5b58\u6cc4\u6f0f&#034;]<br \/>\n  }<br \/>\n}<\/p>\n<p>\u4f18\u70b9&#xff1a;\u7cbe\u786e\u3001\u8282\u7701 token<\/p>\n<p>\u7f3a\u70b9&#xff1a;\u9700\u8981\u989d\u5916\u7684\u63d0\u53d6\u903b\u8f91<\/p>\n<hr \/>\n<h4>\u56db\u3001L2&#xff1a;\u4f1a\u8bdd\u8bb0\u5fc6\u2014\u2014\u8ba9 Agent \u8bb0\u5f97\u4f4f&#034;\u521a\u624d\u7684\u4e8b&#034;<\/h4>\n<p>\u4f1a\u8bdd\u8bb0\u5fc6\u662f Agent \u5728\u5f53\u524d\u5bf9\u8bdd\u4e2d\u63d0\u53d6\u548c\u7ef4\u62a4\u7684\u5173\u952e\u4e8b\u5b9e\u3002<\/p>\n<h5>4.1 \u5b9e\u73b0\u65b9\u5f0f<\/h5>\n<p>type SessionMemory struct {<br \/>\n    sessionID string<br \/>\n    facts     map[string]string  \/\/ key-value \u4e8b\u5b9e\u5b58\u50a8<br \/>\n    history   []Message          \/\/ \u5bf9\u8bdd\u5386\u53f2\u6458\u8981<br \/>\n}<\/p>\n<p>func (sm *SessionMemory) ExtractFacts(message string) {<br \/>\n    \/\/ \u8c03\u7528 LLM \u4ece\u6d88\u606f\u4e2d\u63d0\u53d6\u4e8b\u5b9e<br \/>\n    \/\/ &#034;\u6211\u53eb\u5f20\u4e09&#034; \u2192 {&#034;user.name&#034;: &#034;\u5f20\u4e09&#034;}<br \/>\n    \/\/ &#034;\u6211\u7528 Go \u5f00\u53d1&#034; \u2192 {&#034;user.tech_stack&#034;: &#034;Go&#034;}<br \/>\n}<\/p>\n<p>func (sm *SessionMemory) GetFact(key string) (string, bool) {<br \/>\n    val, ok :&#061; sm.facts[key]<br \/>\n    return val, ok<br \/>\n}<\/p>\n<p>func (sm *SessionMemory) InjectContext() string {<br \/>\n    \/\/ \u628a\u8bb0\u5fc6\u6ce8\u5165\u5230\u7cfb\u7edf\u63d0\u793a\u8bcd\u4e2d<br \/>\n    return fmt.Sprintf(&#034;\u7528\u6237\u4fe1\u606f&#xff1a;\u59d3\u540d %s&#xff0c;\u6280\u672f\u6808 %s&#034;,<br \/>\n        sm.facts[&#034;user.name&#034;], sm.facts[&#034;user.tech_stack&#034;])<br \/>\n}<\/p>\n<h5>4.2 \u4e8b\u5b9e\u63d0\u53d6\u7684\u7b56\u7565<\/h5>\n<p>\u4e0d\u662f\u6240\u6709\u4fe1\u606f\u90fd\u503c\u5f97\u8bb0\u4f4f\u3002\u597d\u7684 Agent \u4f1a\u5224\u65ad&#xff1a;<\/p>\n<p>\u503c\u5f97\u8bb0\u4f4f\u7684\u4fe1\u606f&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7528\u6237\u7684\u8eab\u4efd\u4fe1\u606f&#xff08;\u59d3\u540d\u3001\u804c\u4f4d\u3001\u516c\u53f8&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u7528\u6237\u7684\u504f\u597d&#xff08;&#034;\u6211\u4e0d\u559c\u6b22 Python&#034;\u3001&#034;\u6211\u559c\u6b22\u7b80\u6d01\u7684\u4ee3\u7801&#034;&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u6b63\u5728\u8fdb\u884c\u4e2d\u7684\u4efb\u52a1&#xff08;&#034;\u6211\u5728\u91cd\u6784\u8ba2\u5355\u6a21\u5757&#034;&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u91cd\u8981\u7684\u7ea6\u5b9a&#xff08;&#034;\u4e0b\u5348\u4e09\u70b9\u5f00\u4f1a&#034;&#xff09;<\/p>\n<\/li>\n<\/ul>\n<p>\u4e0d\u503c\u5f97\u8bb0\u4f4f\u7684\u4fe1\u606f&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u4e34\u65f6\u7684\u95f2\u804a&#xff08;&#034;\u4eca\u5929\u5929\u6c14\u4e0d\u9519&#034;&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u4e00\u6b21\u6027\u7684\u8bf7\u6c42&#xff08;&#034;\u5e2e\u6211\u7b97\u4e00\u4e0b 123 * 456&#034;&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u60c5\u7eea\u5316\u7684\u8868\u8fbe&#xff08;&#034;\u6c14\u6b7b\u6211\u4e86&#034;&#xff09;<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h4>\u4e94\u3001L3&#xff1a;\u957f\u671f\u8bb0\u5fc6\u2014\u2014\u8de8\u4f1a\u8bdd\u7684 Agent \u5927\u8111<\/h4>\n<p>\u957f\u671f\u8bb0\u5fc6\u8ba9 Agent \u80fd\u5728\u4e0d\u540c\u4f1a\u8bdd\u4e4b\u95f4\u8bb0\u4f4f\u7528\u6237\u3002\u8fd9\u662f Agent \u771f\u6b63\u53d8\u5f97&#034;\u61c2\u4f60&#034;\u7684\u5173\u952e\u3002<\/p>\n<h5>5.1 \u5b58\u50a8\u9009\u578b<\/h5>\n<table>\n<tr>\n<p>\u5b58\u50a8\u65b9\u6848<\/p>\n<p>\u9002\u7528\u573a\u666f<\/p>\n<p>\u4f18\u70b9<\/p>\n<p>\u7f3a\u70b9<\/p>\n<\/tr>\n<tbody>\n<tr>\n<td>\n<p>\u5411\u91cf\u6570\u636e\u5e93<\/p>\n<\/td>\n<td>\n<p>\u8bed\u4e49\u641c\u7d22\u3001\u76f8\u4f3c\u5ea6\u5339\u914d<\/p>\n<\/td>\n<td>\n<p>\u7075\u6d3b\u3001\u652f\u6301\u6a21\u7cca\u68c0\u7d22<\/p>\n<\/td>\n<td>\n<p>\u9700\u8981 embedding \u6a21\u578b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u5173\u7cfb\u6570\u636e\u5e93<\/p>\n<\/td>\n<td>\n<p>\u7ed3\u6784\u5316\u4e8b\u5b9e<\/p>\n<\/td>\n<td>\n<p>\u7cbe\u786e\u3001\u4e8b\u52a1\u652f\u6301<\/p>\n<\/td>\n<td>\n<p>\u4e0d\u652f\u6301\u8bed\u4e49\u641c\u7d22<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Redis<\/p>\n<\/td>\n<td>\n<p>\u9ad8\u9891\u8bbf\u95ee\u7684\u77ed\u671f\u4e8b\u5b9e<\/p>\n<\/td>\n<td>\n<p>\u6781\u5feb<\/p>\n<\/td>\n<td>\n<p>\u6301\u4e45\u5316\u9700\u989d\u5916\u914d\u7f6e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u6587\u4ef6\u7cfb\u7edf<\/p>\n<\/td>\n<td>\n<p>\u5c0f\u578b\u9879\u76ee\u3001\u539f\u578b<\/p>\n<\/td>\n<td>\n<p>\u96f6\u4f9d\u8d56<\/p>\n<\/td>\n<td>\n<p>\u4e0d\u9002\u5408\u5927\u89c4\u6a21<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5>5.2 \u5411\u91cf\u6570\u636e\u5e93\u7684\u5de5\u4f5c\u6d41\u7a0b<\/h5>\n<p>Step 1: \u63d0\u53d6\u4e8b\u5b9e \u2192 &#034;\u7528\u6237\u5f20\u4e09&#xff0c;\u540e\u7aef\u5f00\u53d1\u8005&#xff0c;\u6280\u672f\u6808 Go&#034;<br \/>\nStep 2: \u751f\u6210\u5411\u91cf \u2192 [0.12, 0.87, 0.33, &#8230;] (768\u7ef4)<br \/>\nStep 3: \u5b58\u5165\u5411\u91cf\u5e93 \u2192 \u5173\u8054 user_id&#061;10086<br \/>\nStep 4: \u65b0\u4f1a\u8bdd\u5f00\u59cb\u65f6 \u2192 \u7528 user_id \u68c0\u7d22\u76f8\u5173\u8bb0\u5fc6<br \/>\nStep 5: \u53ec\u56de\u6700\u76f8\u5173\u7684 K \u6761\u8bb0\u5fc6 \u2192 \u6ce8\u5165\u4e0a\u4e0b\u6587<\/p>\n<h5>5.3 \u8bb0\u5fc6\u7684\u65f6\u6548\u6027<\/h5>\n<p>\u4e0d\u662f\u6240\u6709\u8bb0\u5fc6\u90fd\u6c38\u8fdc\u6709\u6548\u3002\u9700\u8981\u5f15\u5165\u8870\u51cf\u673a\u5236&#xff1a;<\/p>\n<p>type MemoryItem struct {<br \/>\n    Key       string<br \/>\n    Value     string<br \/>\n    CreatedAt time.Time<br \/>\n    AccessedAt time.Time<br \/>\n    AccessCount int<br \/>\n    TTL       time.Duration \/\/ \u8fc7\u671f\u65f6\u95f4<br \/>\n}<\/p>\n<p>\/\/ \u8870\u51cf\u7b56\u7565<br \/>\nfunc (m *MemoryItem) IsStale() bool {<br \/>\n    \/\/ 1. \u8d85\u8fc7 TTL \u7684\u8bb0\u5fc6\u89c6\u4e3a\u8fc7\u671f<br \/>\n    if time.Since(m.CreatedAt) &gt; m.TTL {<br \/>\n        return true<br \/>\n    }<br \/>\n    \/\/ 2. \u5f88\u4e45\u6ca1\u88ab\u8bbf\u95ee\u7684\u8bb0\u5fc6\u964d\u7ea7<br \/>\n    if time.Since(m.AccessedAt) &gt; m.TTL \/ 2 {<br \/>\n        return true<br \/>\n    }<br \/>\n    return false<br \/>\n}<\/p>\n<p>\u8870\u51cf\u7b56\u7565\u793a\u4f8b&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7528\u6237\u7684\u4e34\u65f6\u504f\u597d&#xff08;&#034;\u6211\u4eca\u5929\u60f3\u5403\u8fa3\u7684&#034;&#xff09;&#xff1a;24 \u5c0f\u65f6\u8fc7\u671f<\/p>\n<\/li>\n<li>\n<p>\u7528\u6237\u7684\u56fa\u5b9a\u5c5e\u6027&#xff08;&#034;\u6211\u662f\u540e\u7aef\u5f00\u53d1\u8005&#034;&#xff09;&#xff1a;30 \u5929\u5237\u65b0\u4e00\u6b21<\/p>\n<\/li>\n<li>\n<p>\u7528\u6237\u7684\u957f\u671f\u7279\u5f81&#xff08;&#034;\u6211\u8ba8\u538c PHP&#034;&#xff09;&#xff1a;\u6c38\u4e0d\u8fc7\u671f&#xff0c;\u4f46\u8bbf\u95ee\u9891\u7387\u964d\u4f4e\u540e\u6743\u91cd\u4e0b\u964d<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h4>\u516d\u3001\u8bb0\u5fc6\u7684\u6ce8\u5165\u4e0e\u63d0\u53d6<\/h4>\n<h5>6.1 \u6ce8\u5165\u65f6\u673a<\/h5>\n<p>\u8bb0\u5fc6\u9700\u8981\u5728\u6b63\u786e\u7684\u65f6\u673a\u6ce8\u5165\u5230\u4e0a\u4e0b\u6587\u4e2d&#xff1a;<\/p>\n<li>\n<p>\u4f1a\u8bdd\u5f00\u59cb\u65f6&#xff1a;\u6ce8\u5165\u7528\u6237\u753b\u50cf\u3001\u957f\u671f\u504f\u597d<\/p>\n<\/li>\n<li>\n<p>\u5de5\u5177\u8c03\u7528\u524d\u540e&#xff1a;\u6ce8\u5165\u5f53\u524d\u4efb\u52a1\u7684\u4e0a\u4e0b\u6587<\/p>\n<\/li>\n<li>\n<p>\u4e0a\u4e0b\u6587\u7a97\u53e3\u5c06\u6ee1\u65f6&#xff1a;\u6ce8\u5165\u6458\u8981<\/p>\n<\/li>\n<li>\n<p>\u7528\u6237\u63d0\u53ca\u7279\u5b9a\u8bdd\u9898\u65f6&#xff1a;\u6ce8\u5165\u76f8\u5173\u8bb0\u5fc6<\/p>\n<\/li>\n<h5>6.2 \u63d0\u53d6\u7b56\u7565<\/h5>\n<p>\u4ece\u7528\u6237\u6d88\u606f\u4e2d\u63d0\u53d6\u8bb0\u5fc6\u9700\u8981 LLM \u8f85\u52a9&#xff1a;<\/p>\n<p>\u7cfb\u7edf\u63d0\u793a\u8bcd\u7684\u4e00\u90e8\u5206&#xff1a;<br \/>\n&#034;\u4ece\u7528\u6237\u7684\u6d88\u606f\u4e2d\u63d0\u53d6\u5173\u952e\u4fe1\u606f&#xff0c;\u4ee5 JSON \u683c\u5f0f\u8f93\u51fa\u3002<br \/>\n\u53ea\u63d0\u53d6\u4e8b\u5b9e\u6027\u7684\u3001\u5bf9\u672a\u6765\u5bf9\u8bdd\u6709\u5e2e\u52a9\u7684\u4fe1\u606f\u3002<br \/>\n\u5ffd\u7565\u60c5\u7eea\u5316\u8868\u8fbe\u548c\u4e34\u65f6\u6027\u8bf7\u6c42\u3002&#034;<\/p>\n<p>\u7528\u6237\u6d88\u606f&#xff1a;&#034;\u6211\u53eb\u5f20\u4e09&#xff0c;\u662f\u4e2a\u540e\u7aef\u7a0b\u5e8f\u5458\u3002\u4eca\u5929\u5fc3\u60c5\u4e0d\u592a\u597d&#xff0c;\u5e2e\u6211\u770b\u770b\u8fd9\u6bb5\u4ee3\u7801\u54ea\u91cc\u6709\u95ee\u9898\u3002&#034;<\/p>\n<p>\u6a21\u578b\u8f93\u51fa&#xff1a;<br \/>\n{<br \/>\n  &#034;extracted_facts&#034;: [<br \/>\n    {&#034;key&#034;: &#034;user.name&#034;, &#034;value&#034;: &#034;\u5f20\u4e09&#034;},<br \/>\n    {&#034;key&#034;: &#034;user.role&#034;, &#034;value&#034;: &#034;\u540e\u7aef\u7a0b\u5e8f\u5458&#034;}<br \/>\n  ],<br \/>\n  &#034;ignored&#034;: [&#034;\u5fc3\u60c5\u4e0d\u592a\u597d&#034;]<br \/>\n}<\/p>\n<h5>6.3 \u51b2\u7a81\u89e3\u51b3<\/h5>\n<p>\u5f53\u65b0\u4fe1\u606f\u548c\u65e7\u8bb0\u5fc6\u51b2\u7a81\u65f6\u600e\u4e48\u529e&#xff1f;<\/p>\n<p>\u65e7\u8bb0\u5fc6&#xff1a;\u7528\u6237\u53eb\u5f20\u4e09<br \/>\n\u65b0\u6d88\u606f&#xff1a;&#034;\u5176\u5b9e\u6211\u4e0d\u53eb\u5f20\u4e09&#xff0c;\u6211\u53eb\u674e\u56db&#034;<\/p>\n<p>\u5904\u7406\u7b56\u7565&#xff1a;<br \/>\n1. \u7f6e\u4fe1\u5ea6\u6bd4\u8f83&#xff1a;\u5982\u679c\u65b0\u4fe1\u606f\u6765\u81ea\u7528\u6237\u660e\u786e\u58f0\u660e&#xff0c;\u8986\u76d6\u65e7\u8bb0\u5fc6<br \/>\n2. \u65f6\u95f4\u4f18\u5148&#xff1a;\u8f83\u65b0\u7684\u4fe1\u606f\u8986\u76d6\u65e7\u7684<br \/>\n3. \u4eba\u5de5\u786e\u8ba4&#xff1a;\u4e0d\u786e\u5b9a\u65f6\u95ee\u7528\u6237&#034;\u6211\u8bb0\u5f97\u60a8\u4e4b\u524d\u8bf4\u53eb\u5f20\u4e09&#xff0c;\u73b0\u5728\u6539\u6210\u674e\u56db\u4e86\u5417&#xff1f;&#034;<\/p>\n<hr \/>\n<h4>\u4e03\u3001\u5b9e\u6218&#xff1a;\u7ed9 Agent \u52a0\u4e0a\u4e09\u5c42\u8bb0\u5fc6<\/h4>\n<p>package main<\/p>\n<p>import (<br \/>\n&#034;context&#034;<br \/>\n&#034;fmt&#034;<br \/>\n&#034;sync&#034;<br \/>\n&#034;time&#034;<br \/>\n)<\/p>\n<p>\/\/ L1: \u4e0a\u4e0b\u6587\u7a97\u53e3&#xff08;\u7531 LLM SDK \u81ea\u5e26&#xff0c;\u6b64\u5904\u6a21\u62df&#xff09;<br \/>\ntype ContextWindow struct {<br \/>\nmessages []string<br \/>\nmaxSize  int<br \/>\n}<\/p>\n<p>func (cw *ContextWindow) Add(msg string) {<br \/>\ncw.messages &#061; append(cw.messages, msg)<br \/>\nif len(cw.messages) &gt; cw.maxSize {<br \/>\ncw.messages &#061; cw.messages[len(cw.messages)-cw.maxSize:]<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ L2: \u4f1a\u8bdd\u8bb0\u5fc6<br \/>\ntype SessionMemory struct {<br \/>\nmu    sync.RWMutex<br \/>\nfacts map[string]string<br \/>\n}<\/p>\n<p>func NewSessionMemory() *SessionMemory {<br \/>\nreturn &amp;SessionMemory{facts: make(map[string]string)}<br \/>\n}<\/p>\n<p>func (sm *SessionMemory) Set(key, value string) {<br \/>\nsm.mu.Lock()<br \/>\ndefer sm.mu.Unlock()<br \/>\nsm.facts[key] &#061; value<br \/>\n}<\/p>\n<p>func (sm *SessionMemory) Get(key string) (string, bool) {<br \/>\nsm.mu.RLock()<br \/>\ndefer sm.mu.RUnlock()<br \/>\nv, ok :&#061; sm.facts[key]<br \/>\nreturn v, ok<br \/>\n}<\/p>\n<p>func (sm *SessionMemory) GetAll() map[string]string {<br \/>\nsm.mu.RLock()<br \/>\ndefer sm.mu.RUnlock()<br \/>\ncopy :&#061; make(map[string]string)<br \/>\nfor k, v :&#061; range sm.facts {<br \/>\ncopy[k] &#061; v<br \/>\n}<br \/>\nreturn copy<br \/>\n}<\/p>\n<p>\/\/ L3: \u957f\u671f\u8bb0\u5fc6&#xff08;\u7b80\u5316\u7248&#xff0c;\u7528 map \u6a21\u62df\u5411\u91cf\u6570\u636e\u5e93&#xff09;<br \/>\ntype LongTermMemory struct {<br \/>\nmu       sync.RWMutex<br \/>\nmemories map[string][]MemoryItem \/\/ user_id \u2192 memories<br \/>\n}<\/p>\n<p>type MemoryItem struct {<br \/>\nKey       string<br \/>\nValue     string<br \/>\nCreatedAt time.Time<br \/>\nTTL       time.Duration<br \/>\n}<\/p>\n<p>func NewLongTermMemory() *LongTermMemory {<br \/>\nreturn &amp;LongTermMemory{memories: make(map[string][]MemoryItem)}<br \/>\n}<\/p>\n<p>func (ltm *LongTermMemory) Store(userID, key, value string, ttl time.Duration) {<br \/>\nltm.mu.Lock()<br \/>\ndefer ltm.mu.Unlock()<br \/>\nltm.memories[userID] &#061; append(ltm.memories[userID], MemoryItem{<br \/>\nKey: key, Value: value, CreatedAt: time.Now(), TTL: ttl,<br \/>\n})<br \/>\n}<\/p>\n<p>func (ltm *LongTermMemory) Recall(userID string) map[string]string {<br \/>\nltm.mu.RLock()<br \/>\ndefer ltm.mu.RUnlock()<br \/>\nresult :&#061; make(map[string]string)<br \/>\nnow :&#061; time.Now()<br \/>\nfor _, item :&#061; range ltm.memories[userID] {<br \/>\nif now.Sub(item.CreatedAt) &lt; item.TTL {<br \/>\nresult[item.Key] &#061; item.Value<br \/>\n}<br \/>\n}<br \/>\nreturn result<br \/>\n}<\/p>\n<p>\/\/ Agent \u6574\u5408\u4e09\u5c42\u8bb0\u5fc6<br \/>\ntype AgentWithMemory struct {<br \/>\nUserID      string<br \/>\nContext     *ContextWindow<br \/>\nSession     *SessionMemory<br \/>\nLongTerm    *LongTermMemory<br \/>\n}<\/p>\n<p>func NewAgentWithMemory(userID string) *AgentWithMemory {<br \/>\nreturn &amp;AgentWithMemory{<br \/>\nUserID:   userID,<br \/>\nContext:  &amp;ContextWindow{maxSize: 20},<br \/>\nSession:  NewSessionMemory(),<br \/>\nLongTerm: NewLongTermMemory(),<br \/>\n}<br \/>\n}<\/p>\n<p>func (a *AgentWithMemory) Process(userMsg string) string {<br \/>\n\/\/ 1. \u4ece\u7528\u6237\u6d88\u606f\u4e2d\u63d0\u53d6\u4e8b\u5b9e&#xff08;\u6a21\u62df LLM \u63d0\u53d6&#xff09;<br \/>\nif name, ok :&#061; extractName(userMsg); ok {<br \/>\na.Session.Set(&#034;user.name&#034;, name)<br \/>\na.LongTerm.Store(a.UserID, &#034;user.name&#034;, name, 30 * 24*time.Hour)<br \/>\n}<\/p>\n<p>\/\/ 2. \u6ce8\u5165\u957f\u671f\u8bb0\u5fc6\u5230\u4e0a\u4e0b\u6587<br \/>\nlongTermFacts :&#061; a.LongTerm.Recall(a.UserID)<br \/>\nsessionFacts :&#061; a.Session.GetAll()<\/p>\n<p>contextInject :&#061; &#034;\u3010\u5df2\u77e5\u4fe1\u606f\u3011\\\\n&#034;<br \/>\nfor k, v :&#061; range longTermFacts {<br \/>\ncontextInject &#043;&#061; fmt.Sprintf(&#034;- %s: %s\\\\n&#034;, k, v)<br \/>\n}<br \/>\nfor k, v :&#061; range sessionFacts {<br \/>\nif _, exists :&#061; longTermFacts[k]; !exists {<br \/>\ncontextInject &#043;&#061; fmt.Sprintf(&#034;- %s: %s (\u672c\u6b21\u4f1a\u8bdd)\\\\n&#034;, k, v)<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ 3. \u6a21\u62df LLM \u56de\u590d<br \/>\nreply :&#061; fmt.Sprintf(&#034;%s\\\\n\u7528\u6237\u8bf4: %s\\\\n(Agent \u57fa\u4e8e\u8bb0\u5fc6\u505a\u51fa\u56de\u5e94)&#034;, contextInject, userMsg)<\/p>\n<p>\/\/ 4. \u66f4\u65b0\u4e0a\u4e0b\u6587\u7a97\u53e3<br \/>\na.Context.Add(fmt.Sprintf(&#034;\u7528\u6237: %s&#034;, userMsg))<br \/>\na.Context.Add(fmt.Sprintf(&#034;\u52a9\u624b: %s&#034;, reply))<\/p>\n<p>return reply<br \/>\n}<\/p>\n<p>\/\/ \u7b80\u5355\u7684\u540d\u5b57\u63d0\u53d6&#xff08;\u6f14\u793a\u7528&#xff09;<br \/>\nfunc extractName(msg string) (string, bool) {<br \/>\nvar name string<br \/>\nn, _ :&#061; fmt.Sscanf(msg, &#034;\u6211\u53eb%s&#034;, &amp;name)<br \/>\nreturn name, n &#061;&#061; 1<br \/>\n}<\/p>\n<p>func main() {<br \/>\nagent :&#061; NewAgentWithMemory(&#034;user_10086&#034;)<\/p>\n<p>\/\/ \u7b2c\u4e00\u6b21\u5bf9\u8bdd<br \/>\nr1 :&#061; agent.Process(&#034;\u4f60\u597d&#xff0c;\u6211\u53eb\u5f20\u4e09&#034;)<br \/>\nfmt.Println(&#034;&#061;&#061;&#061; \u7b2c\u4e00\u6b21 &#061;&#061;&#061;&#034;)<br \/>\nfmt.Println(r1)<\/p>\n<p>\/\/ \u540c\u4e00\u4f1a\u8bdd\u4e2d\u7684\u7b2c\u4e8c\u6b21\u5bf9\u8bdd<br \/>\nr2 :&#061; agent.Process(&#034;\u4f60\u8fd8\u8bb0\u5f97\u6211\u53eb\u4ec0\u4e48\u5417&#xff1f;&#034;)<br \/>\nfmt.Println(&#034;\\\\n&#061;&#061;&#061; \u7b2c\u4e8c\u6b21&#xff08;\u540c\u4e00\u4f1a\u8bdd&#xff09;&#061;&#061;&#061;&#034;)<br \/>\nfmt.Println(r2)<\/p>\n<p>\/\/ \u6a21\u62df\u65b0\u4f1a\u8bdd&#xff08;\u65b0\u5efa Agent&#xff0c;\u4f46\u957f\u671f\u8bb0\u5fc6\u8fd8\u5728&#xff09;<br \/>\nnewSession :&#061; NewAgentWithMemory(&#034;user_10086&#034;)<br \/>\nnewSession.LongTerm &#061; agent.LongTerm \/\/ \u5171\u4eab\u957f\u671f\u8bb0\u5fc6<\/p>\n<p>r3 :&#061; newSession.Process(&#034;\u4f60\u77e5\u9053\u6211\u662f\u8c01\u5417&#xff1f;&#034;)<br \/>\nfmt.Println(&#034;\\\\n&#061;&#061;&#061; \u7b2c\u4e09\u6b21&#xff08;\u65b0\u4f1a\u8bdd&#xff09;&#061;&#061;&#061;&#034;)<br \/>\nfmt.Println(r3)<br \/>\n}<\/p>\n<hr \/>\n<h4>\u516b\u3001\u8bb0\u5fc6\u7684\u5b89\u5168\u4e0e\u9690\u79c1<\/h4>\n<h5>8.1 \u7528\u6237\u63a7\u5236\u6743<\/h5>\n<p>\u597d\u7684 Agent \u5e94\u8be5\u8ba9\u7528\u6237\u62e5\u6709\u5bf9\u81ea\u5df1\u8bb0\u5fc6\u7684\u63a7\u5236\u6743&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u67e5\u770b&#xff1a;&#034;\u6211\u90fd\u8bb0\u5f97\u5173\u4e8e\u4f60\u7684\u54ea\u4e9b\u4fe1\u606f&#xff1f;&#034;<\/p>\n<\/li>\n<li>\n<p>\u5220\u9664&#xff1a;&#034;\u628a\u6211\u4e0a\u5468\u8bf4\u7684\u90a3\u53e5\u8bdd\u5fd8\u6389&#034;<\/p>\n<\/li>\n<li>\n<p>\u4fee\u6539&#xff1a;&#034;\u6211\u4e4b\u524d\u8bf4\u7684\u4e0d\u5bf9&#xff0c;\u5176\u5b9e\u6211\u7528\u7684\u662f Rust \u4e0d\u662f Go&#034;<\/p>\n<\/li>\n<li>\n<p>\u5bfc\u51fa&#xff1a;&#034;\u628a\u6211\u7684\u8bb0\u5fc6\u6570\u636e\u5bfc\u51fa\u6765&#034;<\/p>\n<\/li>\n<\/ul>\n<h5>8.2 \u654f\u611f\u4fe1\u606f\u4fdd\u62a4<\/h5>\n<ul>\n<li>\n<p>\u5bc6\u7801\u3001\u5bc6\u94a5\u3001Token \u7b49\u654f\u611f\u4fe1\u606f\u7edd\u4e0d\u5b58\u5165\u957f\u671f\u8bb0\u5fc6<\/p>\n<\/li>\n<li>\n<p>\u5373\u4f7f\u5b58\u5165\u4f1a\u8bdd\u8bb0\u5fc6&#xff0c;\u4e5f\u8981\u5728\u4f1a\u8bdd\u7ed3\u675f\u65f6\u6e05\u9664<\/p>\n<\/li>\n<li>\n<p>\u8bb0\u5fc6\u6570\u636e\u5e94\u52a0\u5bc6\u5b58\u50a8&#xff08;AES-256&#xff09;<\/p>\n<\/li>\n<\/ul>\n<h5>8.3 \u9057\u5fd8\u673a\u5236<\/h5>\n<p>GDPR \u8981\u6c42\u7684&#034;\u88ab\u9057\u5fd8\u6743&#034;\u5728 Agent \u4e2d\u540c\u6837\u91cd\u8981&#xff1a;<\/p>\n<p>func (ltm *LongTermMemory) Forget(userID string, key string) {<br \/>\n    ltm.mu.Lock()<br \/>\n    defer ltm.mu.Unlock()<\/p>\n<p>    memories :&#061; ltm.memories[userID]<br \/>\n    filtered :&#061; make([]MemoryItem, 0)<br \/>\n    for _, item :&#061; range memories {<br \/>\n        if item.Key !&#061; key {<br \/>\n            filtered &#061; append(filtered, item)<br \/>\n        }<br \/>\n    }<br \/>\n    ltm.memories[userID] &#061; filtered<br \/>\n}<\/p>\n<hr \/>\n<h4>\u4e5d\u3001\u8bfe\u540e\u5b9e\u8df5<\/h4>\n<p>\u4efb\u52a1&#xff1a;\u5b9e\u73b0\u4e00\u4e2a\u5e26\u6709\u4e09\u5c42\u8bb0\u5fc6\u7684 Agent&#xff0c;\u8ba9\u5b83\u80fd\u8de8\u4f1a\u8bdd\u8bb0\u4f4f\u7528\u6237\u7684\u57fa\u672c\u4fe1\u606f\u3002<\/p>\n<p>\u8981\u6c42&#xff1a;<\/p>\n<li>\n<p>\u5b9e\u73b0 L1 \u4e0a\u4e0b\u6587\u7a97\u53e3&#xff08;\u6ed1\u52a8\u7a97\u53e3&#xff0c;\u4fdd\u7559\u6700\u8fd1 10 \u8f6e\u5bf9\u8bdd&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u5b9e\u73b0 L2 \u4f1a\u8bdd\u8bb0\u5fc6&#xff08;\u4ece\u5bf9\u8bdd\u4e2d\u63d0\u53d6\u5173\u952e\u4e8b\u5b9e&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u5b9e\u73b0 L3 \u957f\u671f\u8bb0\u5fc6&#xff08;\u7528\u6587\u4ef6\u6216 SQLite \u6301\u4e45\u5316&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u652f\u6301\u7528\u6237\u67e5\u8be2&#034;\u4f60\u8fd8\u8bb0\u5f97\u5173\u4e8e\u6211\u7684\u4ec0\u4e48\u4fe1\u606f&#034;<\/p>\n<\/li>\n<p>\u8fdb\u9636\u6311\u6218&#xff1a;<\/p>\n<li>\n<p>\u5b9e\u73b0\u8bb0\u5fc6\u7684\u8870\u51cf\u673a\u5236&#xff08;\u957f\u65f6\u95f4\u4e0d\u8bbf\u95ee\u7684\u8bb0\u5fc6\u6743\u91cd\u964d\u4f4e&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u5b9e\u73b0\u8bb0\u5fc6\u7684\u51b2\u7a81\u68c0\u6d4b&#xff08;\u65b0\u65e7\u4fe1\u606f\u77db\u76fe\u65f6\u5982\u4f55\u5904\u7406&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u628a\u8bb0\u5fc6\u7cfb\u7edf\u63a5\u5165 zz365.top \u7684\u5de5\u5177\u94fe\u2014\u2014\u6bd4\u5982\u7528 Crontab \u5b9a\u65f6\u6e05\u7406\u8fc7\u671f\u8bb0\u5fc6<\/p>\n<\/li>\n<p>\u5ef6\u4f38\u601d\u8003&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5982\u679c\u591a\u4e2a\u7528\u6237\u5171\u4eab\u4e00\u4e2a Agent&#xff08;\u6bd4\u5982\u56e2\u961f\u534f\u4f5c\u573a\u666f&#xff09;&#xff0c;\u8bb0\u5fc6\u600e\u4e48\u9694\u79bb&#xff1f;<\/p>\n<\/li>\n<li>\n<p>Agent \u81ea\u5df1\u7684&#034;\u7ecf\u9a8c&#034;&#xff08;\u6bd4\u5982\u5b66\u4f1a\u7684\u65b0\u6280\u80fd&#xff09;\u5e94\u8be5\u5b58\u5728\u54ea\u4e00\u5c42&#xff1f;<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c Agent \u8bb0\u9519\u4e86&#xff0c;\u7528\u6237\u7ea0\u6b63\u540e&#xff0c;\u600e\u4e48\u786e\u4fdd\u5b83\u4e0d\u518d\u72af\u540c\u6837\u7684\u9519\u8bef&#xff1f;<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h4>\u5341\u3001\u5ef6\u4f38\u9605\u8bfb<\/h4>\n<ul>\n<li>\n<p>\u8bba\u6587&#xff1a;\u300aMemGPT: Towards LLMs as Operating Systems\u300b&#xff08;2023&#xff09;- \u5206\u5c42\u8bb0\u5fc6\u7684\u5f00\u521b\u6027\u5de5\u4f5c<\/p>\n<\/li>\n<li>\n<p>\u8bba\u6587&#xff1a;\u300aGenerative Agents: Interactive Simulacra of Human Behavior\u300b&#xff08;2023&#xff09;- \u957f\u671f\u8bb0\u5fc6\u5728 Agent \u4e2d\u7684\u5e94\u7528<\/p>\n<\/li>\n<li>\n<p>\u5f00\u6e90\u9879\u76ee&#xff1a;Mem0 &#8211; 2025-2026 \u6d41\u884c\u7684 Agent \u8bb0\u5fc6\u5c42\u6846\u67b6<\/p>\n<\/li>\n<li>\n<p>\u5de5\u5177&#xff1a;Chroma \/ Qdrant \/ Pinecone &#8211; \u5411\u91cf\u6570\u636e\u5e93\u9009\u578b\u53c2\u8003<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h4>\u5341\u4e00\u3001\u4e0b\u4e00\u8bb2\u9884\u544a<\/h4>\n<p>\u7b2c5\u8bb2&#xff1a;\u7f16\u6392\u2014\u2014Agent \u5982\u4f55\u89c4\u5212\u590d\u6742\u4efb\u52a1&#xff0c;\u6211\u4eec\u4f1a\u6df1\u5165\u63a2\u8ba8&#xff1a;Agent \u600e\u4e48\u628a\u4e00\u4e2a\u590d\u6742\u7684\u4efb\u52a1\u62c6\u89e3\u6210\u5b50\u4efb\u52a1\u3001\u600e\u4e48\u51b3\u5b9a\u6267\u884c\u7684\u5148\u540e\u987a\u5e8f\u3001\u600e\u4e48\u5904\u7406\u5206\u652f\u548c\u5e76\u884c&#xff0c;\u4ee5\u53ca DAG&#xff08;\u6709\u5411\u65e0\u73af\u56fe&#xff09;\u5728 Agent \u7f16\u6392\u4e2d\u7684\u5e94\u7528\u3002<\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u4e00\u4e2a\u5c34\u5c2c\u7684\u573a\u666f\u4f60\u548c Agent \u5bf9\u8bdd&#xff1a;\u4f60&#xff1a;\\&#8221;\u6211\u53eb\u5f20\u4e09&#xff0c;\u662f\u4e00\u540d\u540e\u7aef\u5f00\u53d1\u8005&#xff0c;\u4e3b\u8981\u7528 Go\u3002\\&#8221;Agent&#xff1a;\\&#8221;\u597d\u7684&#xff0c;\u5f20\u4e09&#xff0c;\u6211\u8bb0\u4f4f\u4e86\u3002\\&#8221;\u4f60&#xff1a;\\&#8221;\u5e2e\u6211\u770b\u770b\u6211\u7684\u9879\u76ee\u91cc\u6709\u6ca1\u6709\u5185\u5b58\u6cc4\u6f0f\u3002\\&#8221;Agent \u5f00\u59cb\u5206\u6790\u4ee3\u7801&#8230;\u4f60&#xff1a;\\&#8221;\u987a\u4fbf\u95ee\u4e00\u4e0b&#xff0c;\u6211\u53eb\u4ec0\u4e48\u540d\u5b57&#xff1f;\\&#8221;Agent&#xff1a;\\&#8221;\u62b1\u6b49&#xff0c;\u6211\u4e0d\u77e5\u9053\u60a8\u7684\u540d\u5b57\u3002\u8bf7\u95ee\u60a8\u600e\u4e48\u79f0\u547c&amp;#xff<\/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,323,427],"topic":[],"class_list":["post-100248","post","type-post","status-publish","format-standard","hentry","category-server","tag-50","tag-323","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7b2c4\u8bb2\uff1a\u8bb0\u5fc6\u5c42\u2014\u2014\u8ba9 Agent \u4e0d\u5065\u5fd8 - \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\/100248.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7b2c4\u8bb2\uff1a\u8bb0\u5fc6\u5c42\u2014\u2014\u8ba9 Agent \u4e0d\u5065\u5fd8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u4e00\u4e2a\u5c34\u5c2c\u7684\u573a\u666f\u4f60\u548c Agent \u5bf9\u8bdd&#xff1a;\u4f60&#xff1a;&quot;\u6211\u53eb\u5f20\u4e09&#xff0c;\u662f\u4e00\u540d\u540e\u7aef\u5f00\u53d1\u8005&#xff0c;\u4e3b\u8981\u7528 Go\u3002&quot;Agent&#xff1a;&quot;\u597d\u7684&#xff0c;\u5f20\u4e09&#xff0c;\u6211\u8bb0\u4f4f\u4e86\u3002&quot;\u4f60&#xff1a;&quot;\u5e2e\u6211\u770b\u770b\u6211\u7684\u9879\u76ee\u91cc\u6709\u6ca1\u6709\u5185\u5b58\u6cc4\u6f0f\u3002&quot;Agent \u5f00\u59cb\u5206\u6790\u4ee3\u7801...\u4f60&#xff1a;&quot;\u987a\u4fbf\u95ee\u4e00\u4e0b&#xff0c;\u6211\u53eb\u4ec0\u4e48\u540d\u5b57&#xff1f;&quot;Agent&#xff1a;&quot;\u62b1\u6b49&#xff0c;\u6211\u4e0d\u77e5\u9053\u60a8\u7684\u540d\u5b57\u3002\u8bf7\u95ee\u60a8\u600e\u4e48\u79f0\u547c&amp;#xff\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/100248.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-04T01:08:49+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=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/100248.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/100248.html\",\"name\":\"\u7b2c4\u8bb2\uff1a\u8bb0\u5fc6\u5c42\u2014\u2014\u8ba9 Agent \u4e0d\u5065\u5fd8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-04T01:08:49+00:00\",\"dateModified\":\"2026-09-04T01:08:49+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/100248.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/100248.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/100248.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7b2c4\u8bb2\uff1a\u8bb0\u5fc6\u5c42\u2014\u2014\u8ba9 Agent \u4e0d\u5065\u5fd8\"}]},{\"@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":"\u7b2c4\u8bb2\uff1a\u8bb0\u5fc6\u5c42\u2014\u2014\u8ba9 Agent \u4e0d\u5065\u5fd8 - \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\/100248.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7b2c4\u8bb2\uff1a\u8bb0\u5fc6\u5c42\u2014\u2014\u8ba9 Agent \u4e0d\u5065\u5fd8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u4e00\u4e2a\u5c34\u5c2c\u7684\u573a\u666f\u4f60\u548c Agent \u5bf9\u8bdd&#xff1a;\u4f60&#xff1a;\"\u6211\u53eb\u5f20\u4e09&#xff0c;\u662f\u4e00\u540d\u540e\u7aef\u5f00\u53d1\u8005&#xff0c;\u4e3b\u8981\u7528 Go\u3002\"Agent&#xff1a;\"\u597d\u7684&#xff0c;\u5f20\u4e09&#xff0c;\u6211\u8bb0\u4f4f\u4e86\u3002\"\u4f60&#xff1a;\"\u5e2e\u6211\u770b\u770b\u6211\u7684\u9879\u76ee\u91cc\u6709\u6ca1\u6709\u5185\u5b58\u6cc4\u6f0f\u3002\"Agent \u5f00\u59cb\u5206\u6790\u4ee3\u7801...\u4f60&#xff1a;\"\u987a\u4fbf\u95ee\u4e00\u4e0b&#xff0c;\u6211\u53eb\u4ec0\u4e48\u540d\u5b57&#xff1f;\"Agent&#xff1a;\"\u62b1\u6b49&#xff0c;\u6211\u4e0d\u77e5\u9053\u60a8\u7684\u540d\u5b57\u3002\u8bf7\u95ee\u60a8\u600e\u4e48\u79f0\u547c&amp;#xff","og_url":"https:\/\/www.wsisp.com\/helps\/100248.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-04T01:08:49+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/100248.html","url":"https:\/\/www.wsisp.com\/helps\/100248.html","name":"\u7b2c4\u8bb2\uff1a\u8bb0\u5fc6\u5c42\u2014\u2014\u8ba9 Agent \u4e0d\u5065\u5fd8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-04T01:08:49+00:00","dateModified":"2026-09-04T01:08:49+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/100248.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/100248.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/100248.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7b2c4\u8bb2\uff1a\u8bb0\u5fc6\u5c42\u2014\u2014\u8ba9 Agent \u4e0d\u5065\u5fd8"}]},{"@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\/100248","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=100248"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/100248\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=100248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=100248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=100248"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=100248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}