---
id: gh-agentmemory-rest-api
name: "agentmemory-rest-api"
url: https://skills.yangsir.net/skill/gh-agentmemory-rest-api
author: rohitg00
domain: ai-agent-memory-knowledge
tags: ["rest-api", "agent-memory", "http-protocol", "api-integration"]
install_count: 11800
rating: 4.50 (120 reviews)
github: https://github.com/rohitg00/agentmemory/tree/main/plugin/skills/agentmemory-rest-api
---

# agentmemory-rest-api

> 此技能提供 agentmemory 的 HTTP REST API 接口，作为与记忆服务器通信的主要协议。它使得 AI 智能体能够通过标准 HTTP 协议进行记忆的存储与检索，确保在特定环境下也能高效管理和访问其知识库，极大地提升了智能体的适应性和数据交互能力。

**Stats**: 11,800 installs · 4.5/5 (120 reviews)

## Before / After 对比

### 简化 AI 智能体记忆集成

**Before**:

用户或开发者在没有标准化的 HTTP API 接口时，需要投入大量时间手动开发或适配特定的通信协议，才能让 AI 智能体与记忆服务器进行交互，这导致集成过程复杂且耗时。

**After**:

此技能提供开箱即用的 HTTP REST API，使得 AI 智能体能够通过标准协议快速、便捷地存储和检索记忆，大幅减少了集成工作量和时间，提升了开发效率和系统的兼容性。

| Metric | Before | After | Change |
|---|---|---|---|
| 集成时间 | 120分钟 | 10分钟 | -91.67% |

## Readme

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

```bash
# 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

Every endpoint except liveness requires `Authorization: Bearer <secret>`, including on localhost. The server always has a secret: `AGENTMEMORY_SECRET` when you set one, otherwise one it generates at first start. Requests without the header get `401`. 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](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`.


---
*Source: https://skills.yangsir.net/skill/gh-agentmemory-rest-api*
*Markdown mirror: https://skills.yangsir.net/api/skill/gh-agentmemory-rest-api/markdown*