Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.openmem.blog/llms.txt

Use this file to discover all available pages before exploring further.

omp-server is a FastAPI application that exposes the full OMP verb set as HTTP endpoints. Because it speaks the OMP protocol natively, any language or framework — not just Python — can store, search, and retrieve memories by making ordinary HTTP requests. You can also connect back to it from the Python SDK using the passthrough provider, which gives you a single server process shared across multiple clients or services.

Install

pip install 'openmem[server]'

Start the server

omp-server --provider postgres --url postgresql://user:pass@host:5432/db
When the server is ready, it prints a single line to stderr:
omp-server: serving postgres at http://127.0.0.1:8080

Available routes

MethodPathDescription
POST/memoriesAdd a memory
GET/memoriesList memories
GET/memories/{id}Get a memory by ID
PATCH/memories/{id}Update a memory
DELETE/memories/{id}Delete a memory
GET/memories/searchSemantic and keyword search
POST/contextGet a prompt-ready context block
GET/auditRetrieve the audit log
GET/capabilitiesProvider capabilities
GET/healthzHealth check

Connect using the Python SDK

Point the Python SDK at the running server using the passthrough provider. All standard Memory methods work exactly as they do against a direct adapter.
from openmem import Memory

mem = Memory(provider="passthrough", base_url="http://localhost:8080")

# All standard Memory methods work
mem.add(content="user prefers dark mode", user_id="u1")
results = mem.search("dark mode", user_id="u1")
The passthrough adapter probes /capabilities on construction. If the server returns omp_version, the SDK routes all calls through it as a native OMP server.

Check server health

curl http://localhost:8080/healthz
# {"status": "ok", "provider": "postgres"}
For Postgres and passthrough backends, the health check acquires and releases a real connection to confirm the backend is reachable. For Mem0, Supermemory, and Letta, it returns 200 unconditionally to avoid unnecessary calls to paid external endpoints.

Server behavior

CORS is disabled by default. If you need browser clients to call the server directly, enable it with the --cors-origins flag:
omp-server --provider postgres --url $PG_URL \
  --cors-origins "https://app.example.com,https://staging.example.com"
The default request body limit is 1 MiB. Requests larger than this limit receive a 413 response with code: payload_too_large before any schema validation runs. Increase the limit with --max-request-bytes if your use case requires larger payloads.

Security

omp-server is designed for trusted-network deployment. Authentication is not yet built in — the server accepts all requests without verifying caller identity. Do not expose it directly to the public internet. Run it inside a private network or behind an authenticated reverse proxy.