agentmemory-rest-api
它能做什么
这项技能说明 agentmemory 服务器的 HTTP API,它是处理记忆的主要方式。对于不支持 MCP 的工具连接,它很有用。
适用场景
- ✓当你想通过 HTTP 保存或搜索记忆时。
- ✓当 MCP 不可用,你需要备用连接方式时。
- ✓当你要连接一个不支持 MCP 的工具到 agentmemory 时。
技能链接
https://github.com/rohitg00/agentmemory/blob/main/plugin/skills/agentmemory-rest-api/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请告诉我如何用普通的 HTTP 请求把笔记保存到 agentmemory,并再搜索出来。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会向本地记忆端点发送请求,例如保存路由和智能搜索路由。受保护的路由需要 bearer 密钥,智能体会从环境变量或本地密钥文件中加载它,且不会将其显示出来。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
REST is agentmemory's primary surface. MCP is a bridge on top of it. Every memory operation has an HTTP endpoint under http://localhost:3111/agentmemory/*.
Quick start
# liveness
curl -fsS http://localhost:3111/agentmemory/livez
# For this fixed loopback URL only. Do not print the value or enable shell tracing.
agentmemory_secret="${AGENTMEMORY_SECRET:-$(cat "$HOME/.agentmemory/secret")}"
test -n "$agentmemory_secret" || exit 1
# save
curl -fsS -X POST http://localhost:3111/agentmemory/remember \
-H "Authorization: Bearer $agentmemory_secret" \
-H "Content-Type: application/json" \
-d '{"content":"chose JWT refresh rotation","concepts":["jwt-refresh-rotation"]}'
# recall
curl -fsS -X POST http://localhost:3111/agentmemory/smart-search \
-H "Authorization: Bearer $agentmemory_secret" \
-H "Content-Type: application/json" \
-d '{"query":"auth token strategy","limit":5}'
Auth
Protected endpoints require bearer authentication by default, including localhost. Liveness is public. The example uses an explicit environment secret or the generated local secret file; if the daemon uses a secret from its .env, load that value locally without displaying it. For a remote daemon, require an explicit credential for that endpoint and HTTPS. Never forward a local-file secret or follow an authenticated redirect to another host. See TROUBLESHOOTING.md.
Conventions
- Save returns
201, reads return200, validation errors return400. - Use documented fields only. A successful response does not prove an unsupported field was applied.
- The REST port defaults to
3111and is configurable with--portor--instance. The viewer defaults to3113; the internal engine WebSocket defaults to49134.
See also
- agentmemory-mcp-tools for the MCP equivalents.
- agentmemory-config for local configuration and the secret.
Reference
The full endpoint list with methods lives in REFERENCE.md, generated from src/triggers/api.ts.
常见问题
需要密钥吗?
需要。即使是在 localhost 上,受保护的端点也需要 bearer 密钥。
哪个端点用于健康检查?
存活检查路由是公开的,不需要密钥。
我能用它连接远程服务器吗?
可以,但远程服务器需要明确的凭据和 HTTPS,本地密钥永远不会发送给它。
详情
作者的原始描述
The agentmemory HTTP REST API surface, the primary protocol for talking to the memory server. Use when calling agentmemory over HTTP, when MCP is unavailable and you need a fallback, or when integrating a host that does not speak MCP.
repo: rohitg00/agentmemory
热度
- GitHub 星标
- 30k
- 排名
- #9344
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agentmemory-agents
30k帮你的智能体把 agentmemory 记忆服务器连接到 Claude Code、Cursor 和 Codex 等编程工具。
agentmemory-architecture
30k解释 agentmemory 如何为编程智能体存储、搜索和管理记忆,从记录到回忆的整个过程。
agentmemory-config
30k帮你的智能体设置并检查 agentmemory 记忆服务器,包括端口、配置和功能开关。
agentmemory-hooks
30k帮你的智能体自动从编程会话中记录有用的笔记,而不需要你逐条手动保存。