---
title: "Overview"
description: "Mem0 provides an extensible memory infrastructure and agent runtime integration suite designed to equip AI agents and applications with persistent context across dual deployment tiers: open-source ..."
last_updated: "2026-10-11T17:37:10.193334+00:00"
canonical_url: "https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/orientation/overview"
---

<details>
<summary>Relevant source files</summary>

The following files were used as context for generating this wiki page:

- [cli/python/src/mem0_cli/__init__.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/python/src/mem0_cli/__init__.py)
- [cli/node/src/index.ts](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/node/src/index.ts)
- [cli/python/src/mem0_cli/app.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/python/src/mem0_cli/app.py)
- [integrations/agent-plugin-core/python/memory_cli.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/agent-plugin-core/python/memory_cli.py)
- [integrations/mem0-agent-plugin/core/memory_cli.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_cli.py)
- [integrations/antigravity-plugin/core/memory_cli.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/antigravity-plugin/core/memory_cli.py)
- [integrations/kimi-plugin/core/memory_cli.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/kimi-plugin/core/memory_cli.py)
- [integrations/cursor-plugin/core/memory_cli.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/cursor-plugin/core/memory_cli.py)
- [integrations/codex-plugin/core/memory_cli.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/codex-plugin/core/memory_cli.py)
- [integrations/mem0-agent-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py)
- [integrations/claude-code-plugin/core/memory_cli.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/claude-code-plugin/core/memory_cli.py)
- [integrations/agent-plugin-core/python/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/agent-plugin-core/python/memory_core.py)
- [integrations/hermes-plugin-mem0/__init__.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/hermes-plugin-mem0/__init__.py)
- [cli/node/src/commands/init.ts](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/node/src/commands/init.ts)
- [integrations/antigravity-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/antigravity-plugin/core/memory_core.py)
- [integrations/kimi-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/kimi-plugin/core/memory_core.py)
- [integrations/cursor-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/cursor-plugin/core/memory_core.py)
- [integrations/codex-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/codex-plugin/core/memory_core.py)
- [mem0/__init__.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/__init__.py)
- [integrations/claude-code-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/claude-code-plugin/core/memory_core.py)
- [mem0/client/__init__.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/client/__init__.py)
- [integrations/mem0-agent-plugin/mcp.json](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/mcp.json)
- [mem0/memory/__init__.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/memory/__init__.py)
- [cli/cli-spec.json](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/cli-spec.json)
- [integrations/openclaw/index.ts](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/openclaw/index.ts)
- [integrations/mem0-strands/python/src/mem0_strands/__init__.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-strands/python/src/mem0_strands/__init__.py)
- [cli/python/src/mem0_cli/__main__.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/python/src/mem0_cli/__main__.py)
- [cli/python/src/mem0_cli/commands/__init__.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/python/src/mem0_cli/commands/__init__.py)
- [integrations/mem0-agent-plugin/core/_harness_id.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/_harness_id.py)
- [integrations/pi-agent-plugin/src/index.ts](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/pi-agent-plugin/src/index.ts)
</details>

## Overview

Mem0 provides an extensible memory infrastructure and agent runtime integration suite designed to equip AI agents and applications with persistent context across dual deployment tiers: open-source (OSS) local backends and the hosted Mem0 Platform. At its core, the architecture coordinates cross-runtime command-line interfaces in both Python and Node.js [Python CLI Architecture](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/cli-tools/python-cli-architecture), [Node.js CLI Architecture](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/cli-tools/node-js-cli-architecture), alongside a unified family of agent harness plugins such as [Claude Code Plugin](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/agent-plugins/claude-code-plugin) that synchronize conversation history, background session flows, and diagnostic telemetry.

## Platform Architecture and Core Concepts

### Core Components and Client Entrypoints

Mem0 defines its foundational memory layers and client entrypoints across dedicated package modules. The core package exposes synchronous and asynchronous interfaces for both local engine management via `Memory` and `AsyncMemory`, alongside hosted cloud interactions through `MemoryClient` and `AsyncMemoryClient`. 

