agentmemory-rest-api
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseREST 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/*REST是agentmemory的主要接口。MCP是构建于其之上的桥接层。所有内存操作都有对应的HTTP端点,路径为。
http://localhost:3111/agentmemory/*Quick start
快速开始
bash
undefinedbash
undefinedliveness
健康检查
curl -fsS http://localhost:3111/agentmemory/livez
curl -fsS http://localhost:3111/agentmemory/livez
save
保存数据
curl -X POST http://localhost:3111/agentmemory/remember
-H "Content-Type: application/json"
-d '{"content":"chose JWT refresh rotation","concepts":["jwt-refresh-rotation"]}'
-H "Content-Type: application/json"
-d '{"content":"chose JWT refresh rotation","concepts":["jwt-refresh-rotation"]}'
curl -X POST http://localhost:3111/agentmemory/remember
-H "Content-Type: application/json"
-d '{"content":"chose JWT refresh rotation","concepts":["jwt-refresh-rotation"]}'
-H "Content-Type: application/json"
-d '{"content":"chose JWT refresh rotation","concepts":["jwt-refresh-rotation"]}'
recall
检索数据
curl -X POST http://localhost:3111/agentmemory/smart-search
-H "Content-Type: application/json"
-d '{"query":"auth token strategy","limit":5}'
-H "Content-Type: application/json"
-d '{"query":"auth token strategy","limit":5}'
undefinedcurl -X POST http://localhost:3111/agentmemory/smart-search
-H "Content-Type: application/json"
-d '{"query":"auth token strategy","limit":5}'
-H "Content-Type: application/json"
-d '{"query":"auth token strategy","limit":5}'
undefinedAuth
身份验证
By default localhost is open and no auth is needed. When is set, every request needs . See agentmemory-config.
AGENTMEMORY_SECRETAuthorization: Bearer $AGENTMEMORY_SECRET默认情况下本地主机无需身份验证即可访问。当设置环境变量后,每个请求都需要携带头信息。详情请查看agentmemory-config。
AGENTMEMORY_SECRETAuthorization: Bearer $AGENTMEMORY_SECRETConventions
约定
- Save returns , reads return
201, validation errors return200.400 - Handlers whitelist body fields and drop unknown ones, so passing extra keys is safe but ignored.
- The port is configurable with or
--port; streams, viewer, and engine derive from it.--instance
- 保存操作返回状态码,读取操作返回
201,验证错误返回200。400 - 处理器会白名单化请求体字段并丢弃未知字段,因此传递额外键值对是安全的,但会被忽略。
- 端口可通过或
--port参数配置;流、查看器和引擎的端口均由此派生。--instance
See also
另请参阅
- agentmemory-mcp-tools for the MCP equivalents.
- agentmemory-config for the port quartet and the secret.
- agentmemory-mcp-tools:对应MCP的工具集。
- agentmemory-config:端口组和密钥配置说明。
Reference
参考文档
The full endpoint list with methods lives in REFERENCE.md, generated from .
src/triggers/api.ts完整的端点列表及请求方法请查看REFERENCE.md,该文档由自动生成。
src/triggers/api.ts