Skip to main content

Mem0 (mem0)

Persistent memory of the AI agents: the official Mem0 REST server extracts facts from conversations with the LLM, stores them with their embedding in PostgreSQL (pgvector) per user, agent or run, and answers semantic searches, updates, history and deletions. LLM and embedding calls go through the LiteLLM gateway of the platform (OpenAI compatible); every call is authenticated (admin API key, user API keys or JWT) and no telemetry leaves the host.

Generated from catalog/services/mem0.yaml: do not edit by hand.

Summary​

Version2.2.1
Useinstall and configure, configure and connect
Layerfunctional (AI catalog)
CategoryAI memory
SubcategoryPersistent agent memory
Installation methodspython
External connectionno
Sandbox onlyno

Licence​

SPDX identifierApache-2.0
Licence policycore licence (MIT or Apache-2.0)
Licence exception-
Licence noteThe server sources (server/ of the v2.2.1 archive, sha256 2d203947596fbbfeaf06e5311c087a6b837566528016013aff15ad2a8a4103c5) and its LICENSE are rendered from templates/mem0/server, identical to the archive except two text only edits that change no behaviour (one log message of main.py and the dashes of docstrings and a comment of telemetry.py: the catalog refuses Jinja markers and dashes in rendered files); the Python dependencies are under OSI licences (MIT, BSD, Apache-2.0, ISC, MPL-2.0, LGPL-3.0-only for psycopg, Unlicense, PSF-2.0). The web dashboard of the release (Next.js) is not delivered: no versioned official image exists and the python method cannot build it. No podman method either: the Docker Hub image mem0/mem0-api-server has no versioned tag (one floating tag of 2025-09-10, before v2) and the official documentation names no other image. The graph memory (Neo4j) and spaCy are not installed: the entity linking and the lemmatized keyword scoring stay off.
Platform componentmem0

Packages and artifacts​

A package the project of the service publishes (its image, its binary archive, its Python or OS package) carries the licence of the service; a third-party package carries the licence written on its row, read from the official upstream metadata.

KindPackageVersionLicenceDetails
Python packagemem0ai2.2.1Apache-2.0interpreters, in order of preference python3.12
Python packagefastapi0.115.8MITinterpreters, in order of preference python3.12
Python packageuvicorn0.34.0BSD-3-Clauseinterpreters, in order of preference python3.12
Python packagepydantic[email]2.10.4MITinterpreters, in order of preference python3.12
Python packagepython-dotenv1.2.2Apache-2.0interpreters, in order of preference python3.12
Python packagepsycopg[binary]3.3.7Apache-2.0interpreters, in order of preference python3.12
Python packagepsycopg-pool3.3.3Apache-2.0interpreters, in order of preference python3.12
Python packagesqlalchemy2.1.6Apache-2.0interpreters, in order of preference python3.12
Python packagealembic1.20.1Apache-2.0interpreters, in order of preference python3.12
Python packagepasslib[bcrypt]1.7.4Apache-2.0interpreters, in order of preference python3.12
Python packagebcrypt4.0.1Apache-2.0interpreters, in order of preference python3.12
Python packagepython-jose[cryptography]3.5.0Apache-2.0interpreters, in order of preference python3.12
Python packagecryptography50.0.2Apache-2.0 OR BSD-3-Clauseinterpreters, in order of preference python3.12
Python packageposthog7.82.2Apache-2.0interpreters, in order of preference python3.12
Python packageslowapi0.1.10Apache-2.0interpreters, in order of preference python3.12
Python packageopenai3.42.1Apache-2.0interpreters, in order of preference python3.12
Python packagepixeltable-pgserver0.7.1Apache-2.0interpreters, in order of preference python3.12

Supported systems and architectures​

MethodOperating systemsArchitectures
pythonRHEL family (dnf), Debian family (apt), Arch Linux (pacman)x86_64, aarch64 (not restricted by the descriptor)

Certified host systems: RHEL 8/9/10, Rocky Linux 8/9/10, AlmaLinux 8/9/10, Oracle Linux 8/9, CentOS Stream 9/10, Ubuntu 22.04/24.04, Debian 12, Arch Linux (rolling). The host preflight accepts these systems (other releases of a known family give a warning, end of life releases are refused) and the x86_64 and aarch64 architectures.

Prerequisites​