| Component / Class | Module Path | Purpose |
| :--- | :--- | :--- |
| `Memory` | `mem0.memory.main` | Synchronous core memory engine for local management |
| `AsyncMemory` | `mem0.memory.main` | Asynchronous core memory engine |
| `MemoryClient` | `mem0.client.main` | Synchronous client interface for the Mem0 platform |
| `AsyncMemoryClient` | `mem0.client.main` | Asynchronous client interface for the Mem0 platform |

Sources: [mem0/__init__.py:5-6](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/__init__.py#L5-L6)

### Deployment Tiers and Versioning

The architecture operates across dual deployment tiers: open-source self-hosted backends and remote platform synchronization. Package versioning is dynamically retrieved via metadata for the underlying distribution (`mem0ai`), while command-line operations are governed by the dedicated CLI distribution version.

```python
"""mem0 CLI — the command-line interface for the mem0 memory layer."""

__version__ = "0.2.13"
```
Sources: [cli/python/src/mem0_cli/__init__.py:1-3](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/python/src/mem0_cli/__init__.py#L1-L3), [mem0/__init__.py:1-3](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/__init__.py#L1-L3)

> [!NOTE]
> The Python core package inspects installed distribution metadata via `importlib.metadata.version("mem0ai")` to populate `__version__`, distinguishing the core library version from the `mem0-cli` package distribution version (`0.2.13`).
> Sources: [cli/python/src/mem0_cli/__init__.py:3-3](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/python/src/mem0_cli/__init__.py#L3-L3), [mem0/__init__.py:3-3](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/__init__.py#L3-L3)

## Unified CLI Specification and Dual-Runtime Interfaces

### CLI Schema and Branding Specifications

Mem0 unifies its command-line interfaces through a cross-runtime JSON specification file (`cli/cli-spec.json`) that establishes metadata, brand assets, configuration directories, and remote API endpoints for both Python and Node client entrypoints. The specification defines global branding identifiers, color palettes, and operational icons used to render terminal output consistently across runtime boundaries.

| Branding Property | Key / Value | Purpose |
| :--- | :--- | :--- |
| `name` | `mem0` | CLI application command name |
| `version` | `0.1.0` | CLI specification version |
| `logoMini` | `◆ mem0` | Compact CLI banner logo |
| `brand` | `#8b5cf6` | Primary brand color hex code |
| `accent` | `#a78bfa` | Accent color hex code |
| `success` | `#22c55e` | Success indicator color |
| `error` | `#ef4444` | Error indicator color |
| `warning` | `#f59e0b` | Warning indicator color |
| `dim` | `#6b7280` | Dimmed text color |

Sources: [cli/cli-spec.json:1-34](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/cli-spec.json#L1-L34)

> [!NOTE]
> The cross-runtime specification centralizes icon characters such as success (`✓`), error (`✗`), warning (`⚠`), info (`◆`), pending (`⧗`), add (`+`), update (`~`), delete (`-`), noop (`·`), connected (`●`), and disconnected (`●`) to ensure identical terminal rendering across Python and Node.js wrapper implementations.
> Sources: [cli/cli-spec.json:20-32](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/cli-spec.json#L20-L32)

### Configuration Schema and Environment Bindings

Client configuration is structured around local directory storage combined with environment variable overrides. The configuration subsystem maps platform settings and default identifiers to specific environment variables, allowing seamless authentication and scoping for autonomous agents and developer workstations.

| Config Section | Field Name | Type | Default Value | Environment Variable | Redact |
| :--- | :--- | :--- | :--- | :--- | :--- |
| `platform` | `api_key` | `string` | `""` | `MEM0_API_KEY` | `true` |
| `platform` | `base_url` | `string` | `https://api.mem0.ai` | `MEM0_BASE_URL` | — |
| `defaults` | `user_id` | `string` | `""` | `MEM0_USER_ID` | — |
| `defaults` | `agent_id` | `string` | `""` | `MEM0_AGENT_ID` | — |
| `defaults` | `app_id` | `string` | `""` | `MEM0_APP_ID` | — |
| `defaults` | `run_id` | `string` | `""` | `MEM0_RUN_ID` | — |
| `defaults` | `enable_graph` | `boolean` | `false` | `MEM0_ENABLE_GRAPH` | — |

Sources: [cli/cli-spec.json:35-86](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/cli-spec.json#L35-L86)

> [!WARNING]
> The `api_key` field enforces credential redaction (`redact: true`) within logs and configuration dumps, preventing sensitive tokens from leaking into terminal outputs or diagnostic telemetry.
> Sources: [cli/cli-spec.json:43-48](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/cli-spec.json#L43-L48)

### REST Endpoint Mappings

The CLI specification maps remote control actions to standardized REST API endpoints, defining HTTP methods, path patterns, authentication headers, and entity type mappings for remote synchronization [Python Client SDK](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/python-core/python-client-sdk).

| Operation Name | HTTP Method | API Path Pattern |
| :--- | :--- | :--- |
| `add` | `POST` | `/v1/memories/` |
| `search` | `POST` | `/v2/memories/search/` |
| `get` | `GET` | `/v1/memories/{memory_id}/` |
| `list` | `POST` | `/v2/memories/` |
| `update` | `PUT` | `/v1/memories/{memory_id}/` |
| `delete` | `DELETE` | `/v1/memories/{memory_id}/` |
| `deleteAll` | `DELETE` | `/v1/memories/` |
| `entities` | `GET` | `/v1/entities/` |
| `deleteEntities` | `DELETE` | `/v1/entities/` |

Sources: [cli/cli-spec.json:87-98](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/cli-spec.json#L87-L98)

> [!TIP]
> All REST requests enforce an authentication scheme using the `Authorization` header prefixed with the `Token` scheme, operating with a default network timeout of 30 seconds.
> Sources: [cli/cli-spec.json:99-101](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/cli/cli-spec.json#L99-L101)

## Agent Harness Architecture and Plugins Family

### Shared Core and Harness Configuration

The Mem0 agent plugin family relies on a shared core implementation (`memory_core.py`) that handles session event recording, background flushing, redacting sensitive secrets, and local storage operations across diverse IDE harnesses and coding assistants. Plugins configure their runtime environment using `configure_harness()`, which sets up harness-specific naming prefixes, data directories, and source tags for telemetry tracking.

| Harness Parameter | Default Value | Purpose |
| :--- | :--- | :--- |
| `name` | `generic` | Identifier for the active coding assistant harness |
| `env_prefix` | `MEM0_PLUGIN` | Environment variable prefix for configuration overrides |
| `data_dir_name` | `mem0-plugin` | Directory name for local evidence and state storage |
| `source_tag` | `mem0_plugin` | Telemetry source tag identifying the originating plugin |

Sources: [integrations/mem0-agent-plugin/core/memory_core.py:34-38](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L34-L38), [integrations/antigravity-plugin/core/memory_core.py:34-38](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/antigravity-plugin/core/memory_core.py#L34-L38), [integrations/kimi-plugin/core/memory_core.py:34-38](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/kimi-plugin/core/memory_core.py#L34-L38), [integrations/cursor-plugin/core/memory_core.py:34-38](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/cursor-plugin/core/memory_core.py#L34-L38), [integrations/codex-plugin/core/memory_core.py:34-38](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/codex-plugin/core/memory_core.py#L34-L38)

> [!NOTE]
> The shared core defines strict operational boundaries including command, result, and episode character limits, extraction input token caps, and a maximum of 5 flush attempts for offline retry queues.
> Sources: [integrations/mem0-agent-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L62-L72), [integrations/antigravity-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/antigravity-plugin/core/memory_core.py#L62-L72), [integrations/kimi-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/kimi-plugin/core/memory_core.py#L62-L72), [integrations/cursor-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/cursor-plugin/core/memory_core.py#L62-L72), [integrations/codex-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/codex-plugin/core/memory_core.py#L62-L72)

### Diagnostic CLI and Control Operations

Each IDE plugin embeds a command-line interface (`memory_cli.py`) that exposes diagnostic checks, user controls, and lifecycle actions for managing local and remote memories. The CLI uses Python's `argparse` module to dispatch subcommands such as status inspection, health diagnostics, pausing, resuming, and repository purging.

| CLI Subcommand | Arguments / Flags | Action Performed |
| :--- | :--- | :--- |
| `status` | `--json` | Prints operational summary, repo ID, local data path, and API key status |
| `doctor` | `--json` | Runs diagnostic checks against the current workspace and environment |
| `pause` | — | Stops saving and searching memories locally |
| `resume` | — | Resumes saving and searching memories locally |
| `forget` | `--remote`, `--yes`, `--include-project-memory` | Deletes local repository evidence and optionally purges remote scopes |

Sources: [integrations/mem0-agent-plugin/core/memory_cli.py:61-80](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_cli.py#L61-L80), [integrations/antigravity-plugin/core/memory_cli.py:61-80](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/antigravity-plugin/core/memory_cli.py#L61-L80), [integrations/kimi-plugin/core/memory_cli.py:61-80](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/kimi-plugin/core/memory_cli.py#L61-L80), [integrations/cursor-plugin/core/memory_cli.py:61-80](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/cursor-plugin/core/memory_cli.py#L61-L80), [integrations/codex-plugin/core/memory_cli.py:61-80](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/codex-plugin/core/memory_cli.py#L61-L80)

> [!WARNING]
> The `forget` command enforces a safety check requiring the `--yes` flag; without it, the command refuses to delete data and exits with code 2.
> Sources: [integrations/mem0-agent-plugin/core/memory_cli.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_cli.py#L123-L129), [integrations/antigravity-plugin/core/memory_cli.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/antigravity-plugin/core/memory_cli.py#L123-L129), [integrations/kimi-plugin/core/memory_cli.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/kimi-plugin/core/memory_cli.py#L123-L129), [integrations/cursor-plugin/core/memory_cli.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/cursor-plugin/core/memory_cli.py#L123-L129), [integrations/codex-plugin/core/memory_cli.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/codex-plugin/core/memory_cli.py#L123-L129)

### MCP Server Integration and Manifests

Model Context Protocol (MCP) manifests (`mcp.json`) bind the memory core into host IDE environments using standard input/output transport streams. The manifest defines server registration parameters that execute the Python MCP server script within the plugin root directory.

```json
{
  "$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
  "mcpServers": {
    "mem0": {
      "type": "stdio",
      "command": "python3",
      "args": [
        "${PLUGIN_ROOT}/core/mcp_server.py"
      ]
    }
  }
}
```
Sources: [integrations/mem0-agent-plugin/mcp.json:1-12](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/mcp.json#L1-L12)

## External Agent and Workflow Ecosystem

### OpenClaw and Pi Agent Integrations

Mem0 extends beyond core LLM memory engines by providing specialized integrations for agent frameworks, runtime environments, and workflow automation tools. These packages bridge external architectures into the Mem0 memory fabric without requiring custom storage layers.

The [OpenClaw Integration](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/agent-plugins/openclaw-integration) plugin (`openclaw-mem0`) exposes six core memory tools (`memory_search`, `memory_add`, `memory_get`, `memory_list`, `memory_update`, and `memory_delete`) while handling automatic recall and capture across agent turns. It isolates multi-agent setups by routing per-agent namespaces through session key resolution and supports both platform and self-hosted backends. Similarly, the [Pi Agent Plugin](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/agent-plugins/pi-agent-plugin) package structures memory management through exported configuration loaders, scoping handlers, formatting utilities, and command extensions.

```typescript
/**
 * OpenClaw Memory (Mem0) Plugin
 *
 * Long-term memory via Mem0 — supports both the Mem0 platform
 * and the open-source self-hosted SDK. Uses the official `mem0ai` package.
 *
 * Features:
 * - 6 core tools: memory_search, memory_add, memory_get, memory_list,
 *   memory_update, memory_delete
 * - Short-term (session-scoped) and long-term (user-scoped) memory
 * - Auto-recall: injects relevant memories (both scopes) before each agent turn
 * - Auto-capture: stores key facts scoped to the current session after each agent turn
 * - Per-agent isolation: multi-agent setups write/read from separate userId namespaces
 *   automatically via sessionKey routing (zero breaking changes for single-agent setups)
 * - CLI: openclaw mem0 search, openclaw mem0 status
 * - Dual mode: platform or open-source (self-hosted)
 */
```
Sources: [integrations/openclaw/index.ts:1-17](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/openclaw/index.ts#L1-L17)

```typescript
export type {
  Scope,
  Mem0Config,
  ScopeContext,
  CustomCategory,
} from "./types.ts";
export { DEFAULT_CUSTOM_CATEGORIES } from "./types.ts";

export { loadConfig, CONFIG_DIR } from "./config/index.ts";

export { registerMemoryTool, buildToolExecute } from "./memory/tools.ts";
export { detectAppId, detectRunId, resolveSearchFilters, resolveAddParams } from "./memory/scoping.ts";
export { formatAge, formatMemoryCompact, formatMemoryList, groupByCategory } from "./memory/formatting.ts";

export { setupAutoCapture, extractConversation } from "./capture/index.ts";

export { MEMORY_POLICY } from "./prompt.ts";

export { registerCommands } from "./commands.ts";

export { captureEvent, captureToolEvent, captureCommandEvent, _getEventQueue, _resetForTesting } from "./telemetry.ts";

```
Sources: [integrations/pi-agent-plugin/src/index.ts:1-22](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/pi-agent-plugin/src/index.ts#L1-L22)

> [!NOTE]
> The OpenClaw plugin reads authentication settings dynamically from `openclaw.json` plugin config via `readPluginAuth()`, accommodating post-startup login commands (`openclaw mem0 login`) as the single source of truth.
> Sources: [integrations/openclaw/index.ts:98-104](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/openclaw/index.ts#L98-L104)

### Strands Agent Framework Integration

The [Mem0 Strands](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/ecosystem-integrations/mem0-strands) package (`mem0-strands`) provides persistent long-term memory for Strands agents via `Mem0MemoryStore`. It plugs into agent execution loops through a `MemoryManager` to deliver automatic memory injection and extraction.

```python
"""Strands Mem0 -- persistent long-term memory for Strands agents, backed by Mem0.

:class:`Mem0MemoryStore` is a Strands ``MemoryStore`` that plugs into the agent
loop via a :class:`~strands.memory.MemoryManager`, with automatic memory injection
and extraction. It implements both write sinks, so ``extraction`` uses Mem0's
server-side extraction (no extra model call).

For the explicit, model-called tool (``store`` / ``retrieve`` / ``get`` / ``delete``),
use the ``mem0_memory`` tool from ``strands-agents-tools``; a store and the tool can
share one Mem0 backend and namespace.
"""
```
Sources: [integrations/mem0-strands/python/src/mem0_strands/__init__.py:1-11](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-strands/python/src/mem0_strands/__init__.py#L1-L11)

> [!TIP]
> `Mem0MemoryStore` implements both write sinks so that extraction leverages Mem0's server-side extraction natively, avoiding extra language model calls during agent execution.
> Sources: [integrations/mem0-strands/python/src/mem0_strands/__init__.py:4-6](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-strands/python/src/mem0_strands/__init__.py#L4-L6)

## Cross-Subsystem Data and Telemetry Flow

### Background Telemetry and Execution Coordination

End-to-end data coordination across host harnesses, background sync workers, and anonymized diagnostic telemetry relies on decoupled logging and asynchronous flushing. In agent CLI implementations, commands execute within an instantiated `EvidenceStore` context that records control actions, telemetry payloads, and local sqlite state updates before finalizing execution through deferred background worker threads.

```python
if args.plugin_data_dir:
    os.environ["MEM0_CODE_DATA_DIR"] = args.plugin_data_dir
store = EvidenceStore()
try:
    repo = resolve_repo(os.getcwd())
    telemetry.record("control", repo=repo, action=args.command)
```
Sources: [integrations/mem0-agent-plugin/core/memory_cli.py:86-91](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_cli.py#L86-L91)

```python
finally:
    store.close()
    telemetry.spawn_flush()
return 0
```
Sources: [integrations/mem0-agent-plugin/core/memory_cli.py:147-150](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_cli.py#L147-L150)

> [!NOTE]
> Telemetry flushing and local store closures are guaranteed via a `finally` block in CLI entry points, invoking `telemetry.spawn_flush()` to transmit diagnostics asynchronously without blocking shell process exit.
> Sources: [integrations/mem0-agent-plugin/core/memory_cli.py:147-150](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_cli.py#L147-L150)

### Harness Configuration and Data Routing

Runtime contexts receive environment parameters, configuration prefixes, and source identifiers through modular configuration routines. The harness configuration initializes specific global variables governing environment lookup paths, local plugin data directories, and source telemetry tagging.

```python
def configure_harness(
    name: str,
    env_prefix: str = "",
    data_dir_name: str = "",
    source_tag: str = "",
) -> None:
    global _harness_name, _harness_env_prefix, _harness_data_dir_name, _harness_source_tag
    _harness_name = name
    _harness_env_prefix = env_prefix or f"MEM0_{name.upper().replace('-', '_')}"
    _harness_data_dir_name = data_dir_name or f"{name}-plugin"
    _harness_source_tag = source_tag or f"{name.replace('-', '_')}_plugin"

```
Sources: [integrations/mem0-agent-plugin/core/memory_core.py:40-51](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L40-L51)

| Parameter | Default Value | Purpose | Sources |
| :--- | :--- | :--- | :--- |
| `name` | `"generic"` | Identifies the active agent harness or plugin framework | [integrations/mem0-agent-plugin/core/memory_core.py:34](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L34) |
| `env_prefix` | `"MEM0_PLUGIN"` | Prefix for environment variable overrides | [integrations/mem0-agent-plugin/core/memory_core.py:35](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L35) |
| `data_dir_name` | `"mem0-plugin"` | Subdirectory name for local evidence and state storage | [integrations/mem0-agent-plugin/core/memory_core.py:36](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L36) |
| `source_tag` | `"mem0_plugin"` | Telemetry tag identifying the event origin channel | [integrations/mem0-agent-plugin/core/memory_core.py:37](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L37) |

Sources: [integrations/mem0-agent-plugin/core/memory_core.py:34-51](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L34-L51)

## Where to go next

| I want to… | Read |
| --- | --- |
| How do developers and autonomous agents initialize Mem0, capture conversational memories, and query hybrid memory stores with copy-pasteable snippets across Python and Node.js? | [Quick Start](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/orientation/quick-start) |
| How is the Mem0 monorepo organized across Python packages, TypeScript packages, FastAPI backend, Next.js dashboard, CLI implementations, and agent plugins? | [Project Structure](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/orientation/project-structure) |
| How does the Python core memory engine extract, add, update, delete, search, and reset user, agent, and session memories using LLMs and vector backends? | [Memory Lifecycle](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/python-core/memory-lifecycle) |
| How does the Python retrieval engine fuse dense vector similarity, BM25 keyword matching, entity boosting, and temporal recency scoring to rank memories? | [Multi-Signal Retrieval](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/python-core/multi-signal-retrieval) |
| How does the Python engine record state changes, manage SQLite or relational audit logs, and isolate user, agent, run, and metadata scopes? | [Storage and History](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/python-core/storage-and-history) |
| How does Mem0 parse structured entities and temporal facts from raw messages using spaCy and entity extraction pipelines for cross-memory linking? | [Entity Extraction](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/python-core/entity-extraction) |
| How does the Python client interface with the Mem0 hosted platform and self-hosted HTTP endpoints for remote memory synchronization and project scoping? | [Python Client SDK](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/python-core/python-client-sdk) |
| How does the TypeScript OSS package implement the core Memory class, orchestrate LLM extraction, manage message state, and execute CRUD memory operations? | [Typescript Core](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/typescript-core/typescript-core) |
| How does the Python core adapt diverse LLM backends (OpenAI, Anthropic, Bedrock, DeepSeek, Gemini, Groq, Ollama, vLLM, LiteLLM) for structured fact extraction? | [Python LLM Adapters](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/llm-providers/python-llm-adapters) |
| How does the TypeScript engine configure and communicate with language model providers including OpenAI, Anthropic, Google, DeepSeek, and Mistral? | [TypeScript LLM Adapters](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/llm-providers/typescript-llm-adapters) |
| How does the Python engine generate vector embeddings across OpenAI, Azure OpenAI, AWS Bedrock, FastEmbed, Gemini, Hugging Face, Ollama, and Vertex AI? | [Python Embedding Adapters](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/llm-providers/python-embedding-adapters) |
| How does the TypeScript engine instantiate and call embedding generators across providers such as OpenAI, Google, Hugging Face, Bedrock, and FastEmbed? | [TypeScript Embedding Adapters](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/llm-providers/typescript-embedding-adapters) |
| How do Cohere, Hugging Face Cross-Encoder, LLM-based, Sentence Transformer, and ZeroEntropy rerankers re-score candidate memory retrievals? | [Reranking Models](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/llm-providers/reranking-models) |
| What base abstractions, collection schemas, and query filters govern vector store drivers across both Python and TypeScript runtimes? | [Vector Store Architecture](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/vector-stores/vector-store-architecture) |
| How do Qdrant, Pinecone, Milvus, Weaviate, Turbopuffer, Upstash, and S3 Vectors execute cloud-native vector insertion and ANN querying? | [Cloud Vector Backends](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/vector-stores/cloud-vector-backends) |
| How do relational and search engines (pgvector, Elasticsearch, OpenSearch, Redis, Valkey, Cassandra, Neptune Analytics, Oracle, MongoDB, Azure AI Search, Baidu) store embeddings? | [Database Vector Stores](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/vector-stores/database-vector-stores) |
| How do Chroma, FAISS, and in-memory vector implementations provide zero-dependency local indexing for prototyping and unit testing? | [Embedded Vector Stores](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/vector-stores/embedded-vector-stores) |
| How does the self-hosted FastAPI application bootstrap application state, handle CORS, register routers, enforce rate limits, and map errors? | [FastAPI Application](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/server-dashboard/fastapi-application) |
| How does the server issue and validate API keys, manage user passwords, enforce admin RBAC, and handle JWT refresh tokens? | [Server Authentication](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/server-dashboard/server-authentication) |
| How are database connections, SQLAlchemy models, and Alembic migrations structured for user credentials, API keys, request logs, and system settings? | [Database and Migrations](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/server-dashboard/database-and-migrations) |
| What REST endpoints and schemas are exposed for memory manipulation, entity browsing, API key rotation, request telemetry, and health inspection? | [Server API Endpoints](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/server-dashboard/server-api-endpoints) |
| How is the Next.js admin dashboard structured with Redux store state, API query hooks, authentication session providers, and setup wizards? | [Dashboard Architecture](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/server-dashboard/dashboard-architecture) |
| How do the memories, entities, analytics, API keys, webhooks, and settings dashboard pages render system data and trigger admin mutations? | [Dashboard Views](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/server-dashboard/dashboard-views) |
| How does the Python CLI dispatch terminal commands, switch backends (OSS vs Platform), and format rich output? | [Python CLI Architecture](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/cli-tools/python-cli-architecture) |
| How does the TypeScript/Node.js CLI process command line options, resolve authentication tokens, and talk to platform or local backends? | [Node.js CLI Architecture](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/cli-tools/node-js-cli-architecture) |
| How do the CLI init and agent mode commands allow autonomous agents to mint API keys without web browsers and later claim accounts? | [Agent Account Provisioning](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/cli-tools/agent-account-provisioning) |
| How does the CLI sync configuration, MCP tool declarations, and hooks into agent IDE environments? | [Plugin Synchronization](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/cli-tools/plugin-synchronization) |
| How does the common Python plugin core implement memory capture, background flush workers, hook runners, and MCP servers across IDE plugins? | [Python Agent Core](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/agent-plugins/python-agent-core) |
| How does the common TypeScript agent core manage lifecycle hooks, session scoping, prompt synthesis, identity detection, and memory formatting? | [TypeScript Agent Core](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/agent-plugins/typescript-agent-core) |
| How does the Claude Code plugin intercept transcript streams and run MCP tools to synchronize conversation history with Mem0? | [Claude Code Plugin](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/agent-plugins/claude-code-plugin) |
| How do the Cursor, Codex, Kimi, and Antigravity plugins configure MCP manifests, adapt host event hooks, and forward IDE state? | [IDE Plugins Family](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/agent-plugins/ide-plugins-family) |
| How does OpenClaw register memory tools, handle isolation and recall, provide CLI setup wizards, and execute memory CRUD operations? | [OpenClaw Integration](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/agent-plugins/openclaw-integration) |
| How does the OpenCode plugin bind workspace project scopes, manage API key authentication, and inject memories into developer agent turns? | [OpenCode Integration](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/agent-plugins/opencode-integration) |
| How does the Pi Agent plugin implement attribution, command handling, memory formatting, and scoping for agent execution loops? | [Pi Agent Plugin](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/agent-plugins/pi-agent-plugin) |
| How does the Hermes plugin bridge Mem0 memory management into Hermes agent pipelines using custom LLM bindings? | [Hermes Plugin](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/agent-plugins/hermes-plugin) |
| How does Mem0 wrap Vercel AI SDK LanguageModel instances to inject long-term user context and intercept completions? | [Vercel AI SDK Integration](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/ecosystem-integrations/vercel-ai-sdk-integration) |
| How does the mem0-strands package structure thread-level and hierarchical memory graphs for complex agent trajectories? | [Mem0 Strands](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/ecosystem-integrations/mem0-strands) |
| How does the n8n community node expose Mem0 memory operations inside low-code workflow automations? | [n8n Workflow Nodes](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/ecosystem-integrations/n8n-workflow-nodes) |
| How does the Zapier integration implement authentication, memory addition, deletion, and search triggers for automated app zaps? | [Zapier Integration](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/ecosystem-integrations/zapier-integration) |
| How do developer agent skills and the doc search tool provide inline documentation retrieval to AI coding assistants? | [Documentation Agent Skills](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/ecosystem-integrations/documentation-agent-skills) |
| How does Mem0 record, anonymize, and transmit anonymous usage metrics across Python, TypeScript, CLI, and server components? | [Telemetry and Metrics](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/telemetry-ops/telemetry-and-metrics) |
| How does the conformance suite validate plugin adapters and harness behaviors against standardized memory artifacts? | [Plugin Conformance Testing](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/telemetry-ops/plugin-conformance-testing) |
| How do operators migrate memory collections, vector embeddings, and configurations from open-source instances to the Mem0 cloud platform? | [OSS to Platform Migration](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/telemetry-ops/oss-to-platform-migration) |

## Related

- [Quick Start](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/orientation/quick-start)
- [Project Structure](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/orientation/project-structure)
- [Memory Lifecycle](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/python-core/memory-lifecycle)


## Sitemap

See the full [sitemap](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/llms.txt) for all pages in this wiki.
