Per launch feedback (Deshraj, Rudraj): - README.md: Quickstart now opens with "Sign up as an agent" — install, init, add, search. Demoable in 30 seconds. - docs/platform/cli.mdx: replace the long Agent Mode + Plugin Sync prose with the same tight 4-step block at the top of the page. Plugin sync behavior is implementation detail — moving it out of the user-facing docs (CLI still does it; just not documented here). - docs/platform/quickstart.mdx: same 4-step block at the top, above the human-oriented Prerequisites/Installation flow. Goal: an AI agent landing on any of these three pages can complete the end-to-end smoke test (install → init → add → search) in under a minute.
203 lines
5.1 KiB
Plaintext
203 lines
5.1 KiB
Plaintext
---
|
|
title: Quickstart
|
|
description: "Set up your Mem0 Platform account, install the SDK, and store your first memory in under five minutes."
|
|
icon: "bolt"
|
|
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:
|
|
|
|
<CodeGroup>
|
|
```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"
|
|
```
|
|
</CodeGroup>
|
|
|
|
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 (<a href="https://app.mem0.ai?utm_source=oss&utm_medium=platform-quickstart" rel="nofollow">Sign up here</a>)
|
|
- API key (<a href="https://app.mem0.ai/dashboard/settings?tab=api-keys&subtab=configuration" rel="nofollow">Get one from dashboard</a>)
|
|
- Python 3.10+, Node.js 14+, or cURL
|
|
|
|
## Installation
|
|
|
|
<Steps>
|
|
<Step title="Install SDK">
|
|
<CodeGroup>
|
|
```bash pip
|
|
pip install mem0ai
|
|
```
|
|
|
|
```bash npm
|
|
npm install mem0ai
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Step>
|
|
|
|
<Step title="Set your API key">
|
|
<CodeGroup>
|
|
```python Python
|
|
from mem0 import MemoryClient
|
|
|
|
client = MemoryClient(api_key="your-api-key")
|
|
````
|
|
|
|
```javascript JavaScript
|
|
import MemoryClient from 'mem0ai';
|
|
const client = new MemoryClient({ apiKey: 'your-api-key' });
|
|
````
|
|
|
|
```bash cURL
|
|
export MEM0_API_KEY="your-api-key"
|
|
```
|
|
|
|
```bash CLI
|
|
mem0 init --api-key "your-api-key"
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Step>
|
|
|
|
<Step title="Add a memory">
|
|
<CodeGroup>
|
|
```python Python
|
|
messages = [
|
|
{"role": "user", "content": "I'm a vegetarian and allergic to nuts."},
|
|
{"role": "assistant", "content": "Got it! I'll remember your dietary preferences."}
|
|
]
|
|
client.add(messages, user_id="user123")
|
|
````
|
|
|
|
```javascript JavaScript
|
|
const messages = [
|
|
{"role": "user", "content": "I'm a vegetarian and allergic to nuts."},
|
|
{"role": "assistant", "content": "Got it! I'll remember your dietary preferences."}
|
|
];
|
|
await client.add(messages, { userId: "user123" });
|
|
````
|
|
|
|
```bash cURL
|
|
curl -X POST https://api.mem0.ai/v3/memories/add/ \
|
|
-H "Authorization: Token $MEM0_API_KEY" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"messages": [
|
|
{"role": "user", "content": "Im a vegetarian and allergic to nuts."},
|
|
{"role": "assistant", "content": "Got it! Ill remember your dietary preferences."}
|
|
],
|
|
"user_id": "user123"
|
|
}'
|
|
```
|
|
|
|
```bash CLI
|
|
mem0 add "I'm a vegetarian and allergic to nuts." --user-id user123
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Step>
|
|
|
|
<Step title="Search memories">
|
|
<CodeGroup>
|
|
```python Python
|
|
results = client.search("What are my dietary restrictions?", filters={"user_id": "user123"})
|
|
print(results)
|
|
````
|
|
|
|
```javascript JavaScript
|
|
const results = await client.search("What are my dietary restrictions?", { filters: { user_id: "user123" } });
|
|
console.log(results);
|
|
````
|
|
|
|
```bash cURL
|
|
curl -X POST https://api.mem0.ai/v3/memories/search/ \
|
|
-H "Authorization: Token $MEM0_API_KEY" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"query": "What are my dietary restrictions?",
|
|
"filters": {"user_id": "user123"}
|
|
}'
|
|
```
|
|
|
|
```bash CLI
|
|
mem0 search "What are my dietary restrictions?" --user-id user123
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
**Output:**
|
|
|
|
```json
|
|
{
|
|
"results": [
|
|
{
|
|
"id": "14e1b28a-2014-40ad-ac42-69c9ef42193d",
|
|
"memory": "Allergic to nuts",
|
|
"user_id": "user123",
|
|
"categories": ["health"],
|
|
"created_at": "2025-10-22T04:40:22.864647-07:00",
|
|
"score": 0.30
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
</Step>
|
|
</Steps>
|
|
|
|
<Callout type="tip" icon="plug">
|
|
**Pro Tip**: Want AI agents to manage their own memory automatically? Use <Link href="/platform/mem0-mcp">Mem0 MCP</Link> to let LLMs decide when to save, search, and update memories.
|
|
</Callout>
|
|
|
|
## What's Next?
|
|
|
|
<CardGroup cols={3}>
|
|
<Card title="Memory Operations" icon="database" href="/core-concepts/memory-operations/add">
|
|
Learn how to search, update, and delete memories with complete CRUD operations
|
|
</Card>
|
|
|
|
<Card title="Platform Features" icon="star" href="/platform/features/platform-overview">
|
|
Explore advanced features like metadata filtering, graph memory, and webhooks
|
|
</Card>
|
|
|
|
<Card title="API Reference" icon="code" href="/api-reference/memory/add-memories">
|
|
See complete API documentation and integration examples
|
|
</Card>
|
|
</CardGroup>
|
|
|
|
## Additional Resources
|
|
|
|
- **[Platform vs OSS](/platform/platform-vs-oss)** - Understand the differences between Platform and Open Source
|
|
- **[Troubleshooting](/platform/faqs)** - Common issues and solutions
|
|
- **[Integration Examples](/cookbooks/companions/quickstart-demo)** - See Mem0 in action
|