Host​

  • at least 1024 MB of memory (blocking, memory).
  • at least 1 CPU (blocking, cpu).
  • at least 2048 MB free for /var/lib/navin (blocking, disk).

Network and ports​

ComponentPort namePortOpened in the host firewall
mem0-serverapi8720/tcpyes
mem0-serverapi_local8720/tcpno

Services and connections needed​

Details and resolution: see Dependencies.

Installation methods and modes​

MethodDefaultWhat the method uses
pythonyesa Python virtual environment holding the Python packages of the descriptor

Components​

ComponentKindInstallation methodsPorts
Mem0 REST server (mem0-server)masterpython8720/tcp, 8720/tcp
Request log pruner (request-log-pruner)workerpython-
  • request-log-pruner runs only on a host that also runs mem0-server.

Single server (single) (default)​

One Mem0 server and its request log pruner.

What the mode deploys:

ComponentPlacement
mem0-servermin 1, max 1
request-log-prunermin 1, max 1

Install this service​

The install wizard of the Navin Manager plans, validates and runs the installation; you need the services:install permission on the cluster.

  1. Open the wizard. In Clusters, choose the row action Install services of the target cluster. The wizard opens on its first step, Service.

  2. Choose the service. On the Service step, select Mem0. The card shows the licence Apache-2.0 and the dependencies the installation needs.

  3. Choose the hosts and the mode. On the Hosts step, tick the hosts, then choose the Mode: single (default). Each mode deploys the components listed in Installation methods and modes. With several components, place each one on its hosts in Component placement (Suggest placement proposes a placement that respects the cardinalities).

  4. Bind the dependencies. On the Bindings step, choose for each dependency (database, app, llm) Install with the platform or Use an existing connection; an optional dependency can stay on No binding.

  5. Configure. On the Configure step, review the parameters (see Configuration parameters). Passwords left empty with a generated default are generated and sealed by the Manager.

  6. Review and install. On the Install step the Manager validates the plan and shows the installation order; when it says "The plan is valid. Ready to install.", choose Install. A highly available mode is installed only when its HA checks pass.

  7. Verify. The operation ends when the health checks of every instance pass (see Health checks); the service then shows as running in Services. Open the service and choose Run the smoke test in the Checks card: In a space of its own (user_id navin-smoke-<nonce>): checks that a call without key is refused, stores a memory (embedding call), asks the LLM through the server, finds the memory by semantic search, updates it, reads it back, deletes it, checks the space is empty, then deletes the space whatever happened.

Connect an existing service​

Schemeshttps, http
Default port8000
Authenticationrequired
Health check/openapi.json
Authentication methodFieldsDescription
api_keyapi_keyADMIN_API_KEY of the server or a user API key (m0sk_...), sent as X-API-Key.

Official documentation: https://docs.mem0.ai/open-source/features/rest-api

High availability​

Clusternone (none)
High availabilitynone (none)
Failovernone (none)
Replicationnone (none)
Quorumnone (none)
Discoverynone (none)
Entry pointany node (any-node)
Official documentationhttps://docs.mem0.ai/open-source/features/rest-api
Referenceshttps://github.com/mem0ai/mem0/blob/v2.2.1/server/main.py, https://github.com/mem0ai/mem0/blob/v2.2.1/mem0/memory/storage.py

Topology per mode​

ModesHighest catalog levelDistributionQuorum componentFault domainsDescription
singlestandalone (standalone)single (single)-1One server: its loss stops the memory API until it is restarted or restored; the memories stay in PostgreSQL.

Notes​

  • No replicated mode: the history of the memories and the recent messages used as extraction context live in a local SQLite file (HISTORY_DB_PATH, mem0/memory/storage.py), the rate limits of the authentication routes are counted in memory per process (slowapi) and the migrations run at each start. Two servers behind a load balancer would each keep a partial history.
  • The memories, their vectors, the users and the keys are in PostgreSQL: with the highly available PostgreSQL service a lost host is replaced by a reinstall and the restore of the history file.
  • The server exposes no metrics endpoint: the observability uses blackbox probes of /openapi.json and /auth/setup-status.

Configuration parameters​

