Skip to content

Any runtime over REST

For runtimes that don’t speak MCP, Meaning Memory serves a REST API with an OpenAPI description. Any language with an HTTP client can store and query memories.

The REST server comes with the rest extra:

Terminal window
pip install "meaning_memory-<version>-py3-none-any.whl[rest]"

Start it against a file workspace, with a bearer token read from an environment variable:

Terminal window
export MM_REST_TOKEN="$(openssl rand -hex 32)"
meaning-memory serve --ledger /srv/support-bot-mm/memory-ledger.md \
--events /srv/support-bot-mm/sig-events.jsonl \
--host 127.0.0.1 --port 8890 --token-env MM_REST_TOKEN

For Postgres, pass --dsn instead of --ledger and --events, or set MM_POSTGRES_DSN.

The token gives full read and write access to the store the server is attached to. The REST API is not scoped by agent: scope groups apply only to agents connected over MCP, so a token reads every agent’s memories in its tenant, private ones included. Bind the server to a private interface, as above, or put it behind your own gateway, and give the token only to services you trust with the whole store.

Terminal window
$ curl -s -X POST http://127.0.0.1:8890/v1/memories \
-H "Authorization: Bearer $MM_REST_TOKEN" -H "Content-Type: application/json" \
-d '{"text": "Acme renewal is November 14, 2026.", "category": "fact",
"source_agent": "support-bot"}'
{"mem_id":"6be116e865acdb69","text":"Acme renewal is November 14, 2026.","category":"fact",
"sig":0.5,"pinned":false,"date":"2026-10-04","status":"active","source":"rest-api",
"source_agent":"support-bot", …}

A REST write goes straight to the store: there is no queue, so it is searchable at once.

Terminal window
$ curl -s "http://127.0.0.1:8890/v1/memories?q=renewal&limit=5" \
-H "Authorization: Bearer $MM_REST_TOKEN"
{"count":2,"entries":[{"mem_id":"140036cca0d9321b","text":"Call Acme about the renewal.", …},
{"mem_id":"6be116e865acdb69","text":"Acme renewal is November 14, 2026.", …}]}

Every endpoint under /v1 needs the bearer token:

Terminal window
$ curl -s -o /dev/null -w "%{http_code}\n" "http://127.0.0.1:8890/v1/memories?q=renewal"
401

/healthz answers without a token, for load balancers and uptime checks.

The running server describes itself. Open http://127.0.0.1:8890/docs for an interactive explorer, or fetch /openapi.json to generate a client. The same endpoints are listed in the REST API reference.