Skip to main content
Agent Memory runs a local HTTP server on port 3111 with 128 REST endpoints. All endpoints are prefixed with /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

The REST API binds to 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.
When AGENTMEMORY_SECRET is set in your config (~/.agentmemory/.env), all endpoints except /livez require a Bearer token:
Requests without a valid token return 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 when AGENTMEMORY_SECRET is set:
Response includes the current service status, version, and optional circuit breaker state:
If status is "critical", the endpoint returns HTTP 503 instead of 200. Use this in your own health probes.

Liveness Probe

A lightweight liveness endpoint for container orchestration — never returns 503:

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 the Content-Type header on every POST request:
Responses are always JSON unless otherwise noted (the /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.