# agentmemory-rest-api

Documents the agentmemory HTTP REST API, for calling the memory server directly when MCP is unavailable or your host doesn't support it.

Skill by Rohit Ghumare. Category: Agent craft.

## Install

Project (for this project only):

```sh
npx skills add rohitg00/agentmemory --skill agentmemory-rest-api
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

Global (for every project on this machine):

```sh
npx skills add rohitg00/agentmemory --skill agentmemory-rest-api -g
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

## Tags

- Runs on your computer: It runs as a program on your machine, with your access.

## Security audits

- Gen Agent Trust Hub: Pass
- Socket: Pass
- Snyk: Pass

Installs: 10788. Installs counted by skills.sh. [Open on skills.sh](https://www.skills.sh/rohitg00/agentmemory/agentmemory-rest-api)

## Source

[Open the source](https://github.com/rohitg00/agentmemory/tree/HEAD/plugin/skills/agentmemory-rest-api). Checked 2026-10-24. This summary may contain AI-generated text, so it can be wrong. Check the source before you rely on it.

## SKILL.md

````markdown
---
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

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

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](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 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`.
````

- Previous: [agentmemory-mcp-tools](https://syn4pse.dev/terminal/agentmemory-mcp-tools.md)
- Next: [agentmemory-architecture](https://syn4pse.dev/terminal/agentmemory-architecture.md)
- [Terminal](https://syn4pse.dev/terminal.md)
- [Suggest a change](mailto:terminal@syn4pse.dev?subject=Terminal%20suggestion)