Network​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
API port (port)port8720-nonoyesPort of the REST API (8000 upstream, moved off the port of vLLM and Opik).
API exposure (listen_scope)enumnetworknetwork, localnonoyesnetwork: the API listens on the private address of the host only (never on every address) and the host firewall opens it to the consumers; local: loopback only, for consumers on the same host. It is never published by a gateway.
TLS (tls_enabled)boolfalse-nonoyesServe the API over TLS (uvicorn --ssl-certfile and --ssl-keyfile) with the certificate the Manager issues to the host; the binding of the consumers then uses https.
Concurrent requests (limit_concurrency)int64min 4, max 1024nonoyesRequests served at once (uvicorn --limit-concurrency); beyond, the server answers 503.

Models​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
LLM (llm_model)stringqwen-local^[A-Za-z0-9._:/@-]{1,128}$nonoyesModel name of the gateway used for the fact extraction (JSON mode); default qwen-local, the default served model name of a vLLM engine bound to LiteLLM (the gateway has no default entry, audit P5B-010).
LLM temperature (llm_temperature)float0.2min 0, max 2nonoyesTemperature of the extraction calls (0.2 upstream).
Embedding model (embedder_model)stringbge-m3^[A-Za-z0-9._:/@-]{1,128}$nonoyesEmbedding model name of the gateway; default bge-m3, served by a vLLM engine in embedding mode bound to LiteLLM.
Vector size (embedding_dims)int1024min 64, max 16000nonoyesSize of the vectors the embedding model returns (1024 for bge-m3): the vector column of the collection is created with it. Changing it on a collection that holds memories needs a new collection name.
Send the vector size (embedding_send_dimensions)boolfalse-nonoyesSend the dimensions parameter in the embedding calls (models with Matryoshka embeddings only: vLLM refuses it for the other models). (advanced)
Gateway key (llm_api_key)password(empty)-noyesnoLiteLLM virtual key of Mem0 (sk-...); empty, the master key of the bound gateway is used.

Storage and retention​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
Collection (collection_name)stringmemories^[a-z_][a-z0-9_]{0,62}$nonoyesTable of the memories in the memory database (POSTGRES_COLLECTION_ NAME); the entities use the table of the same name with the suffix _entities.
Request log retention (request_log_retention_days)int30min 1, max 3650, daysnonoyesRows of the request log older than this are deleted by the request-log-pruner component (official prune_request_logs.py).
Pruning interval (prune_interval_hours)int24min 1, max 168, hoursnonoyesHours between two runs of the request log pruning.

Security​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
Admin API key (admin_api_key)passwordgenerated-noyesnoADMIN_API_KEY of the server (X-API-Key header, role admin), given to the consumers as the api_key secret of the api endpoint; rotated by a new value and a restart.
JWT secret (jwt_secret)passwordgenerated-noyesnoJWT_SECRET signing the access and refresh tokens of the users; changing it ends every session.
Administrator e-mail (admin_email)stringmem0-admin@navin.internal^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$nononoLogin of the first administrator, created by the launcher before the API listens (the public registration route is then closed).
Administrator password (admin_password)passwordgenerated-noyesnoInitial password of the first administrator (bcrypt hash in the app database); once the account exists it is changed in the server only (POST /auth/change-password).

Observability​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
Log level (log_level)enuminfocritical, error, warning, info, debugnononoVerbosity of uvicorn.

Dependencies​

For each active dependency the Manager takes the first of: the binding chosen in the wizard; a service of the same installation that provides it; a service already installed in the cluster; the only connection of the expected type. Otherwise an optional dependency stays unbound, and a required one is added to the installation in its default mode (the column below names the catalog service added).

BindingProvided byConnection typeEndpointOptionalWhen nothing is boundDescription
databasepostgresql (versions >= 13)postgresqlsqlnopostgresql is added to the installationMemory database (database mem0): the pgvector collection of the memories and of the entities. The provisioning creates the role mem0, owner of its databases only, and the vector extension.
apppostgresql (versions >= 13)postgresqlsqlnopostgresql is added to the installationApp database (database mem0_app) of the server: users, API keys, refresh tokens, settings and request log (Alembic migrations). It must be on the same PostgreSQL server as the memory database.
llmlitellm-apinolitellm is added to the installationOpenAI compatible gateway of the LLM (fact extraction) and of the embedding model; the vLLM and Ollama engines of the Manager are reached through it.

Checks of the bound endpoints​

  • the endpoint /v1/models of the binding llm answers with the status 200 and lists the values of llm_model, embedder_model, checked by the Manager before the installation (blocking, llm_models).

