/agentmemory/. You can use these endpoints to integrate Agent Memory into custom tools, scripts, or multi-agent pipelines — without requiring an MCP client or a native plugin.
Base URL
127.0.0.1 by default. To reach it from a remote host or sandboxed client, use the --port <N> CLI flag to change the port, or reverse-proxy the server and point AGENTMEMORY_URL at your proxy.
Authentication
Authentication is optional for local use. If you never set
AGENTMEMORY_SECRET, all endpoints accept unauthenticated requests.AGENTMEMORY_SECRET is set in your config (~/.agentmemory/.env), all endpoints except /livez require a Bearer token:
401 Unauthorized. Mesh sync endpoints (/mesh/*) additionally require AGENTMEMORY_SECRET to be set on both peers — they return 503 with { "error": "mesh requires AGENTMEMORY_SECRET" } if the secret is absent.
Health Check
The health endpoint requires authentication whenAGENTMEMORY_SECRET is set:
Liveness Probe
A lightweight liveness endpoint for container orchestration — never returns503:
API Groups
Sessions
Start and end sessions, list past sessions, capture observations, and link Git commits to session context.
Memory
Save insights to long-term memory, recall past memories, delete obsolete entries, and export or import your full memory database.
Search
Hybrid BM25 + vector + graph search, generate context blocks for prompt injection, enrich file paths with related memories, and query the knowledge graph.
Graph
Traverse the knowledge graph via
POST /agentmemory/graph/query. Requires GRAPH_EXTRACTION_ENABLED=true.Content Type
All request bodies must be JSON. Include theContent-Type header on every POST request:
/viewer endpoint returns HTML).
Error Responses
| Status | Meaning |
|---|---|
200 | Success |
201 | Resource created |
202 | Accepted (async operation enqueued) |
400 | Invalid request body — check the error field for details |
401 | Missing or invalid Authorization header |
404 | Resource not found |
409 | Conflict — resource already exists |
413 | Payload too large (e.g. memory slot size exceeded) |
503 | Feature not enabled — check the flag and enableHow fields in the response body |
500 | Internal error — rerun with agentmemory --verbose to see full stack traces |
{ "error": "<message>" }. Feature-flag 503 responses carry additional fields:
Full Endpoint Reference
Agent Memory exposes 128 endpoints across the following groups:| Group | Prefix | Purpose |
|---|---|---|
| Sessions | /session/*, /sessions, /observations | Lifecycle and observation capture |
| Memory | /remember, /forget, /memories, /profile, /export, /import | Memory store management |
| Search | /search, /smart-search, /context, /enrich | Retrieval and context generation |
| Graph | /graph/* | Knowledge graph queries and management |
| Actions | /actions, /frontier, /next, /leases/* | Multi-agent work coordination |
| Signals | /signals/* | Inter-agent messaging |
| Routines | /routines/* | Workflow automation |
| Checkpoints | /checkpoints/* | External condition gates |
| Snapshots | /snapshots, /snapshot/* | Git-versioned memory snapshots |
| Team | /team/* | Shared team memory |
| Slots | /slots, /slot, /slot/* | Pinned editable memory slots |
| Governance | /governance/*, /audit | Audit trail and bulk deletes |
| Diagnostics | /diagnostics/*, /health, /livez | Health and self-healing |
| Config | /config/flags | Runtime feature flag inspection |
The source of truth for all endpoint signatures is
src/triggers/api.ts in the Agent Memory repository.