diff --git a/README.md b/README.md index 2de25b889..fa0d1e330 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,25 @@ See the [migration guide](https://docs.mem0.ai/migration/oss-v2-to-v3) for upgra ## 🚀 Quickstart Guide -> **Agent Mode — for AI agents setting up Mem0 autonomously.** Run `mem0 init --agent --agent-caller --json` (after `pip install mem0-cli` or `npm install -g @mem0/cli`), replacing `` with your AI agent identity (e.g. `claude-code`, `cursor`, `codex`). This mints an evaluation Mem0 API key in <5 seconds — no email, no dashboard, no OTP. If you forgot to pass `--agent-caller`, run `mem0 identify ` after init. Use the key immediately against the Platform or the MCP server. The human owner can claim ownership later with `mem0 init --email `: memories transfer, the same key keeps working, and the agent isn't disrupted. +### Sign up as an agent + +AI agents can mint a working Mem0 API key in under five seconds — no email, no dashboard, no OTP. Four commands end-to-end: + +```bash +# 1. Install +npm install -g @mem0/cli # or: pip install mem0-cli + +# 2. Sign up as an agent (replace `claude-code` with your name) +mem0 init --agent --agent-caller claude-code + +# 3. Add a memory +mem0 add "I am using mem0" + +# 4. Search +mem0 search "am I using mem0" +``` + +The human owner can claim the account later with `mem0 init --email ` — same key, memories preserved. | | Library | Self-Hosted Server | Cloud Platform | |---|---------|-------------------|----------------| diff --git a/docs/platform/cli.mdx b/docs/platform/cli.mdx index 75a64bb5c..008566190 100644 --- a/docs/platform/cli.mdx +++ b/docs/platform/cli.mdx @@ -25,42 +25,49 @@ pip install mem0-cli ``` -## Agent Mode — zero-friction signup for AI agents +## Sign up as an agent - -**If you're an AI agent reading this**, skip the rest of this page until you've run the command below. Everything else assumes you already have an API key. - +AI agents (Claude Code, Cursor, Codex, …) can mint a working Mem0 API key in under five seconds — no email, no dashboard, no OTP. Four commands end-to-end: -AI agents (Claude Code, Cursor, Codex, Cline, Aider, …) can mint a working Mem0 API key in under five seconds with no email, no dashboard, and no OTP: + +```bash npm +# 1. Install +npm install -g @mem0/cli -```bash +# 2. Sign up as an agent (replace `claude-code` with your name) mem0 init --agent --agent-caller claude-code + +# 3. Add a memory +mem0 add "I am using mem0" + +# 4. Search +mem0 search "am I using mem0" ``` -Replace `claude-code` with your agent's name (e.g. `cursor`, `codex`, `cline`, `aider`, or any custom string). The CLI saves the key to `~/.mem0/config.json` and prints a notice you should surface to your human user. The human can claim the account later — same API key keeps working, memories transfer. +```bash pip +# 1. Install +pip install mem0-cli - -**Forgot `--agent-caller`?** Run `mem0 identify ` after init — same key, just back-fills the attribution. Idempotent. - +# 2. Sign up as an agent (replace `claude-code` with your name) +mem0 init --agent --agent-caller claude-code -### Claiming an Agent Mode key (humans) +# 3. Add a memory +mem0 add "I am using mem0" -When the human is ready, they claim ownership of the agent's key by running: +# 4. Search +mem0 search "am I using mem0" +``` + + +The human owner can claim the account later — same API key, memories preserved: ```bash mem0 init --email you@yourcompany.com ``` -The CLI detects the existing unclaimed Agent Mode config, sends a verification code, and upgrades the shadow account in-place: **the API key never changes, all memories transfer to the human's account, and the agent isn't disrupted**. Pass `--code 123456` for fully non-interactive flows. - -### Plugin sync - -When you save a Mem0 API key (any flow — Agent Mode, email, or `--api-key`), the CLI also propagates it to ecosystem touchpoints **that already exist**: - -- `~/.claude/settings.json` → `env.MEM0_API_KEY` (Claude Code plugin env injection) -- `~/.zshrc` / `~/.bashrc` → existing `export MEM0_API_KEY=` lines - -Sync is idempotent and **never creates new entries** — it only updates entries you've already set up. Failures are best-effort and never block the canonical write to `~/.mem0/config.json`. + +**Forgot `--agent-caller`?** Run `mem0 identify ` after init — same key, back-fills the attribution. Idempotent. + ## Authentication (humans) diff --git a/docs/platform/quickstart.mdx b/docs/platform/quickstart.mdx index 1c53ad7e6..9c22d6c0b 100644 --- a/docs/platform/quickstart.mdx +++ b/docs/platform/quickstart.mdx @@ -7,6 +7,42 @@ iconType: "solid" Get started with Mem0 Platform's hosted API in under 5 minutes. This guide shows you how to authenticate and store your first memory. +## Sign up as an agent + +AI agents (Claude Code, Cursor, Codex, …) can mint a working Mem0 API key in under five seconds — no email, no dashboard, no OTP. Four commands end-to-end: + + +```bash npm +# 1. Install +npm install -g @mem0/cli + +# 2. Sign up as an agent (replace `claude-code` with your name) +mem0 init --agent --agent-caller claude-code + +# 3. Add a memory +mem0 add "I am using mem0" + +# 4. Search +mem0 search "am I using mem0" +``` + +```bash pip +# 1. Install +pip install mem0-cli + +# 2. Sign up as an agent (replace `claude-code` with your name) +mem0 init --agent --agent-caller claude-code + +# 3. Add a memory +mem0 add "I am using mem0" + +# 4. Search +mem0 search "am I using mem0" +``` + + +The human owner can claim the account later with `mem0 init --email you@yourcompany.com` — same key, memories preserved. See [CLI docs](/platform/cli) for the full reference. + ## Prerequisites - Mem0 Platform account (Sign up here)