{"componentChunkName":"component---src-templates-acg-portal-new-template-tsx","path":"/8mpl4uawo","result":{"data":{"markdownRemark":{"html":"<p>您可以根据 Agent 类型、技术栈和业务控制要求，选择更合适的接入方式。三种接入方式的主要区别在于：<strong>记忆调用由谁触发、是否需要写代码、是否可以跨客户端复用</strong>。</p>\n<h1 id=\"方式对比\"><a href=\"#%E6%96%B9%E5%BC%8F%E5%AF%B9%E6%AF%94\" aria-label=\"方式对比 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>方式对比</h1>\n<table>\n<thead>\n<tr>\n<th>接入方式</th>\n<th>接入体验</th>\n<th>是否替代原生记忆</th>\n<th>适合场景</th>\n<th>典型对象</th>\n<th>详细文档</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>REST API</td>\n<td>任何语言都可以直接通过 HTTP 调用</td>\n<td>不会</td>\n<td>最通用、最透明，便于后端服务接入</td>\n<td>Java、PHP、Ruby、Shell、低代码平台、自研系统</td>\n<td><a href=\"https://cloud.baidu.com/doc/VDB/s/gmpl4ub1a\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">API 接入</a></td>\n</tr>\n<tr>\n<td>MCP</td>\n<td>将记忆能力注册为标准工具，由 Agent 自主调用</td>\n<td>不会</td>\n<td>希望一个服务兼容多个 MCP 客户端</td>\n<td>Cursor、Windsurf、Claude Desktop、VS Code、Claude Code</td>\n<td><a href=\"https://cloud.baidu.com/doc/VDB/s/Impl4ub3m\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">MCP 接入</a></td>\n</tr>\n<tr>\n<td>Skill</td>\n<td>通过指令文件教 Agent 何时使用 CLI 或 API</td>\n<td>不会</td>\n<td>编程 Agent 可执行命令，需要精细控制调用时机</td>\n<td>Claude Code、OpenCode、Codex CLI、自建 coding agent</td>\n<td><a href=\"https://cloud.baidu.com/doc/VDB/s/Ampl4ub5t\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Skill 接入</a></td>\n</tr>\n</tbody>\n</table>\n<h1 id=\"推荐选择\"><a href=\"#%E6%8E%A8%E8%8D%90%E9%80%89%E6%8B%A9\" aria-label=\"推荐选择 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>推荐选择</h1>\n<table>\n<thead>\n<tr>\n<th>使用需求</th>\n<th>推荐方式</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>只想快速给现有 Agent 增加记忆能力</td>\n<td>优先选择 MCP</td>\n</tr>\n<tr>\n<td>需要跨多个工具复用同一套记忆服务</td>\n<td>优先选择 MCP</td>\n</tr>\n<tr>\n<td>需要在业务流程中精确控制写入和检索</td>\n<td>选择 REST API</td>\n</tr>\n<tr>\n<td>需要自定义 Agent 的记忆调用行为和触发规则</td>\n<td>选择 Skill</td>\n</tr>\n</tbody>\n</table>\n<blockquote>\n<p><strong>多租户建议：</strong> 需要多 Agent 团队共享记忆时，使用同一个 Bank 并用 tags 区分用户、项目或 Agent；需要严格用户隔离时，每个用户一个 Bank，或强制使用 <code>user:xxx</code> 标签和 <code>all_strict</code> 匹配。</p>\n</blockquote>\n<h1 id=\"信息填写\"><a href=\"#%E4%BF%A1%E6%81%AF%E5%A1%AB%E5%86%99\" aria-label=\"信息填写 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>信息填写</h1>\n<table>\n<thead>\n<tr>\n<th>信息</th>\n<th>填写位置</th>\n<th>注意事项</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>API Base URL</td>\n<td>MCP 配置的 URL、Skill 模板或 REST 请求 base URL</td>\n<td><code>https://cloud.memory.bj.baidubce.com/api</code>，注意：已包含 <code>/api</code>，不要再额外拼接 <code>/api</code>，接口路径直接在它后面拼接。</td>\n</tr>\n<tr>\n<td>API Key</td>\n<td>认证字段或 <code>Authorization</code> 请求头</td>\n<td>只放在安全配置中，不写入文档、截图、前端代码或公开仓库</td>\n</tr>\n<tr>\n<td>Bank ID</td>\n<td>MCP 的 URL 路径（单库模式）、Skill 模板或请求体 <code>bank_id</code></td>\n<td>按用户、项目或团队规划，避免多个无关租户混用</td>\n</tr>\n<tr>\n<td>Tags</td>\n<td>Retain、Recall、Reflect 参数</td>\n<td>用于范围过滤，不建议用作内容分类</td>\n</tr>\n</tbody>\n</table>","fields":{"slug":"8mpl4uawo","title":"接入方式总览","date":"2026-05-27","extractedHeadings":[]},"headings":[{"value":"方式对比","depth":1},{"value":"推荐选择","depth":1},{"value":"信息填写","depth":1}]}},"pageContext":{"isCreatedByStatefulCreatePages":false,"slug":"8mpl4uawo","prev":{"id":"hmpl4ubi0","name":"操作指南","path":"hmpl4ubi0","filePath":"Agent 记忆服务/操作指南/最佳实践.md","seo":null,"parentIds":["fmpl4uat3","umpl4ubf2"],"parents":[{"id":"fmpl4uat3","documentId":"89600c3e-96c9-4def-b9d8-08dad3b1f7fb","name":"Agent 记忆服务","repoName":"VDB","filePath":"Agent 记忆服务","disabled":false,"path":"fmpl4uat3","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":""},{"id":"umpl4ubf2","documentId":"3234ae0f-1e04-4fc3-85d1-fa2be5908f1e","name":"操作指南","repoName":"VDB","filePath":"Agent 记忆服务/操作指南","disabled":false,"path":"umpl4ubf2","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":""}]},"next":{"id":"ampl4uaua","name":"API Key 管理","path":"ampl4uaua","filePath":"Agent 记忆服务/接入方式/API Key 管理.md","seo":null,"parentIds":["fmpl4uat3","impl4uatp"],"parents":[{"id":"fmpl4uat3","documentId":"89600c3e-96c9-4def-b9d8-08dad3b1f7fb","name":"Agent 记忆服务","repoName":"VDB","filePath":"Agent 记忆服务","disabled":false,"path":"fmpl4uat3","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":""},{"id":"impl4uatp","documentId":"045943e2-0a50-4db3-9eca-e3aca899aa1e","name":"接入方式","repoName":"VDB","filePath":"Agent 记忆服务/接入方式","disabled":false,"path":"impl4uatp","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":""}]},"parents":[{"id":"fmpl4uat3","documentId":"89600c3e-96c9-4def-b9d8-08dad3b1f7fb","name":"Agent 记忆服务","repoName":"VDB","filePath":"Agent 记忆服务","disabled":false,"path":"fmpl4uat3","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":""},{"id":"impl4uatp","documentId":"045943e2-0a50-4db3-9eca-e3aca899aa1e","name":"接入方式","repoName":"VDB","filePath":"Agent 记忆服务/接入方式","disabled":false,"path":"impl4uatp","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":""}],"specificSeo":null}}}