2024-07-17 17:39:57 -07:00
---
2025-06-25 13:27:08 +05:30
title: Quickstart
2026-03-20 02:52:39 -07:00
description: "Set up your Mem0 Platform account, install the SDK, and store your first memory in under five minutes."
2025-06-25 13:27:08 +05:30
icon: "bolt"
2025-02-18 17:52:32 -08:00
iconType: "solid"
2024-07-17 17:39:57 -07:00
---
2025-10-22 23:00:45 +05:30
Get started with Mem0 Platform's hosted API in under 5 minutes. This guide shows you how to authenticate and store your first memory.
2025-02-12 23:18:23 +05:30
2025-10-22 23:00:45 +05:30
## Prerequisites
2024-07-17 17:39:57 -07:00
2026-04-23 06:36:36 -07:00
- Mem0 Platform account (<a href="https://app.mem0.ai?utm_source=oss&utm_medium=platform-quickstart" rel="nofollow">Sign up here</a>)
2026-04-10 19:33:45 +05:30
- API key (<a href="https://app.mem0.ai/dashboard/settings?tab=api-keys&subtab=configuration" rel="nofollow">Get one from dashboard</a>)
2025-10-22 23:00:45 +05:30
- Python 3.10+, Node.js 14+, or cURL
## Installation
<Steps>
<Step title="Install SDK">
2024-07-23 01:02:55 -07:00
<CodeGroup>
```bash pip
2024-07-17 17:39:57 -07:00
pip install mem0ai
```
2024-07-23 01:02:55 -07:00
```bash npm
npm install mem0ai
```
2024-07-17 17:39:57 -07:00
2025-10-22 23:00:45 +05:30
</CodeGroup>
</Step>
2024-07-17 17:39:57 -07:00
2025-10-22 23:00:45 +05:30
<Step title="Set your API key">
2024-07-23 01:02:55 -07:00
<CodeGroup>
```python Python
2024-07-17 17:39:57 -07:00
from mem0 import MemoryClient
2025-01-30 23:46:33 +05:30
2025-10-22 23:00:45 +05:30
client = MemoryClient(api_key="your-api-key")
````
2024-07-17 17:39:57 -07:00
2024-07-23 01:02:55 -07:00
```javascript JavaScript
2024-11-21 23:35:07 +05:30
import MemoryClient from 'mem0ai';
const client = new MemoryClient({ apiKey: 'your-api-key' });
2025-10-22 23:00:45 +05:30
````
2025-03-05 15:27:44 +05:30
2025-10-22 23:00:45 +05:30
```bash cURL
export MEM0_API_KEY="your-api-key"
```
2025-06-25 23:21:49 +05:30
2026-03-28 05:03:01 +05:30
```bash CLI
mem0 init --api-key "your-api-key"
```
2025-10-22 23:00:45 +05:30
</CodeGroup>
</Step>
2025-06-25 23:21:49 +05:30
2025-10-22 23:00:45 +05:30
<Step title="Add a memory">
2025-06-25 23:21:49 +05:30
<CodeGroup>
```python Python
messages = [
2025-10-22 23:00:45 +05:30
{"role": "user", "content": "I'm a vegetarian and allergic to nuts."},
{"role": "assistant", "content": "Got it! I'll remember your dietary preferences."}
2025-06-25 23:21:49 +05:30
]
2025-10-22 23:00:45 +05:30
client.add(messages, user_id="user123")
````
2025-06-25 23:21:49 +05:30
```javascript JavaScript
const messages = [
2025-10-22 23:00:45 +05:30
{"role": "user", "content": "I'm a vegetarian and allergic to nuts."},
{"role": "assistant", "content": "Got it! I'll remember your dietary preferences."}
2025-06-25 23:21:49 +05:30
];
2026-04-12 02:40:54 +05:30
await client.add(messages, { userId: "user123" });
2025-10-22 23:00:45 +05:30
````
```bash cURL
2026-04-16 17:13:13 +05:30
curl -X POST https://api.mem0.ai/v3/memories/add/ \
2025-12-11 00:32:59 +05:30
-H "Authorization: Token $MEM0_API_KEY" \
2025-10-22 23:00:45 +05:30
-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"
}'
2024-08-23 23:56:18 +05:30
```
2026-03-28 05:03:01 +05:30
```bash CLI
mem0 add "I'm a vegetarian and allergic to nuts." --user-id user123
```
2024-08-23 23:56:18 +05:30
</CodeGroup>
2025-10-22 23:00:45 +05:30
</Step>
2024-08-23 23:56:18 +05:30
2025-10-22 23:00:45 +05:30
<Step title="Search memories">
2025-01-18 01:06:22 +05:30
<CodeGroup>
```python Python
2025-10-22 23:00:45 +05:30
results = client.search("What are my dietary restrictions?", filters={"user_id": "user123"})
print(results)
````
2025-06-05 23:53:04 -07:00
```javascript JavaScript
2025-10-22 23:00:45 +05:30
const results = await client.search("What are my dietary restrictions?", { filters: { user_id: "user123" } });
console.log(results);
````
2024-08-09 00:27:54 -07:00
2025-10-22 23:00:45 +05:30
```bash cURL
2026-04-16 17:13:13 +05:30
curl -X POST https://api.mem0.ai/v3/memories/search/ \
2025-12-11 00:32:59 +05:30
-H "Authorization: Token $MEM0_API_KEY" \
2025-10-22 23:00:45 +05:30
-H "Content-Type: application/json" \
-d '{
"query": "What are my dietary restrictions?",
"filters": {"user_id": "user123"}
}'
2024-08-09 00:27:54 -07:00
```
2026-03-28 05:03:01 +05:30
```bash CLI
mem0 search "What are my dietary restrictions?" --user-id user123
```
2024-08-09 00:27:54 -07:00
</CodeGroup>
2025-10-22 23:00:45 +05:30
**Output:**
2024-07-17 17:39:57 -07:00
2025-10-22 23:00:45 +05:30
```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
}
]
}
2024-07-17 17:39:57 -07:00
```
2025-10-22 23:00:45 +05:30
</Step>
</Steps>
2024-07-17 17:39:57 -07:00
2025-12-15 22:03:23 +05:30
<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>
2025-10-22 23:00:45 +05:30
## What's Next?
2024-07-17 17:39:57 -07:00
2025-10-22 23:00:45 +05:30
<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>
2024-07-20 02:44:33 -07:00
2025-10-22 23:00:45 +05:30
<Card title="Platform Features" icon="star" href="/platform/features/platform-overview">
Explore advanced features like metadata filtering, graph memory, and webhooks
</Card>
2024-09-09 19:06:22 -07:00
2025-10-22 23:00:45 +05:30
<Card title="API Reference" icon="code" href="/api-reference/memory/add-memories">
See complete API documentation and integration examples
</Card>
</CardGroup>
2025-02-12 23:18:23 +05:30
2025-10-22 23:00:45 +05:30
## Additional Resources
2024-07-20 02:44:33 -07:00
2025-10-22 23:00:45 +05:30
- **[Platform vs OSS](/platform/platform-vs-oss)** - Understand the differences between Platform and Open Source
- **[Troubleshooting](/platform/faqs)** - Common issues and solutions
2025-10-27 00:19:29 +05:30
- **[Integration Examples](/cookbooks/companions/quickstart-demo)** - See Mem0 in action