{"id":91625,"date":"2026-08-08T07:49:08","date_gmt":"2026-08-07T23:49:08","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/91625.html"},"modified":"2026-08-08T07:49:08","modified_gmt":"2026-08-07T23:49:08","slug":"%e6%9c%80%e7%ae%80%e8%ae%b0%e5%bf%86%ef%bc%9a%e8%ae%a9-agent-%e8%ae%b0%e4%bd%8f%e4%bd%a0%e7%9a%84%e5%90%8d%e5%ad%97%ef%bc%88%e7%ac%ac77%e7%af%87-e63%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/91625.html","title":{"rendered":"\u6700\u7b80\u8bb0\u5fc6\uff1a\u8ba9 Agent \u8bb0\u4f4f\u4f60\u7684\u540d\u5b57\uff08\u7b2c77\u7bc7-E63\uff09"},"content":{"rendered":"<p>\u7cfb\u5217\u300c\u4f01\u4e1a\u7ea7 AI Agent \u5b9e\u73b0\u62c6\u89e3\u300dE63 \u7bc7&#xff0c;Part 14 \u8bb0\u5fc6\u7bc7\u7b2c\u4e00\u7ae0\u3002\u4e0a\u4e00\u7bc7\u6536\u5b8c\u4e86 RAG\u2014\u2014\u90a3\u89e3\u51b3\u7684\u662f\u300cAgent \u61c2\u4e1a\u52a1\u300d\u3002\u8fd9\u7bc7\u5f00\u59cb\u8bb2\u8bb0\u5fc6&#xff0c;\u89e3\u51b3\u7684\u662f\u300cAgent \u8bb0\u5f97\u4f60\u300d\u3002<\/p>\n<p>\u5148\u7ed9\u4e00\u4e2a\u53ef\u80fd\u8ba9\u4f60\u610f\u5916\u7684\u4e8b\u5b9e&#xff1a;Eino \u6846\u67b6\u91cc\u6ca1\u6709\u5b98\u65b9\u7684 memory \u7ec4\u4ef6\u3002\u8bb0\u5fc6\u4e0d\u662f\u6846\u67b6\u5e2e\u4f60\u505a\u7684\u4e8b&#xff0c;\u662f\u4f60\u81ea\u5df1\u62fc\u51fa\u6765\u7684\u3002\u8fd9\u7bc7\u5c31\u628a\u8fd9\u5341\u51e0\u884c\u62fc\u88c5\u4ee3\u7801\u62c6\u5f00\u770b\u3002<\/p>\n<h3>\u5148\u5206\u6e05\u695a&#xff1a;\u8bb0\u5fc6\u548c RAG \u4e0d\u662f\u4e00\u56de\u4e8b<\/h3>\n<p>\u4e24\u8005\u90fd\u662f\u300c\u5b58\u4e1c\u897f\u3001\u67e5\u4e1c\u897f\u3001\u62fc\u8fdb prompt\u300d&#xff0c;\u975e\u5e38\u5bb9\u6613\u6df7\u3002\u4f46\u5b83\u4eec\u56de\u7b54\u7684\u662f\u4e0d\u540c\u7684\u95ee\u9898&#xff1a;<\/p>\n<table>\n<tr>RAG&#xff08;\u77e5\u8bc6\u5e93&#xff09;\u8bb0\u5fc6<\/tr>\n<tbody>\n<tr>\n<td>\u5b58\u7684\u662f\u4ec0\u4e48<\/td>\n<td>\u516c\u53f8\u6587\u6863\u3001\u4ea7\u54c1\u624b\u518c\u2014\u2014\u6240\u6709\u4eba\u5171\u4eab<\/td>\n<td>\u8fd9\u4e2a\u7528\u6237\u8bf4\u8fc7\u7684\u8bdd\u2014\u2014\u4e00\u4eba\u4e00\u4efd<\/td>\n<\/tr>\n<tr>\n<td>\u8c01\u5199\u8fdb\u53bb\u7684<\/td>\n<td>\u7ba1\u7406\u5458\u4e0a\u4f20&#xff0c;\u79bb\u7ebf\u7d22\u5f15<\/td>\n<td>\u7528\u6237\u81ea\u5df1&#xff0c;\u6bcf\u8f6e\u5bf9\u8bdd\u5b9e\u65f6\u4ea7\u751f<\/td>\n<\/tr>\n<tr>\n<td>\u600e\u4e48\u53d6<\/td>\n<td>\u8bed\u4e49\u68c0\u7d22&#xff0c;\u53d6\u6700\u76f8\u5173\u7684\u51e0\u7247<\/td>\n<td>\u6309\u4f1a\u8bdd ID \u53d6&#xff0c;\u901a\u5e38\u5168\u90fd\u8981<\/td>\n<\/tr>\n<tr>\n<td>\u8fc7\u671f\u4e86\u600e\u4e48\u529e<\/td>\n<td>\u6587\u6863\u6539\u7248\u5c31\u91cd\u65b0\u7d22\u5f15<\/td>\n<td>\u8d8a\u4e45\u8fdc\u8d8a\u4e0d\u91cd\u8981&#xff0c;\u8981\u8870\u51cf\u3001\u8981\u6dd8\u6c70<\/td>\n<\/tr>\n<tr>\n<td>\u7b54\u9519\u7684\u540e\u679c<\/td>\n<td>\u7b54\u6848\u4e0d\u51c6<\/td>\n<td>\u53ef\u80fd\u6cc4\u9732\u522b\u4eba\u7684\u9690\u79c1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6700\u540e\u4e00\u884c\u662f\u8bb0\u5fc6\u6700\u8981\u547d\u7684\u5730\u65b9&#xff1a;RAG \u68c0\u7d22\u9519\u4e86\u53ea\u662f\u7b54\u5f97\u4e0d\u597d&#xff0c;\u8bb0\u5fc6\u4e32\u4e86\u662f\u4e8b\u6545\u2014\u2014\u628a A \u7528\u6237\u7684\u5bf9\u8bdd\u5185\u5bb9\u62fc\u8fdb\u4e86 B \u7528\u6237\u7684 prompt\u3002<\/p>\n<p>\u6240\u4ee5\u8fd9\u4e00 Part \u4ece\u7b2c\u4e00\u7bc7\u8d77\u5c31\u8981\u628a\u300c\u9694\u79bb\u300d\u8fd9\u4ef6\u4e8b\u653e\u5728\u5fc3\u4e0a\u3002<\/p>\n<h2>\u8bfb\u5b8c\u8fd9\u7bc7\u4f60\u4f1a\u77e5\u9053<\/h2>\n<ul>\n<li>Eino \u6ca1\u6709\u5b98\u65b9 memory \u7ec4\u4ef6&#xff0c;\u5b98\u65b9\u793a\u4f8b\u91cc\u90a3\u4e2a MemoryStore \u63a5\u53e3\u53ea\u6709\u4e09\u4e2a\u65b9\u6cd5<\/li>\n<li>\u8bb0\u5fc6\u7684\u672c\u8d28\u5c31\u4e09\u6b65&#xff1a;\u8bfb\u51fa\u6765\u3001\u62fc\u4e0a\u53bb\u3001\u5199\u56de\u53bb&#xff0c;\u6ca1\u6709\u4efb\u4f55\u6846\u67b6\u9b54\u6cd5<\/li>\n<li>\u4e00\u4e2a 40 \u884c\u7684 PostgreSQL \u5b9e\u73b0&#xff0c;\u4ee5\u53ca\u6bcf\u8f6e\u5b9e\u9645\u53d1\u7ed9\u6a21\u578b\u7684\u6d88\u606f\u5217\u8868\u957f\u4ec0\u4e48\u6837<\/li>\n<li>\u5b98\u65b9\u793a\u4f8b\u7528 Gob \u800c\u4e0d\u662f JSON \u5e8f\u5217\u5316&#xff0c;\u5b9e\u6d4b\u5b83\u80fd\u5b8c\u6574\u4fdd\u4f4f ToolCalls \u548c ToolCallID<\/li>\n<li>Gob \u7684\u56fa\u5b9a\u5f00\u9500\u6709\u591a\u5927&#xff1a;4 \u6761\u6d88\u606f 2647 \u5b57\u8282&#xff0c;200 \u6761\u6d88\u606f\u624d 15775 \u5b57\u8282\u2014\u2014\u6bcf\u6761\u4ece 662 \u5b57\u8282\u964d\u5230 79 \u5b57\u8282<\/li>\n<li>Write \u662f\u6574\u4f53\u8986\u76d6\u4e0d\u662f\u8ffd\u52a0&#xff1a;\u5b9e\u6d4b\u4e24\u4e2a\u5e76\u53d1\u8bf7\u6c42\u5404\u5199\u4e00\u6761&#xff0c;\u6700\u540e\u53ea\u5269\u4e00\u6761<\/li>\n<li>100 \u8f6e\u5bf9\u8bdd &#061; 200 \u6761\u6d88\u606f&#xff0c;\u6bcf\u4e00\u8f6e\u90fd\u8981\u5168\u90e8\u8bfb\u51fa\u6765\u3001\u62fc\u8fdb prompt\u3001\u518d\u5168\u90e8\u5199\u56de<\/li>\n<\/ul>\n<hr \/>\n<h3>\u4e00\u3001Eino \u91cc\u6ca1\u6709 memory \u7ec4\u4ef6<\/h3>\n<p>\u5148\u628a\u8fd9\u4e2a\u4e8b\u5b9e\u8bf4\u6e05\u695a&#xff0c;\u7701\u5f97\u4f60\u53bb\u7ffb\u6587\u6863\u627e\u3002<\/p>\n<p>eino\/components\/ \u4e0b\u9762\u6709 model\u3001tool\u3001document\u3001embedding\u3001indexer\u3001retriever\u3001prompt\u2014\u2014\u6ca1\u6709 memory\u3002\u4ed3\u5e93\u91cc\u80fd\u641c\u5230\u4e24\u4e2a\u8fdc\u7a0b\u5206\u652f\u53eb feat\/auto_memory_mw&#xff0c;\u8bf4\u660e\u5b98\u65b9\u5728\u505a&#xff0c;\u4f46\u622a\u81f3 v0.9.13 \u6ca1\u6709\u5408\u8fdb\u4e3b\u5e72\u3002<\/p>\n<p>\u90a3\u8bb0\u5fc6\u600e\u4e48\u529e&#xff1f;\u770b\u5b98\u65b9\u793a\u4f8b eino-examples\/flow\/agent\/react\/memory_example\/&#xff0c;\u5b83\u81ea\u5df1\u5b9a\u4e49\u4e86\u4e00\u4e2a\u63a5\u53e3&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ MemoryStore persists and restores short-term conversation history.<\/span><br \/>\n<span class=\"token keyword\">type<\/span> MemoryStore <span class=\"token keyword\">interface<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token function\">Write<\/span><span class=\"token punctuation\">(<\/span>ctx context<span class=\"token punctuation\">.<\/span>Context<span class=\"token punctuation\">,<\/span> sessionID <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">,<\/span> msgs <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">*<\/span>schema<span class=\"token punctuation\">.<\/span>Message<span class=\"token punctuation\">)<\/span> <span class=\"token builtin\">error<\/span><br \/>\n    <span class=\"token function\">Read<\/span><span class=\"token punctuation\">(<\/span>ctx context<span class=\"token punctuation\">.<\/span>Context<span class=\"token punctuation\">,<\/span> sessionID <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">*<\/span>schema<span class=\"token punctuation\">.<\/span>Message<span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">error<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token function\">Query<\/span><span class=\"token punctuation\">(<\/span>ctx context<span class=\"token punctuation\">.<\/span>Context<span class=\"token punctuation\">,<\/span> sessionID<span class=\"token punctuation\">,<\/span> text <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">,<\/span> limit <span class=\"token builtin\">int<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">*<\/span>schema<span class=\"token punctuation\">.<\/span>Message<span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">error<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u4e09\u4e2a\u65b9\u6cd5&#xff0c;\u4e00\u4e2a session \u4e00\u4efd\u6d88\u606f\u5217\u8868\u3002 \u793a\u4f8b\u91cc\u7ed9\u4e86 inmem \u548c redis \u4e24\u79cd\u5b9e\u73b0\u3002<\/p>\n<p>\u6ce8\u610f\u8fd9\u4e2a\u63a5\u53e3\u7684\u5b9a\u4f4d\u2014\u2014\u6ce8\u91ca\u5199\u7684\u662f short-term conversation history&#xff08;\u77ed\u671f\u5bf9\u8bdd\u5386\u53f2&#xff09;\u3002\u5b83\u7ba1\u7684\u662f\u300c\u8fd9\u4e00\u8f6e\u4f1a\u8bdd\u8bf4\u8fc7\u4ec0\u4e48\u300d&#xff0c;\u4e0d\u662f\u300c\u8fd9\u4e2a\u7528\u6237\u662f\u8c01\u300d\u3002\u540e\u8005\u8981\u5230\u7b2c 78 \u7bc7\u8bb2\u4e09\u5c42\u8bbe\u8ba1\u65f6\u624d\u51fa\u73b0\u3002<\/p>\n<p>\u8fd8\u8981\u6ce8\u610f Query \u8fd9\u4e2a\u65b9\u6cd5\u3002\u793a\u4f8b\u7684\u5b9e\u73b0\u662f\u5b50\u4e32\u5339\u914d&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ Query performs a simple substring search on message contents for the session.<\/span><br \/>\n<span class=\"token keyword\">if<\/span> strings<span class=\"token punctuation\">.<\/span><span class=\"token function\">Contains<\/span><span class=\"token punctuation\">(<\/span>strings<span class=\"token punctuation\">.<\/span><span class=\"token function\">ToLower<\/span><span class=\"token punctuation\">(<\/span>m<span class=\"token punctuation\">.<\/span>Content<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> q<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><\/p>\n<p>\u4e0d\u662f\u5411\u91cf\u68c0\u7d22\u3002\u8fd9\u662f\u8bb0\u5fc6\u548c RAG \u7684\u53c8\u4e00\u5904\u5206\u91ce\u2014\u2014\u4f1a\u8bdd\u5386\u53f2\u901a\u5e38\u51e0\u5341\u4e0a\u767e\u6761&#xff0c;\u76f4\u63a5\u626b\u4e00\u904d\u5c31\u884c&#xff0c;\u4e0a\u5411\u91cf\u5e93\u662f\u6740\u9e21\u7528\u725b\u5200\u3002\u7b49\u5230\u8bb0\u5fc6\u591a\u5230\u9700\u8981\u8bed\u4e49\u68c0\u7d22\u65f6&#xff0c;\u90a3\u5df2\u7ecf\u662f\u957f\u671f\u8bb0\u5fc6\u7684\u8303\u7574\u4e86\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u8bb0\u5fc6\u7684\u672c\u8d28&#xff1a;\u8bfb\u51fa\u6765\u3001\u62fc\u4e0a\u53bb\u3001\u5199\u56de\u53bb<\/h3>\n<p>\u770b\u5b98\u65b9\u793a\u4f8b\u662f\u600e\u4e48\u628a\u8bb0\u5fc6\u63a5\u8fdb agent \u7684&#xff0c;\u4e00\u5171\u5c31\u4e09\u884c\u5173\u952e\u4ee3\u7801&#xff1a;<\/p>\n<p>prev<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">_<\/span> <span class=\"token operator\">:&#061;<\/span> store<span class=\"token punctuation\">.<\/span><span class=\"token function\">Read<\/span><span class=\"token punctuation\">(<\/span>ctx<span class=\"token punctuation\">,<\/span> sessionID<span class=\"token punctuation\">)<\/span>              <span class=\"token comment\">\/\/ \u2460 \u8bfb\u51fa\u5386\u53f2<\/span><br \/>\neff <span class=\"token operator\">:&#061;<\/span> <span class=\"token function\">append<\/span><span class=\"token punctuation\">(<\/span>prev<span class=\"token punctuation\">,<\/span> schema<span class=\"token punctuation\">.<\/span><span class=\"token function\">UserMessage<\/span><span class=\"token punctuation\">(<\/span>turn<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>      <span class=\"token comment\">\/\/ \u2461 \u62fc\u4e0a\u672c\u8f6e\u8f93\u5165<\/span><br \/>\n<span class=\"token comment\">\/\/ &#8230; \u8c03\u7528 agent&#xff0c;\u62ff\u5230\u56de\u590d &#8230;<\/span><br \/>\nstore<span class=\"token punctuation\">.<\/span><span class=\"token function\">Write<\/span><span class=\"token punctuation\">(<\/span>ctx<span class=\"token punctuation\">,<\/span> sessionID<span class=\"token punctuation\">,<\/span> updated<span class=\"token punctuation\">)<\/span>               <span class=\"token comment\">\/\/ \u2462 \u6574\u4f53\u5199\u56de<\/span><\/p>\n<p>\u6ca1\u6709\u4e2d\u95f4\u4ef6&#xff0c;\u6ca1\u6709\u81ea\u52a8\u6ce8\u5165&#xff0c;\u6ca1\u6709\u6846\u67b6\u9b54\u6cd5\u3002 \u5c31\u662f\u4f60\u81ea\u5df1\u4ece\u6570\u636e\u5e93\u8bfb\u4e00\u4e2a\u6570\u7ec4\u3001\u5f80\u540e\u9762 append\u3001\u518d\u5b58\u56de\u53bb\u3002<\/p>\n<p>\u8fd9\u4ef6\u4e8b\u503c\u5f97\u5f3a\u8c03&#xff0c;\u56e0\u4e3a\u5f88\u591a\u4eba\u4f1a\u89c9\u5f97\u300c\u8bb0\u5fc6\u300d\u662f\u4e2a\u9ad8\u6df1\u529f\u80fd\u3002\u5b83\u4e0d\u662f\u3002 \u5927\u6a21\u578b\u7684 API \u672c\u6765\u5c31\u662f\u65e0\u72b6\u6001\u7684\u2014\u2014\u4f60\u6bcf\u6b21\u8c03\u7528\u90fd\u5f97\u628a\u5b8c\u6574\u7684\u5bf9\u8bdd\u5386\u53f2\u53d1\u8fc7\u53bb&#xff0c;\u6a21\u578b\u624d\u77e5\u9053\u4e4b\u524d\u8bf4\u4e86\u4ec0\u4e48\u3002\u6240\u8c13\u300c\u8bb0\u5fc6\u300d&#xff0c;\u5c31\u662f\u4f60\u5728\u4e24\u6b21 API \u8c03\u7528\u4e4b\u95f4&#xff0c;\u628a\u8fd9\u4e2a\u5386\u53f2\u6570\u7ec4\u5b58\u5728\u54ea\u91cc\u3002<\/p>\n<p>\u5b58\u5728\u8fdb\u7a0b\u5185\u5b58\u91cc \u2192 \u91cd\u542f\u5c31\u6ca1\u4e86 \u5b58\u5728 Redis \u91cc \u2192 \u8de8\u8fdb\u7a0b\u80fd\u5171\u4eab \u5b58\u5728 PostgreSQL \u91cc \u2192 \u80fd\u6301\u4e45\u5316\u3001\u80fd\u67e5\u8be2\u3001\u80fd\u8ddf\u5176\u4ed6\u4e1a\u52a1\u6570\u636e\u4e00\u8d77\u505a\u4e8b\u52a1<\/p>\n<p>\u7b2c\u4e09\u79cd\u5c31\u662f\u8fd9\u7bc7\u8981\u5199\u7684\u3002<\/p>\n<hr \/>\n<h3>\u4e09\u300140 \u884c\u7684 PostgreSQL \u5b9e\u73b0<\/h3>\n<p>\u8868\u7ed3\u6784\u6781\u7b80&#xff1a;<\/p>\n<p><span class=\"token keyword\">CREATE<\/span> <span class=\"token keyword\">TABLE<\/span> sessions <span class=\"token punctuation\">(<\/span><br \/>\n    session_id <span class=\"token keyword\">text<\/span> <span class=\"token keyword\">PRIMARY<\/span> <span class=\"token keyword\">KEY<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    messages   bytea <span class=\"token operator\">NOT<\/span> <span class=\"token boolean\">NULL<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    updated_at timestamptz <span class=\"token operator\">NOT<\/span> <span class=\"token boolean\">NULL<\/span> <span class=\"token keyword\">DEFAULT<\/span> <span class=\"token function\">now<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u4e00\u4e2a\u4f1a\u8bdd\u4e00\u884c&#xff0c;\u6574\u4e2a\u6d88\u606f\u5217\u8868\u5e8f\u5217\u5316\u6210\u4e00\u4e2a bytea\u3002<\/p>\n<p>\u5199&#xff1a;<\/p>\n<p><span class=\"token keyword\">func<\/span> <span class=\"token punctuation\">(<\/span>m <span class=\"token operator\">*<\/span>pgMemory<span class=\"token punctuation\">)<\/span> <span class=\"token function\">Write<\/span><span class=\"token punctuation\">(<\/span>ctx context<span class=\"token punctuation\">.<\/span>Context<span class=\"token punctuation\">,<\/span> sessionID <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">,<\/span> msgs <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">*<\/span>schema<span class=\"token punctuation\">.<\/span>Message<span class=\"token punctuation\">)<\/span> <span class=\"token builtin\">error<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    b<span class=\"token punctuation\">,<\/span> err <span class=\"token operator\">:&#061;<\/span> <span class=\"token function\">encode<\/span><span class=\"token punctuation\">(<\/span>msgs<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> err <span class=\"token operator\">!&#061;<\/span> <span class=\"token boolean\">nil<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> err<br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token boolean\">_<\/span><span class=\"token punctuation\">,<\/span> err <span class=\"token operator\">&#061;<\/span> m<span class=\"token punctuation\">.<\/span>db<span class=\"token punctuation\">.<\/span><span class=\"token function\">ExecContext<\/span><span class=\"token punctuation\">(<\/span>ctx<span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#096;<br \/>\n        INSERT INTO sessions (session_id, messages) VALUES ($1, $2)<br \/>\n        ON CONFLICT (session_id) DO UPDATE SET messages &#061; EXCLUDED.messages, updated_at &#061; now()&#096;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        sessionID<span class=\"token punctuation\">,<\/span> b<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> err<br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u8bfb&#xff1a;<\/p>\n<p><span class=\"token keyword\">func<\/span> <span class=\"token punctuation\">(<\/span>m <span class=\"token operator\">*<\/span>pgMemory<span class=\"token punctuation\">)<\/span> <span class=\"token function\">Read<\/span><span class=\"token punctuation\">(<\/span>ctx context<span class=\"token punctuation\">.<\/span>Context<span class=\"token punctuation\">,<\/span> sessionID <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">*<\/span>schema<span class=\"token punctuation\">.<\/span>Message<span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">error<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">var<\/span> b <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token builtin\">byte<\/span><br \/>\n    err <span class=\"token operator\">:&#061;<\/span> m<span class=\"token punctuation\">.<\/span>db<span class=\"token punctuation\">.<\/span><span class=\"token function\">QueryRowContext<\/span><span class=\"token punctuation\">(<\/span>ctx<span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#096;SELECT messages FROM sessions WHERE session_id &#061; $1&#096;<\/span><span class=\"token punctuation\">,<\/span> sessionID<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">Scan<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>b<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> err <span class=\"token operator\">&#061;&#061;<\/span> sql<span class=\"token punctuation\">.<\/span>ErrNoRows <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token boolean\">nil<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">nil<\/span>          <span class=\"token comment\">\/\/ \u65b0\u4f1a\u8bdd&#xff0c;\u4e0d\u662f\u9519\u8bef<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> err <span class=\"token operator\">!&#061;<\/span> <span class=\"token boolean\">nil<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token boolean\">nil<\/span><span class=\"token punctuation\">,<\/span> err<br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token function\">decode<\/span><span class=\"token punctuation\">(<\/span>b<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>sql.ErrNoRows \u90a3\u884c\u522b\u6f0f&#xff1a;**\u65b0\u4f1a\u8bdd\u6ca1\u6709\u5386\u53f2\u662f\u6b63\u5e38\u72b6\u6001&#xff0c;\u4e0d\u8be5\u5f53\u6210\u9519\u8bef\u5f80\u4e0a\u629b\u3002**\u6f0f\u4e86\u8fd9\u884c&#xff0c;\u7528\u6237\u7b2c\u4e00\u6b21\u8bf4\u8bdd\u5c31\u4f1a\u6536\u5230 500\u3002<\/p>\n<p>\u5e8f\u5217\u5316\u8ddf\u5b98\u65b9\u793a\u4f8b\u4fdd\u6301\u4e00\u81f4&#xff0c;\u7528 Gob&#xff1a;<\/p>\n<p><span class=\"token keyword\">func<\/span> <span class=\"token function\">encode<\/span><span class=\"token punctuation\">(<\/span>msgs <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">*<\/span>schema<span class=\"token punctuation\">.<\/span>Message<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token builtin\">byte<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">error<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">var<\/span> buf bytes<span class=\"token punctuation\">.<\/span>Buffer<br \/>\n    <span class=\"token keyword\">if<\/span> err <span class=\"token operator\">:&#061;<\/span> gob<span class=\"token punctuation\">.<\/span><span class=\"token function\">NewEncoder<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>buf<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">Encode<\/span><span class=\"token punctuation\">(<\/span>msgs<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> err <span class=\"token operator\">!&#061;<\/span> <span class=\"token boolean\">nil<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token boolean\">nil<\/span><span class=\"token punctuation\">,<\/span> err<br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> buf<span class=\"token punctuation\">.<\/span><span class=\"token function\">Bytes<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">nil<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u4e3a\u4ec0\u4e48\u662f Gob \u4e0d\u662f JSON&#xff1f;\u4e0b\u4e00\u8282\u5b9e\u6d4b\u3002<\/p>\n<hr \/>\n<h3>\u56db\u3001\u8dd1\u4e09\u8f6e&#xff0c;\u770b\u6d88\u606f\u5217\u8868\u600e\u4e48\u6512\u8d77\u6765<\/h3>\n<p>\u4e09\u8f6e\u5bf9\u8bdd&#xff0c;\u7b2c\u4e09\u8f6e\u95ee\u300c\u90a3\u6211\u53eb\u4ec0\u4e48\u540d\u5b57\u6765\u7740\u300d\u3002\u52a9\u624b\u7684\u56de\u590d\u662f\u6211\u5199\u6b7b\u7684&#xff08;\u6ca1\u6709 API Key&#xff09;&#xff0c;\u91cd\u70b9\u770b\u6bcf\u8f6e\u5b9e\u9645\u53d1\u7ed9\u6a21\u578b\u7684\u6d88\u606f\u5217\u8868&#xff1a;<\/p>\n<p>\u2550\u2550\u2550\u2550\u2550\u2550 \u7b2c 1 \u8f6e \u2550\u2550\u2550\u2550\u2550\u2550<br \/>\n\u7528\u6237\u8f93\u5165&#xff1a;\u6211\u53eb\u5f20\u4f1f&#xff0c;\u5728\u8d22\u52a1\u90e8<br \/>\n\u2460 \u8bfb\u51fa\u5386\u53f2&#xff1a;0 \u6761<br \/>\n\u2461 \u53d1\u7ed9\u6a21\u578b&#xff1a;2 \u6761<br \/>\n     [0] system    \u4f60\u662f\u4e00\u4e2a\u7b80\u6d01\u7684\u52a9\u624b&#xff0c;\u8bf7\u5728\u591a\u8f6e\u5bf9\u8bdd\u4e2d\u4fdd\u6301\u4e0a\u4e0b\u6587\u3002<br \/>\n     [1] user      \u6211\u53eb\u5f20\u4f1f&#xff0c;\u5728\u8d22\u52a1\u90e8<br \/>\n\u2462 \u5199\u56de\u5386\u53f2&#xff1a;2 \u6761<\/p>\n<p>\u2550\u2550\u2550\u2550\u2550\u2550 \u7b2c 2 \u8f6e \u2550\u2550\u2550\u2550\u2550\u2550<br \/>\n\u7528\u6237\u8f93\u5165&#xff1a;\u5e2e\u6211\u67e5\u4e00\u4e0b\u62a5\u9500\u7684\u622a\u6b62\u65f6\u95f4<br \/>\n\u2460 \u8bfb\u51fa\u5386\u53f2&#xff1a;2 \u6761<br \/>\n\u2461 \u53d1\u7ed9\u6a21\u578b&#xff1a;4 \u6761<br \/>\n     [0] system    \u4f60\u662f\u4e00\u4e2a\u7b80\u6d01\u7684\u52a9\u624b&#xff0c;\u8bf7\u5728\u591a\u8f6e\u5bf9\u8bdd\u4e2d\u4fdd\u6301\u4e0a\u4e0b\u6587\u3002<br \/>\n     [1] user      \u6211\u53eb\u5f20\u4f1f&#xff0c;\u5728\u8d22\u52a1\u90e8<br \/>\n     [2] assistant \u597d\u7684\u5f20\u4f1f&#xff0c;\u6709\u4ec0\u4e48\u53ef\u4ee5\u5e2e\u4f60\u7684&#xff1f;<br \/>\n     [3] user      \u5e2e\u6211\u67e5\u4e00\u4e0b\u62a5\u9500\u7684\u622a\u6b62\u65f6\u95f4<br \/>\n\u2462 \u5199\u56de\u5386\u53f2&#xff1a;4 \u6761<\/p>\n<p>\u2550\u2550\u2550\u2550\u2550\u2550 \u7b2c 3 \u8f6e \u2550\u2550\u2550\u2550\u2550\u2550<br \/>\n\u7528\u6237\u8f93\u5165&#xff1a;\u90a3\u6211\u53eb\u4ec0\u4e48\u540d\u5b57\u6765\u7740<br \/>\n\u2460 \u8bfb\u51fa\u5386\u53f2&#xff1a;4 \u6761<br \/>\n\u2461 \u53d1\u7ed9\u6a21\u578b&#xff1a;6 \u6761<br \/>\n     [0] system    \u4f60\u662f\u4e00\u4e2a\u7b80\u6d01\u7684\u52a9\u624b&#xff0c;\u8bf7\u5728\u591a\u8f6e\u5bf9\u8bdd\u4e2d\u4fdd\u6301\u4e0a\u4e0b\u6587\u3002<br \/>\n     [1] user      \u6211\u53eb\u5f20\u4f1f&#xff0c;\u5728\u8d22\u52a1\u90e8<br \/>\n     [2] assistant \u597d\u7684\u5f20\u4f1f&#xff0c;\u6709\u4ec0\u4e48\u53ef\u4ee5\u5e2e\u4f60\u7684&#xff1f;<br \/>\n     [3] user      \u5e2e\u6211\u67e5\u4e00\u4e0b\u62a5\u9500\u7684\u622a\u6b62\u65f6\u95f4<br \/>\n     [4] assistant \u8d39\u7528\u53d1\u751f\u540e 30 \u5929\u5185\u63d0\u4ea4&#xff0c;\u8d85\u671f\u4e0d\u4e88\u53d7\u7406\u3002<br \/>\n     [5] user      \u90a3\u6211\u53eb\u4ec0\u4e48\u540d\u5b57\u6765\u7740<br \/>\n\u2462 \u4e0d\u8c03 LLM\u3002\u4f46 Query(&#034;\u5f20\u4f1f&#034;) \u5728\u5386\u53f2\u91cc\u547d\u4e2d 2 \u6761 \u2014\u2014 \u540d\u5b57\u786e\u5b9e\u5e26\u8fdb\u53bb\u4e86<br \/>\n     user      \u6211\u53eb\u5f20\u4f1f&#xff0c;\u5728\u8d22\u52a1\u90e8<br \/>\n     assistant \u597d\u7684\u5f20\u4f1f&#xff0c;\u6709\u4ec0\u4e48\u53ef\u4ee5\u5e2e\u4f60\u7684&#xff1f;<\/p>\n<p>\u7b2c\u4e09\u8f6e\u90a3\u4e2a [1] user \u6211\u53eb\u5f20\u4f1f&#xff0c;\u5728\u8d22\u52a1\u90e8 \u5c31\u662f\u5168\u90e8\u7684\u79d8\u5bc6\u3002<\/p>\n<p>\u6a21\u578b\u80fd\u7b54\u5bf9\u300c\u4f60\u53eb\u5f20\u4f1f\u300d&#xff0c;\u4e0d\u662f\u56e0\u4e3a\u5b83\u8bb0\u4f4f\u4e86\u4ec0\u4e48&#xff0c;\u800c\u662f\u56e0\u4e3a\u90a3\u53e5\u8bdd\u5c31\u660e\u660e\u767d\u767d\u5199\u5728\u8fd9\u6b21\u8bf7\u6c42\u7684\u7b2c\u4e8c\u6761\u6d88\u606f\u91cc\u3002\u4f60\u628a\u5b83\u8bfb\u51fa\u6765\u62fc\u8fdb\u53bb\u4e86&#xff0c;\u5b83\u5c31&#034;\u8bb0\u5f97&#034;&#xff1b;\u4f60\u4e0d\u62fc&#xff0c;\u5b83\u5c31&#034;\u5fd8\u4e86&#034;\u3002<\/p>\n<p>\u7cfb\u7edf\u63d0\u793a\u8bcd\u91cc\u90a3\u53e5\u300c\u8bf7\u5728\u591a\u8f6e\u5bf9\u8bdd\u4e2d\u4fdd\u6301\u4e0a\u4e0b\u6587\u300d\u4e5f\u4e0d\u662f\u9b54\u6cd5\u2014\u2014\u5b83\u53ea\u662f\u8ba9\u6a21\u578b\u613f\u610f\u53bb\u5f15\u7528\u524d\u9762\u7684\u5185\u5bb9&#xff0c;\u524d\u63d0\u4ecd\u7136\u662f\u90a3\u4e9b\u5185\u5bb9\u5f97\u5728\u6d88\u606f\u5217\u8868\u91cc\u3002<\/p>\n<p>\u6ce8\u610f\u6d88\u606f\u6570\u7684\u589e\u957f&#xff1a;2 \u2192 4 \u2192 6\u3002\u6bcf\u8f6e\u52a0\u4e24\u6761&#xff08;\u7528\u6237\u4e00\u6761\u3001\u52a9\u624b\u4e00\u6761&#xff09;\u3002\u8fd9\u4e2a\u7ebf\u6027\u589e\u957f\u5c31\u662f\u7b2c\u4e94\u8282\u8981\u8bb2\u7684\u95ee\u9898\u3002<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u4e09\u4e2a\u5b9e\u9a8c<\/h3>\n<h4>\u5b9e\u9a8c A&#xff1a;Gob \u80fd\u4e0d\u80fd\u625b\u4f4f\u5de5\u5177\u8c03\u7528<\/h4>\n<p>\u5bf9\u8bdd\u5386\u53f2\u91cc\u4e0d\u53ea\u6709\u6587\u672c\u3002\u5e26\u5de5\u5177\u8c03\u7528\u7684\u4e00\u8f6e\u957f\u8fd9\u6837&#xff1a;assistant \u53d1\u8d77 tool_call&#xff0c;tool \u8fd4\u56de\u7ed3\u679c&#xff0c;\u4e24\u8005\u9760 ToolCallID \u914d\u5bf9&#xff08;\u7b2c 7 \u7bc7\u8bb2\u8fc7&#xff09;\u3002\u8fd9\u4e2a\u914d\u5bf9\u5173\u7cfb\u5982\u679c\u5728\u5e8f\u5217\u5316\u65f6\u4e22\u4e86&#xff0c;\u4e0b\u4e00\u8f6e\u8bf7\u6c42\u5c31\u4f1a\u88ab\u6a21\u578b\u62d2\u7edd\u2014\u2014\u5b83\u4f1a\u770b\u5230\u4e00\u4e2a\u6ca1\u6709\u5bf9\u5e94\u7ed3\u679c\u7684\u5de5\u5177\u8c03\u7528\u3002<\/p>\n<p>\u5b9e\u6d4b&#xff1a;<\/p>\n<p>\u2550\u2550\u2550\u2550\u2550\u2550 \u5b9e\u9a8c A&#xff1a;Gob \u5f80\u8fd4\u4f1a\u4e0d\u4f1a\u4e22\u4e1c\u897f \u2550\u2550\u2550\u2550\u2550\u2550<br \/>\n  \u7f16\u7801\u540e 2647 \u5b57\u8282&#xff0c;\u89e3\u56de 4 \u6761<br \/>\n  ToolCalls \/ ToolCallID \u5b8c\u6574\u4fdd\u7559&#xff1f; true<br \/>\n     system    sys<br \/>\n     user      \u9644\u8fd1\u6709\u4ec0\u4e48\u5ddd\u83dc\u9986<br \/>\n     assistant tool_call&#061;search_restaurant({&#034;cuisine&#034;:&#034;\u5ddd\u83dc&#034;})<br \/>\n     tool      \u8700\u9999\u56ed<\/p>\n<p>\u5b8c\u6574\u4fdd\u7559\u3002 Gob \u5904\u7406 Go \u7ed3\u6784\u4f53\u662f\u539f\u751f\u7684&#xff0c;\u5d4c\u5957\u7ed3\u6784\u3001\u5207\u7247\u3001\u5b57\u7b26\u4e32\u90fd\u4e0d\u4e22\u3002<\/p>\n<p>\u4f46\u6ce8\u610f\u90a3\u4e2a\u5b57\u8282\u6570&#xff1a;4 \u6761\u6d88\u606f\u7f16\u7801\u540e 2647 \u5b57\u8282\u3002\u8fd9\u51e0\u6761\u6d88\u606f\u7684\u6b63\u6587\u52a0\u8d77\u6765\u4e0d\u5230 40 \u4e2a\u5b57\u3002\u4e3a\u4ec0\u4e48\u8fd9\u4e48\u5927&#xff1f;<\/p>\n<p>\u56e0\u4e3a Gob \u4f1a\u628a\u7c7b\u578b\u5b9a\u4e49\u4e00\u8d77\u5199\u8fdb\u6d41\u91cc\u3002\u7b2c\u4e00\u6b21\u7f16\u7801 []*schema.Message \u65f6&#xff0c;\u5b83\u8981\u63cf\u8ff0\u6e05\u695a\u8fd9\u4e2a\u7ed3\u6784\u4f53\u6709\u54ea\u4e9b\u5b57\u6bb5\u3001\u4ec0\u4e48\u7c7b\u578b\u3001\u5d4c\u5957\u4e86\u4ec0\u4e48\u2014\u2014\u8fd9\u90e8\u5206\u662f\u56fa\u5b9a\u5f00\u9500\u3002<\/p>\n<p>\u5bf9\u6bd4\u5b9e\u9a8c C \u7684\u6570\u636e\u5c31\u5f88\u6e05\u695a\u4e86&#xff1a;<\/p>\n<table>\n<tr>\u6d88\u606f\u6570\u603b\u5b57\u8282\u5e73\u5747\u6bcf\u6761<\/tr>\n<tbody>\n<tr>\n<td>4 \u6761<\/td>\n<td>2647<\/td>\n<td>662 \u5b57\u8282<\/td>\n<\/tr>\n<tr>\n<td>200 \u6761<\/td>\n<td>15775<\/td>\n<td>79 \u5b57\u8282<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5dee\u4e86 8 \u500d\u3002 \u56fa\u5b9a\u5f00\u9500\u88ab\u644a\u8584\u4e86\u3002<\/p>\n<p>\u8fd9\u610f\u5473\u7740&#xff1a;\u5982\u679c\u4f60\u7684\u4f1a\u8bdd\u666e\u904d\u5f88\u77ed&#xff08;\u51e0\u8f6e\u5c31\u7ed3\u675f&#xff09;&#xff0c;Gob \u7684\u5143\u6570\u636e\u5f00\u9500\u5360\u6bd4\u4f1a\u975e\u5e38\u96be\u770b\u3002\u5b58\u4e00\u6761 20 \u5b57\u7684\u6d88\u606f&#xff0c;\u5b9e\u9645\u5360\u7528\u51e0\u767e\u5b57\u8282\u3002\u8fd9\u79cd\u573a\u666f\u4e0b JSON \u53cd\u800c\u66f4\u7701\u2014\u2014\u5b83\u6ca1\u6709\u7c7b\u578b\u63cf\u8ff0&#xff0c;\u4f46\u4ee3\u4ef7\u662f\u4f60\u8981\u81ea\u5df1\u4fdd\u8bc1\u5b57\u6bb5\u80fd\u6b63\u786e\u53cd\u5e8f\u5217\u5316&#xff08;schema.Message \u7684\u5b57\u6bb5\u90fd\u662f\u5bfc\u51fa\u7684&#xff0c;JSON \u53ef\u884c&#xff09;\u3002<\/p>\n<p>\u9009\u54ea\u4e2a\u53d6\u51b3\u4e8e\u4f60\u7684\u4f1a\u8bdd\u957f\u5ea6\u5206\u5e03\u3002\u5148\u91cf\u4e00\u91cf\u518d\u51b3\u5b9a&#xff0c;\u522b\u7167\u6284\u793a\u4f8b\u3002<\/p>\n<h4>\u5b9e\u9a8c B&#xff1a;Write \u662f\u8986\u76d6&#xff0c;\u4e0d\u662f\u8ffd\u52a0<\/h4>\n<p>\u8fd9\u4e2a\u63a5\u53e3\u6709\u4e2a\u5bb9\u6613\u5ffd\u7565\u7684\u8bed\u4e49&#xff1a;Write(sessionID, msgs) \u662f\u7528 msgs \u6574\u4f53\u66ff\u6362\u8fd9\u4e2a\u4f1a\u8bdd\u7684\u5386\u53f2&#xff0c;\u4e0d\u662f\u5f80\u540e\u8ffd\u52a0\u3002<\/p>\n<p>\u5355\u7ebf\u7a0b\u6ca1\u95ee\u9898\u3002\u4f46\u7528\u6237\u5728\u4e24\u4e2a\u6807\u7b7e\u9875\u540c\u65f6\u53d1\u6d88\u606f\u5462&#xff1f;<\/p>\n<p>\u2550\u2550\u2550\u2550\u2550\u2550 \u5b9e\u9a8c B&#xff1a;\u4e24\u4e2a\u8bf7\u6c42\u540c\u65f6\u5199\u4f1a\u600e\u6837 \u2550\u2550\u2550\u2550\u2550\u2550<br \/>\n  \u4e24\u4e2a\u8bf7\u6c42\u5404\u8ffd\u52a0 1 \u6761&#xff0c;\u671f\u671b 3 \u6761&#xff0c;\u5b9e\u9645 2 \u6761<br \/>\n     user      \u7b2c 0 \u6761<br \/>\n     user      \u6765\u81ea\u8bf7\u6c42 A<br \/>\n  \u2192 Write \u662f\u6574\u4f53\u8986\u76d6&#xff1a;\u540e\u5199\u7684\u8d62&#xff0c;\u5148\u5199\u7684\u90a3\u6761\u6d88\u606f\u6d88\u5931\u4e86<\/p>\n<p>\u671f\u671b 3 \u6761&#xff0c;\u5b9e\u9645 2 \u6761&#xff0c;\u8bf7\u6c42 B \u7684\u6d88\u606f\u51ed\u7a7a\u6d88\u5931\u4e86\u3002<\/p>\n<p>\u8fc7\u7a0b\u662f\u8fd9\u6837\u7684&#xff1a;<\/p>\n<p>\u8bf7\u6c42 A&#xff1a;\u8bfb\u51fa [\u7b2c0\u6761] \u2192 \u62fc\u6210 [\u7b2c0\u6761, A] \u2192 \u5199\u56de<br \/>\n\u8bf7\u6c42 B&#xff1a;\u8bfb\u51fa [\u7b2c0\u6761] \u2192 \u62fc\u6210 [\u7b2c0\u6761, B] \u2192 \u5199\u56de<\/p>\n<p>\u4e24\u4e2a\u8bf7\u6c42\u90fd\u57fa\u4e8e\u540c\u4e00\u4efd\u65e7\u5386\u53f2\u505a\u4e86\u8ffd\u52a0&#xff0c;\u7136\u540e\u5404\u81ea\u6574\u4f53\u5199\u56de\u2014\u2014\u540e\u5199\u7684\u90a3\u4e2a\u628a\u5148\u5199\u7684\u8986\u76d6\u4e86\u3002\u8fd9\u662f\u5178\u578b\u7684\u300c\u8bfb-\u6539-\u5199\u300d\u7ade\u6001&#xff08;lost update&#xff09;\u3002<\/p>\n<p>\u8fd9\u4e2a bug \u5728\u6d4b\u8bd5\u73af\u5883\u51e0\u4e4e\u649e\u4e0d\u5230&#xff08;\u4f60\u4e0d\u4f1a\u624b\u901f\u5feb\u5230\u540c\u65f6\u53d1\u4e24\u6761&#xff09;&#xff0c;\u4f46\u7ebf\u4e0a\u4e00\u5b9a\u4f1a\u53d1\u751f&#xff1a;\u7528\u6237\u70b9\u4e86\u4e24\u6b21\u53d1\u9001\u3001\u524d\u7aef\u91cd\u8bd5\u3001\u591a\u8bbe\u5907\u540c\u65f6\u5728\u7ebf\u3002\u8868\u73b0\u662f\u300c\u6d88\u606f\u5076\u5c14\u4e22\u4e00\u6761\u300d&#xff0c;\u6781\u96be\u590d\u73b0\u3002<\/p>\n<p>\u4e09\u79cd\u4fee\u6cd5&#xff0c;\u4ee3\u4ef7\u9012\u589e&#xff1a;<\/p>\n<li>\u4e50\u89c2\u9501&#xff1a;\u8868\u91cc\u52a0 version \u5217&#xff0c;WHERE version &#061; $old&#xff0c;\u66f4\u65b0\u5931\u8d25\u5c31\u91cd\u8bfb\u91cd\u8bd5\u3002\u6539\u52a8\u5c0f&#xff0c;\u9002\u5408\u51b2\u7a81\u5c11\u7684\u573a\u666f<\/li>\n<li>\u6570\u636e\u5e93\u7aef\u8ffd\u52a0&#xff1a;\u4e0d\u6574\u4f53\u8986\u76d6&#xff0c;\u6539\u6210 UPDATE &#8230; SET messages &#061; messages || $new\u3002\u8981\u6c42\u5b58\u50a8\u683c\u5f0f\u652f\u6301\u8ffd\u52a0&#xff08;jsonb \u6570\u7ec4\u53ef\u4ee5&#xff0c;bytea \u7684 Gob \u4e0d\u884c&#xff09;<\/li>\n<li>\u4e00\u6761\u6d88\u606f\u4e00\u884c&#xff1a;\u5f7b\u5e95\u4e0d\u7528\u300c\u6574\u4f53\u8986\u76d6\u300d\u8fd9\u4e2a\u6a21\u578b\u3002\u4ee3\u4ef7\u662f\u6bcf\u6b21\u8bfb\u8981 ORDER BY seq \u62fc\u88c5<\/li>\n<p>**\u751f\u4ea7\u4e0a\u57fa\u672c\u90fd\u4f1a\u8d70\u5230\u7b2c 3 \u79cd\u3002**\u4e00\u6761\u4e00\u884c\u4e4b\u540e&#xff0c;\u4f60\u624d\u80fd\u505a\u5206\u9875\u52a0\u8f7d\u3001\u5355\u6761\u5220\u9664&#xff08;\u7528\u6237\u64a4\u56de&#xff09;\u3001\u6309\u65f6\u95f4\u8303\u56f4\u67e5\u8be2\u3001\u53ea\u8bfb\u6700\u8fd1 N \u6761\u2014\u2014\u8fd9\u4e9b\u7528 blob \u5b58\u6cd5\u4e00\u4e2a\u90fd\u505a\u4e0d\u4e86\u3002<\/p>\n<h4>\u5b9e\u9a8c C&#xff1a;\u5386\u53f2\u4f1a\u4e00\u76f4\u957f\u4e0b\u53bb<\/h4>\n<p>\u2550\u2550\u2550\u2550\u2550\u2550 \u5b9e\u9a8c C&#xff1a;\u5386\u53f2\u957f\u5ea6\u4e0e\u4f53\u79ef \u2550\u2550\u2550\u2550\u2550\u2550<br \/>\n  100 \u8f6e\u5bf9\u8bdd &#061; 200 \u6761\u6d88\u606f&#xff0c;4184 \u4e2a\u5b57\u7b26<br \/>\n  Gob \u7f16\u7801\u540e 15775 \u5b57\u8282&#xff0c;\u5e93\u91cc\u5b58\u4e86 15775 \u5b57\u8282<br \/>\n  \u2192 \u6bcf\u4e00\u8f6e\u90fd\u8981\u628a\u8fd9 200 \u6761\u5168\u90e8\u8bfb\u51fa\u6765\u3001\u62fc\u8fdb prompt\u3001\u518d\u6574\u4f53\u5199\u56de<\/p>\n<p>100 \u8f6e\u5bf9\u8bdd\u4e0d\u7b97\u591a\u2014\u2014\u4e00\u4e2a\u5ba2\u670d\u4f1a\u8bdd\u804a\u534a\u5c0f\u65f6\u5c31\u6709\u4e86\u3002\u4f46\u6b64\u65f6&#xff1a;<\/p>\n<ul>\n<li>\u6bcf\u4e00\u8f6e\u90fd\u8981\u4ece\u6570\u636e\u5e93\u8bfb 15KB\u3001\u53cd\u5e8f\u5217\u5316 200 \u6761\u6d88\u606f<\/li>\n<li>\u6bcf\u4e00\u8f6e\u90fd\u8981\u628a\u8fd9 200 \u6761\u585e\u8fdb prompt \u53d1\u7ed9\u6a21\u578b<\/li>\n<li>\u6bcf\u4e00\u8f6e\u90fd\u8981\u91cd\u65b0\u5e8f\u5217\u5316 200 \u6761\u3001\u5199\u56de 15KB<\/li>\n<\/ul>\n<p>\u7b2c\u4e8c\u6761\u662f\u771f\u6b63\u7684\u75db\u70b9\u30024184 \u4e2a\u5b57\u7b26\u5927\u7ea6\u662f 3000 \u4e2a token&#xff08;\u4e2d\u6587\u7c97\u7b97&#xff09;&#xff0c;\u6bcf\u8f6e\u5bf9\u8bdd\u4f60\u90fd\u8981\u4e3a\u8fd9 3000 \u4e2a token \u4ed8\u4e00\u6b21\u94b1&#xff0c;\u800c\u4e14\u7528\u6237\u95ee\u7684\u53ef\u80fd\u53ea\u662f\u300c\u8c22\u8c22\u300d\u3002<\/p>\n<p>\u66f4\u7cdf\u7684\u662f\u5b83\u4f1a\u649e\u4e0a\u4e0a\u4e0b\u6587\u7a97\u53e3\u7684\u786c\u4e0a\u9650\u3002\u5230\u90a3\u65f6\u8bf7\u6c42\u4f1a\u76f4\u63a5\u62a5\u9519\u2014\u2014\u800c\u62a5\u9519\u53d1\u751f\u5728\u4f60\u5df2\u7ecf\u4ed8\u4e86\u68c0\u7d22\u548c\u5e8f\u5217\u5316\u6210\u672c\u4e4b\u540e\u3002<\/p>\n<p>\u8fd9\u4e2a\u95ee\u9898\u6709\u4e09\u79cd\u89e3\u6cd5&#xff0c;\u5206\u522b\u662f\u540e\u9762\u4e09\u7bc7\u7684\u4e3b\u9898&#xff1a;<\/p>\n<ul>\n<li>\u88c1\u526a&#xff1a;\u53ea\u5e26\u6700\u8fd1 N \u8f6e&#xff08;\u7b2c 83 \u7bc7&#xff09;<\/li>\n<li>\u6458\u8981&#xff1a;\u628a\u65e9\u671f\u5bf9\u8bdd\u538b\u7f29\u6210\u4e00\u6bb5\u6458\u8981&#xff08;\u7b2c 82 \u7bc7&#xff09;<\/li>\n<li>\u5206\u5c42&#xff1a;\u628a\u300c\u7528\u6237\u662f\u8c01\u300d\u4ece\u300c\u8bf4\u8fc7\u4ec0\u4e48\u300d\u91cc\u62bd\u51fa\u6765\u5355\u72ec\u5b58&#xff0c;\u4e0d\u5360\u5bf9\u8bdd\u5386\u53f2\u7684\u4f4d\u7f6e&#xff08;\u7b2c 78\u300181 \u7bc7&#xff09;<\/li>\n<\/ul>\n<hr \/>\n<h3>\u516d\u3001\u8fd9\u4e2a\u6700\u7b80\u7248\u8fd8\u5dee\u4ec0\u4e48<\/h3>\n<p>\u6309\u4e25\u91cd\u7a0b\u5ea6\u6392&#xff1a;<\/p>\n<p>\u2460 \u6ca1\u6709\u7528\u6237\u9694\u79bb\u2014\u2014\u6700\u81f4\u547d\u3002<\/p>\n<p>\u6211\u4eec\u7684 key \u53ea\u6709 session_id\u3002\u5982\u679c session ID \u662f\u53ef\u731c\u7684&#xff08;\u6bd4\u5982\u81ea\u589e\u6570\u5b57&#xff09;&#xff0c;\u6362\u4e00\u4e2a ID \u5c31\u80fd\u8bfb\u5230\u522b\u4eba\u7684\u5bf9\u8bdd\u3002\u8bb0\u5fc6\u6bd4 RAG \u66f4\u9700\u8981\u9694\u79bb&#xff0c;\u56e0\u4e3a\u91cc\u9762\u662f\u7528\u6237\u4eb2\u53e3\u8bf4\u7684\u8bdd\u3002<\/p>\n<p>\u751f\u4ea7\u4e0a\u81f3\u5c11\u8981&#xff1a;\u8868\u91cc\u5b58 tenant_id &#043; user_id&#xff0c;\u67e5\u8be2\u65f6\u5e26\u4e0a&#xff0c;\u5e76\u4e14\u7528\u884c\u7ea7\u5b89\u5168&#xff08;RLS&#xff09;\u505a\u515c\u5e95\u2014\u2014\u4e0d\u80fd\u53ea\u9760\u5e94\u7528\u5c42\u8bb0\u5f97\u52a0 WHERE \u6761\u4ef6\u3002\u7b2c 11 \u7bc7\u8bb2\u8fc7\u8fd9\u5957\u3002<\/p>\n<p>**\u2461 \u5e76\u53d1\u8986\u76d6\u3002**\u5b9e\u9a8c B \u90a3\u4e2a&#xff0c;\u4e0a\u4e50\u89c2\u9501\u6216\u6539\u6210\u4e00\u6761\u4e00\u884c\u3002<\/p>\n<p>**\u2462 \u65e0\u9650\u589e\u957f\u3002**\u5b9e\u9a8c C \u90a3\u4e2a&#xff0c;\u81f3\u5c11\u8981\u6709\u4e2a\u4e0a\u9650\u3002<\/p>\n<p>**\u2463 \u6ca1\u6709\u8fc7\u671f\u6e05\u7406\u3002**\u4f1a\u8bdd\u7ed3\u675f\u540e\u8fd9\u884c\u6570\u636e\u6c38\u8fdc\u8eba\u5728\u5e93\u91cc\u3002\u5408\u89c4\u4e0a\u901a\u5e38\u6709\u4fdd\u7559\u671f\u9650\u8981\u6c42&#xff08;\u6bd4\u5982 90 \u5929&#xff09;&#xff0c;\u9700\u8981\u5b9a\u65f6\u6e05\u7406\u6216\u8005\u5206\u533a\u8868\u6309\u65f6\u95f4\u8f6e\u8f6c\u3002<\/p>\n<p>**\u2464 \u5185\u5bb9\u662f\u660e\u6587\u3002**\u7528\u6237\u53ef\u80fd\u5728\u5bf9\u8bdd\u91cc\u8bf4\u51fa\u624b\u673a\u53f7\u3001\u8eab\u4efd\u8bc1\u53f7\u3002\u751f\u4ea7\u4e0a\u8981\u4e48\u8131\u654f\u540e\u518d\u5b58&#xff0c;\u8981\u4e48\u6574\u5217\u52a0\u5bc6\u3002\u8fd9\u4e2a\u8bdd\u9898\u5728 Part 15\u3002<\/p>\n<p>\u2465 \u6ca1\u6709\u533a\u5206\u300c\u77ed\u671f\u300d\u548c\u300c\u957f\u671f\u300d\u3002\u300c\u6211\u53eb\u5f20\u4f1f\u300d\u8fd9\u4ef6\u4e8b&#xff0c;\u503c\u5f97\u8bb0\u4e00\u8f88\u5b50&#xff1b;\u300c\u5e2e\u6211\u67e5\u62a5\u9500\u622a\u6b62\u65f6\u95f4\u300d\u8fd9\u53e5&#xff0c;\u4f1a\u8bdd\u7ed3\u675f\u5c31\u53ef\u4ee5\u6254\u4e86\u3002\u73b0\u5728\u5b83\u4eec\u6df7\u5728\u540c\u4e00\u4e2a\u6570\u7ec4\u91cc&#xff0c;\u540c\u751f\u540c\u706d\u2014\u2014\u8981\u4e48\u4e00\u8d77\u7559\u7740\u6d6a\u8d39 token&#xff0c;\u8981\u4e48\u4e00\u8d77\u5220\u6389\u4e22\u5931\u7528\u6237\u753b\u50cf\u3002<\/p>\n<p>\u7b2c\u516d\u70b9\u5c31\u662f\u4e0b\u4e00\u7bc7\u7684\u4e3b\u9898\u3002<\/p>\n<hr \/>\n<h3>\u5c0f\u7ed3<\/h3>\n<ul>\n<li>Eino \u6ca1\u6709\u5b98\u65b9 memory \u7ec4\u4ef6&#xff08;v0.9.13&#xff09;&#xff0c;\u5b98\u65b9\u793a\u4f8b\u81ea\u5e26\u4e00\u4e2a\u4e09\u65b9\u6cd5\u63a5\u53e3&#xff1a;Write \/ Read \/ Query&#xff0c;Query \u662f\u5b50\u4e32\u5339\u914d\u4e0d\u662f\u5411\u91cf\u68c0\u7d22<\/li>\n<li>\u8bb0\u5fc6\u6ca1\u6709\u9b54\u6cd5&#xff1a;\u8bfb\u51fa\u6765\u3001\u62fc\u4e0a\u53bb\u3001\u5199\u56de\u53bb\u3002\u6a21\u578b API \u672c\u6765\u65e0\u72b6\u6001&#xff0c;\u6240\u8c13\u8bb0\u5fc6\u5c31\u662f\u4f60\u628a\u5386\u53f2\u6570\u7ec4\u5b58\u5728\u54ea<\/li>\n<li>\u6a21\u578b\u7b54\u5bf9\u300c\u4f60\u53eb\u5f20\u4f1f\u300d&#xff0c;\u662f\u56e0\u4e3a\u90a3\u53e5\u8bdd\u5c31\u5728\u672c\u6b21\u8bf7\u6c42\u7684\u7b2c 2 \u6761\u6d88\u606f\u91cc&#xff0c;\u4e0d\u662f\u5b83\u771f\u7684\u8bb0\u4f4f\u4e86<\/li>\n<li>Gob \u5b8c\u6574\u4fdd\u7559 ToolCalls \u548c ToolCallID&#xff0c;\u4f46\u56fa\u5b9a\u5f00\u9500\u5927&#xff1a;4 \u6761\u6d88\u606f\u5e73\u5747\u6bcf\u6761 662 \u5b57\u8282&#xff0c;200 \u6761\u65f6\u964d\u5230 79 \u5b57\u8282\u3002\u77ed\u4f1a\u8bdd\u591a\u7684\u573a\u666f\u8981\u91cf\u4e00\u91cf\u518d\u9009\u5e8f\u5217\u5316\u683c\u5f0f<\/li>\n<li>Write \u662f\u6574\u4f53\u8986\u76d6&#xff1a;\u5b9e\u6d4b\u4e24\u4e2a\u5e76\u53d1\u8bf7\u6c42\u5404\u8ffd\u52a0\u4e00\u6761&#xff0c;\u6700\u540e\u53ea\u5269\u4e00\u6761\u3002\u7ebf\u4e0a\u8868\u73b0\u662f\u300c\u5076\u5c14\u4e22\u6d88\u606f\u300d\u4e14\u6781\u96be\u590d\u73b0<\/li>\n<li>\u751f\u4ea7\u4e0a\u8fdf\u65e9\u8981\u6539\u6210\u4e00\u6761\u6d88\u606f\u4e00\u884c&#xff0c;\u5426\u5219\u5206\u9875\u3001\u64a4\u56de\u3001\u6309\u65f6\u95f4\u67e5\u8be2\u5168\u505a\u4e0d\u4e86<\/li>\n<li>100 \u8f6e\u5bf9\u8bdd &#061; 200 \u6761\u6d88\u606f &#061; \u6bcf\u8f6e\u591a\u82b1 3000 token&#xff0c;\u88c1\u526a \/ \u6458\u8981 \/ \u5206\u5c42\u662f\u540e\u9762\u4e09\u7bc7\u7684\u4e3b\u9898<\/li>\n<li>\u6700\u7f3a\u7684\u662f\u7528\u6237\u9694\u79bb&#xff1a;\u8bb0\u5fc6\u4e32\u4e86\u4e0d\u662f\u7b54\u5f97\u4e0d\u597d&#xff0c;\u662f\u9690\u79c1\u4e8b\u6545<\/li>\n<\/ul>\n<p>\u4e0b\u4e00\u7bc7\u8bb2\u4e09\u5c42\u8bb0\u5fc6\u8bbe\u8ba1&#xff1a;user \/ agent \/ session \u4e3a\u4ec0\u4e48\u8981\u5206\u4e09\u5c42&#xff0c;\u300c\u6211\u53eb\u5f20\u4f1f\u300d\u548c\u300c\u5e2e\u6211\u67e5\u62a5\u9500\u65f6\u95f4\u300d\u8fd9\u4e24\u53e5\u8bdd\u51ed\u4ec0\u4e48\u533a\u522b\u5bf9\u5f85&#xff0c;\u4ee5\u53ca\u5206\u5c42\u4e4b\u540e\u8bfb\u5199\u8def\u5f84\u600e\u4e48\u53d8\u3002<\/p>\n<hr \/>\n<p>\u4ee3\u7801\u72b6\u6001\u8bf4\u660e&#xff1a;<\/p>\n<p>\u5168\u90e8\u8f93\u51fa\u771f\u673a\u8fd0\u884c\u3001\u539f\u6837\u7c98\u8d34\u3002\u6570\u636e\u5e93\u662f\u672c\u5730 PostgreSQL 18.4&#xff0c;\u5168\u7a0b\u5728\u4e34\u65f6 schema e77demo \u5185\u64cd\u4f5c&#xff0c;\u8dd1\u5b8c DROP SCHEMA e77demo CASCADE&#xff0c;\u672a\u89e6\u78b0\u4e1a\u52a1\u8868\u3002<\/p>\n<p>\u6ca1\u6709\u8c03\u7528\u4efb\u4f55 LLM&#xff08;\u65e0 API Key&#xff09;\u3002\u4e09\u8f6e\u5bf9\u8bdd\u91cc\u52a9\u624b\u7684\u56de\u590d\u662f\u6211\u5199\u6b7b\u7684\u5e38\u91cf&#xff0c;\u91cd\u70b9\u5728\u4e8e\u5c55\u793a\u300c\u6bcf\u8f6e\u5b9e\u9645\u53d1\u7ed9\u6a21\u578b\u7684\u6d88\u606f\u5217\u8868\u300d\u2014\u2014\u90a3\u90e8\u5206\u662f\u771f\u5b9e\u62fc\u88c5\u51fa\u6765\u7684\u3002<\/p>\n<p>\u63a5\u53e3\u5b9a\u4e49\u4e0e Gob \u5e8f\u5217\u5316\u5f15\u81ea eino-examples\/flow\/agent\/react\/memory_example\/&#xff0c;PostgreSQL \u5b9e\u73b0\u662f\u6211\u7167\u7740\u793a\u4f8b\u7684 inmem \/ redis \u7248\u672c\u5199\u7684\u7b2c\u4e09\u79cd\u3002<\/p>\n<p>\u5bf9\u8bdd\u5185\u5bb9\u4e2d\u7684\u300c\u5f20\u4f1f\u300d\u662f\u865a\u6784\u4eba\u7269&#xff0c;\u65e0\u771f\u5b9e\u4e2a\u4eba\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7cfb\u5217\u300c\u4f01\u4e1a\u7ea7 AI Agent \u5b9e\u73b0\u62c6\u89e3\u300dE63 \u7bc7&#xff0c;Part 14 \u8bb0\u5fc6\u7bc7\u7b2c\u4e00\u7ae0\u3002\u4e0a\u4e00\u7bc7\u6536\u5b8c\u4e86 RAG\u2014\u2014\u90a3\u89e3\u51b3\u7684\u662f\u300cAgent \u61c2\u4e1a\u52a1\u300d\u3002\u8fd9\u7bc7\u5f00\u59cb\u8bb2\u8bb0\u5fc6&#xff0c;\u89e3\u51b3\u7684\u662f\u300cAgent \u8bb0\u5f97\u4f60\u300d\u3002 \u5148\u7ed9\u4e00\u4e2a\u53ef\u80fd\u8ba9\u4f60\u610f\u5916\u7684\u4e8b\u5b9e&#xff1a;Eino \u6846\u67b6\u91cc\u6ca1\u6709\u5b98\u65b9\u7684 memory \u7ec4\u4ef6\u3002\u8bb0\u5fc6\u4e0d\u662f\u6846\u67b6\u5e2e\u4f60\u505a\u7684\u4e8b&#xff0c;\u662f\u4f60\u81ea\u5df1\u62fc\u51fa\u6765\u7684\u3002\u8fd9\u7bc7\u5c31\u628a\u8fd9\u5341\u51e0\u884c\u62fc\u88c5\u4ee3\u7801\u62c6\u5f00\u770b\u3002 \u5148\u5206\u6e05\u695a&#xff1a;\u8bb0\u5fc6\u548c RAG \u4e0d\u662f\u4e00\u56de\u4e8b<br \/>\n\u4e24\u8005\u90fd\u662f\u300c\u5b58\u4e1c\u897f\u3001\u67e5\u4e1c\u897f\u3001<\/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":[8006,9109,74,66,954,4119],"topic":[],"class_list":["post-91625","post","type-post","status-publish","format-standard","hentry","category-server","tag-pgvector","tag-9109","tag-agent","tag-ai","tag-postgresql","tag-rag"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6700\u7b80\u8bb0\u5fc6\uff1a\u8ba9 Agent \u8bb0\u4f4f\u4f60\u7684\u540d\u5b57\uff08\u7b2c77\u7bc7-E63\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\/91625.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6700\u7b80\u8bb0\u5fc6\uff1a\u8ba9 Agent \u8bb0\u4f4f\u4f60\u7684\u540d\u5b57\uff08\u7b2c77\u7bc7-E63\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u7cfb\u5217\u300c\u4f01\u4e1a\u7ea7 AI Agent \u5b9e\u73b0\u62c6\u89e3\u300dE63 \u7bc7&#xff0c;Part 14 \u8bb0\u5fc6\u7bc7\u7b2c\u4e00\u7ae0\u3002\u4e0a\u4e00\u7bc7\u6536\u5b8c\u4e86 RAG\u2014\u2014\u90a3\u89e3\u51b3\u7684\u662f\u300cAgent \u61c2\u4e1a\u52a1\u300d\u3002\u8fd9\u7bc7\u5f00\u59cb\u8bb2\u8bb0\u5fc6&#xff0c;\u89e3\u51b3\u7684\u662f\u300cAgent \u8bb0\u5f97\u4f60\u300d\u3002 \u5148\u7ed9\u4e00\u4e2a\u53ef\u80fd\u8ba9\u4f60\u610f\u5916\u7684\u4e8b\u5b9e&#xff1a;Eino \u6846\u67b6\u91cc\u6ca1\u6709\u5b98\u65b9\u7684 memory \u7ec4\u4ef6\u3002\u8bb0\u5fc6\u4e0d\u662f\u6846\u67b6\u5e2e\u4f60\u505a\u7684\u4e8b&#xff0c;\u662f\u4f60\u81ea\u5df1\u62fc\u51fa\u6765\u7684\u3002\u8fd9\u7bc7\u5c31\u628a\u8fd9\u5341\u51e0\u884c\u62fc\u88c5\u4ee3\u7801\u62c6\u5f00\u770b\u3002 \u5148\u5206\u6e05\u695a&#xff1a;\u8bb0\u5fc6\u548c RAG \u4e0d\u662f\u4e00\u56de\u4e8b \u4e24\u8005\u90fd\u662f\u300c\u5b58\u4e1c\u897f\u3001\u67e5\u4e1c\u897f\u3001\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/91625.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-07T23:49:08+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\/91625.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/91625.html\",\"name\":\"\u6700\u7b80\u8bb0\u5fc6\uff1a\u8ba9 Agent \u8bb0\u4f4f\u4f60\u7684\u540d\u5b57\uff08\u7b2c77\u7bc7-E63\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-07T23:49:08+00:00\",\"dateModified\":\"2026-08-07T23:49:08+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/91625.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/91625.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/91625.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6700\u7b80\u8bb0\u5fc6\uff1a\u8ba9 Agent \u8bb0\u4f4f\u4f60\u7684\u540d\u5b57\uff08\u7b2c77\u7bc7-E63\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":"\u6700\u7b80\u8bb0\u5fc6\uff1a\u8ba9 Agent \u8bb0\u4f4f\u4f60\u7684\u540d\u5b57\uff08\u7b2c77\u7bc7-E63\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\/91625.html","og_locale":"zh_CN","og_type":"article","og_title":"\u6700\u7b80\u8bb0\u5fc6\uff1a\u8ba9 Agent \u8bb0\u4f4f\u4f60\u7684\u540d\u5b57\uff08\u7b2c77\u7bc7-E63\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u7cfb\u5217\u300c\u4f01\u4e1a\u7ea7 AI Agent \u5b9e\u73b0\u62c6\u89e3\u300dE63 \u7bc7&#xff0c;Part 14 \u8bb0\u5fc6\u7bc7\u7b2c\u4e00\u7ae0\u3002\u4e0a\u4e00\u7bc7\u6536\u5b8c\u4e86 RAG\u2014\u2014\u90a3\u89e3\u51b3\u7684\u662f\u300cAgent \u61c2\u4e1a\u52a1\u300d\u3002\u8fd9\u7bc7\u5f00\u59cb\u8bb2\u8bb0\u5fc6&#xff0c;\u89e3\u51b3\u7684\u662f\u300cAgent \u8bb0\u5f97\u4f60\u300d\u3002 \u5148\u7ed9\u4e00\u4e2a\u53ef\u80fd\u8ba9\u4f60\u610f\u5916\u7684\u4e8b\u5b9e&#xff1a;Eino \u6846\u67b6\u91cc\u6ca1\u6709\u5b98\u65b9\u7684 memory \u7ec4\u4ef6\u3002\u8bb0\u5fc6\u4e0d\u662f\u6846\u67b6\u5e2e\u4f60\u505a\u7684\u4e8b&#xff0c;\u662f\u4f60\u81ea\u5df1\u62fc\u51fa\u6765\u7684\u3002\u8fd9\u7bc7\u5c31\u628a\u8fd9\u5341\u51e0\u884c\u62fc\u88c5\u4ee3\u7801\u62c6\u5f00\u770b\u3002 \u5148\u5206\u6e05\u695a&#xff1a;\u8bb0\u5fc6\u548c RAG \u4e0d\u662f\u4e00\u56de\u4e8b \u4e24\u8005\u90fd\u662f\u300c\u5b58\u4e1c\u897f\u3001\u67e5\u4e1c\u897f\u3001","og_url":"https:\/\/www.wsisp.com\/helps\/91625.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-07T23:49:08+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\/91625.html","url":"https:\/\/www.wsisp.com\/helps\/91625.html","name":"\u6700\u7b80\u8bb0\u5fc6\uff1a\u8ba9 Agent \u8bb0\u4f4f\u4f60\u7684\u540d\u5b57\uff08\u7b2c77\u7bc7-E63\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-07T23:49:08+00:00","dateModified":"2026-08-07T23:49:08+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/91625.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/91625.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/91625.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u6700\u7b80\u8bb0\u5fc6\uff1a\u8ba9 Agent \u8bb0\u4f4f\u4f60\u7684\u540d\u5b57\uff08\u7b2c77\u7bc7-E63\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\/91625","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=91625"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/91625\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=91625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=91625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=91625"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=91625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}