Endpoints​

EndpointSchemeComponentPortPathTLS parameterBinding parametersBinding secretsProvisioning command
apihttpmem0-server8720 (port)-tls_enabledcollection, embedding_dimsapi_key-

Client configuration files​

Files rendered for the client configuration download:

  • mem0.env (client.env.j2)

Commands​

CommandComponentTargetDescription
Effective configuration (configuration)mem0-serverfirst hostConfiguration the server runs with (GET /configure, secrets redacted by the server).
Prune the request log (prune_request_logs)request-log-prunerfirst hostDeletes now the request log rows older than the retention.
Apply the migrations (migrate)mem0-serverfirst hostApplies the Alembic migrations of the release to the app database (also done at every start of the server).
Recent logs (logs)mem0-serverchosen hostLast lines of the server journal.

Health checks​

Liveness (per instance)​

ComponentCheckDetails
mem0-serverHTTP {{ 'https' if config.tls_enabled else 'http' }}://{{ host.fqdn if config.tls_enabled and config.listen_scope == 'network' else ((host.ip or '127.0.0.1') if config.listen_scope == 'network' else '127.0.0.1') }}:{{ config.port }}/openapi.jsonExpected 200; Expected Mem0 REST APIs; 60 retries; interval 2 s; timeout 5 s
request-log-pruner{{ paths.opt }}/venv/bin/python {{ paths.opt }}/server/navin_prune.py --check {{ paths.data }}/home/prune.status {{ config.prune_interval_hours * 7200 + 600 }}20 retries; interval 3 s; timeout 30 s

Readiness (service check)​

CheckDetails
HTTP {{ 'https' if config.tls_enabled else 'http' }}://{{ host.fqdn if config.tls_enabled and config.listen_scope == 'network' else ((host.ip or '127.0.0.1') if config.listen_scope == 'network' else '127.0.0.1') }}:{{ config.port }}/auth/setup-statusExpected 200; Expected "needsSetup":false; 10 retries; interval 3 s; timeout 10 s

Smoke test​

In a space of its own (user_id navin-smoke-<nonce>): checks that a call without key is refused, stores a memory (embedding call), asks the LLM through the server, finds the memory by semantic search, updates it, reads it back, deletes it, checks the space is empty, then deletes the space whatever happened. (mem0-server: refused_without_key, create, llm, search, update, read_back, delete, gone, cleanup)

Preflight checks​

CheckTypeMeaningSeverityComponents
memorymemory_mb {"min": 1024}at least 1024 MB of memoryblockingmem0-server
cpucpu_count {"min": 1}at least 1 CPUblockingmem0-server
diskdisk_free_mb {"min": 2048}at least 2048 MB free for /var/lib/navinblockingmem0-server
api_port_freeport_free {"param": "port"}port 8720 free on the hostblockingmem0-server
llm_modelshttp_reachable {"binding": "llm", "path": "/v1/models", "bearer_secret": "token", "contains_params": ["llm_model", "embedder_model"], "timeout_s": 10}the endpoint /v1/models of the binding llm answers with the status 200 and lists the values of llm_model, embedder_model, checked by the Manager before the installationblockingmem0-server

Backup and restore​

pg_dump (custom format, without owner nor privilege) of the memory and app databases and an online SQLite backup of the history file; verify reads the table of contents of each dump and checks the integrity of a copy of the history. Restore: the server is stopped, pg_restore --clean --if-exists replaces the objects of each database in one transaction (the vector extension stays the one of the provisioning) and the history file is replaced.

Formatmem0-pgdump
Componentmem0-server
Files{{ backup.dir }}/memories.dump, {{ backup.dir }}/app.dump, {{ backup.dir }}/history.db
Restore testyes
Instances stopped for the restoreyes

Upgrade​

Supported from
Statefulyes
Backup before the upgradeyes
Rollbackno (The Alembic migrations of the server only go forward (they run at every start of a new release and the Manager never downgrades them): the way back is the restore of the backup taken before the upgrade.)
Migrationsalembic_head

Uninstall​

Paths removed when the data is purged: {{ paths.data }}, {{ paths.log }}.

  • API reference: {{ 'https' if config.tls_enabled else 'http' }}://{{ host.fqdn }}:{{ config.port }}/docs

Upstream documentation​