360 Secure SkillHub
360 安全技能中心

Agentmemory Rest Api

这是agentmemory的核心通信协议,提供存活检测、记忆存储、智能查询等HTTP端点。适用于MCP不可用时作为备选方案,或集成不支持MCP的主机。通过curl等工具发送JSON请求,返回对应HTTP状态码;默认本地无认证,设置密钥后需Bearer认证,端口可配置。

rohitg00
rohitg00
热度 15.01
最近更新 2026-07-18 09:11:43
分类:开发依赖:第三方 API应用场景:API 集成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add agentmemory-rest-api
Metadata
name
agentmemory-rest-api
description
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.
user-invocable
false

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

# save
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}'

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.

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.

See also

  • agentmemory-mcp-tools for the MCP equivalents.
  • agentmemory-config for the port quartet and the secret.

Reference

The full endpoint list with methods lives in REFERENCE.md, generated from src/triggers/api.ts.