agentmemory-rest-api

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
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/*
.
REST是agentmemory的主要接口。MCP是构建于其之上的桥接层。所有内存操作都有对应的HTTP端点,路径为
http://localhost:3111/agentmemory/*

Quick start

快速开始

bash
undefined
bash
undefined

liveness

健康检查

save

保存数据

curl -X POST http://localhost:3111/agentmemory/remember
-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"]}'

recall

检索数据

curl -X POST http://localhost:3111/agentmemory/smart-search
-H "Content-Type: application/json"
-d '{"query":"auth token strategy","limit":5}'
undefined
curl -X POST http://localhost:3111/agentmemory/smart-search
-H "Content-Type: application/json"
-d '{"query":"auth token strategy","limit":5}'
undefined

Auth

身份验证

By default localhost is open and no auth is needed. When
AGENTMEMORY_SECRET
is set, every request needs
Authorization: Bearer $AGENTMEMORY_SECRET
. See agentmemory-config.
默认情况下本地主机无需身份验证即可访问。当设置
AGENTMEMORY_SECRET
环境变量后,每个请求都需要携带
Authorization: Bearer $AGENTMEMORY_SECRET
头信息。详情请查看agentmemory-config。

Conventions

约定

  • Save returns
    201
    , reads return
    200
    , validation errors return
    400
    .
  • Handlers whitelist body fields and drop unknown ones, so passing extra keys is safe but ignored.
  • The port is configurable with
    --port
    or
    --instance
    ; streams, viewer, and engine derive from it.
  • 保存操作返回
    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
自动生成。