/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
All error responses use the shape
{ "error": "<message>" }. Feature-flag 503 responses carry additional fields:
Full Endpoint Reference
Agent Memory exposes 128 endpoints across the following groups:The source of truth for all endpoint signatures is
src/triggers/api.ts in the Agent Memory repository.