跳到正文
Skillpedia
API 与服务器(后端)30k · #9344

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/rohitg00/agentmemory/blob/main/plugin/skills/agentmemory-rest-api/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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 return 200, validation errors return 400.
  • Use documented fields only. A successful response does not prove an unsupported field was applied.
  • The REST port defaults to 3111 and is configurable with --port or --instance. The viewer defaults to 3113; the internal engine WebSocket defaults to 49134.

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能