Skip to main content

Build

Agentmemory Rest API

AgentMemory

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.

  • New
  • v1.0.4
  • Reviewed Aug 18
  • No reviews yet

Getting started

Full instructions

Example command

Quick start

curl -fsS http://localhost:3111/agentmemory/livez

Instructions: SKILL.mdv1.0.4

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.

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.
  • GET /agentmemory/sessions filters by startedAfter, startedBefore, endedAfter and endedBefore. GET /agentmemory/status reports index.vectorBackfillReason when the vector backfill is paused.
  • MCP clients that connect by URL use POST /agentmemory/mcp (MCP Streamable HTTP) with the same bearer secret.
  • 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/ and src/mcp/.

Explore more skills

Browse all
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

More from AgentMemory

View source →

Frequently asked questions about agentmemory-rest-api

What does the agentmemory-rest-api skill do?

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. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the agentmemory-rest-api skill?

Run `npx @skills-hub-ai/cli install agentmemory-rest-api` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/agentmemory-rest-api/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does agentmemory-rest-api work with?

agentmemory-rest-api runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the agentmemory-rest-api skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use agentmemory-rest-api after installing it?

In Claude Code, type `/agentmemory-rest-api` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the agentmemory-rest-api skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.

Badge for your README

Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/agentmemory-rest-api)](https://skills-hub.ai/skills/agentmemory-rest-api)
HTML
<a href="https://skills-hub.ai/skills/agentmemory-rest-api"><img src="https://skills-hub.ai/api/badges/skill/agentmemory-rest-api" alt="Install on Skills Hub"></a>

More options in the badge docs.