Doc changes and Storage fix (#2181)

This commit is contained in:
Dev Khant
2025-01-30 23:46:33 +05:30
committed by GitHub
parent 63fbd2dc2c
commit a06c9a99ae
10 changed files with 272 additions and 283 deletions

View File

@@ -53,7 +53,6 @@
"pages": [
"overview",
"quickstart",
"playground",
"features"
]
},
@@ -65,8 +64,7 @@
{
"group": "Features",
"pages": ["features/selective-memory", "features/custom-categories", "features/custom-instructions", "features/direct-import", "features/async-client", "features/memory-export"]
},
"features/langchain-tools"
}
]
},
{
@@ -221,7 +219,8 @@
"integrations/autogen",
"integrations/langchain",
"integrations/langgraph",
"integrations/llama-index"
"integrations/llama-index",
"integrations/langchain-tools"
]
},
{

View File

@@ -18,7 +18,7 @@ Mem0 offers two powerful ways to leverage our technology: our [managed platform]
<Card title="Playground" icon="play" href="playground">
Mem0 in action
</Card>
<Card title="Examples" icon="lightbulb" href="/open-source/quickstart">
<Card title="Examples" icon="lightbulb" href="/examples">
See what you can build with Mem0
</Card>
</CardGroup>

View File

@@ -27,6 +27,6 @@ Check out our [Platform Guide](/platform/guide) to start using Mem0 platform qui
## Next Steps
- Sign up to the [Mem0 Platform](https://mem0.dev/pd)
- Join our [Discord](https://mem0.dev/Did) or [Slack](https://mem0.ai/slack) with other developers and get support.
- Join our [Discord](https://mem0.dev/Did) or [Slack](https://mem0.dev/slack) with other developers and get support.
We're excited to see what you'll build with Mem0 Platform. Let's create smarter, more personalized AI experiences together!

View File

@@ -27,8 +27,12 @@ npm install mem0ai
<CodeGroup>
```python Python
import os
from mem0 import MemoryClient
client = MemoryClient(api_key="your-api-key")
os.environ["MEM0_API_KEY"] = "your-api-key"
client = MemoryClient()
```
```javascript JavaScript
@@ -43,9 +47,12 @@ const client = new MemoryClient({ apiKey: 'your-api-key' });
For asynchronous operations in Python, you can use the AsyncMemoryClient:
```python Python
import os
from mem0 import AsyncMemoryClient
client = AsyncMemoryClient(api_key="your-api-key")
os.environ["MEM0_API_KEY"] = "your-api-key"
client = AsyncMemoryClient()
async def main():
@@ -1641,7 +1648,18 @@ curl -X POST "https://api.mem0.ai/v1/memories/" \
```
```json Output
{'message': 'ok'}
[{'id': '3f4eccba-3b09-497a-81ab-cca1ababb36b',
'memory': 'Is allergic to nuts',
'event': 'DELETE'},
{'id': 'f5dcfbf4-5f0b-422a-8ad4-cadb9e941e25',
'memory': 'Is a vegetarian',
'event': 'DELETE'},
{'id': 'dd32f70c-fa69-4fc7-997b-fb4a66d1a0fa',
'memory': 'Name is Alex',
'event': 'DELETE'}]{'message': 'ok'}
{'id': '3f4eccba-3b09-497a-81ab-cca1ababb36b',
'memory': 'Likes Chicken',
'event': 'DELETE'}
```
</CodeGroup>

View File

@@ -1,25 +0,0 @@
---
title: Interactive Playground
---
Watch Mem0 in action with our Playground tool.
<Steps>
<Step title="Create Mem0 Account">
You'll need to create a free Mem0 account to use the playground this helps ensure responses are more tailored to you by associating interactions with an individual profile.
<Card title="Sign up to Mem0" icon="right-to-bracket" href="https://mem0.dev/pd" horizontal="true">
</Card>
</Step>
<Step title="Go to Playground">
<Card title="Mem0 Playground" icon="play" href="https://mem0.dev/pd-pg" horizontal="true">
</Card>
</Step>
<Step title="Start adding memories">
Chat with the assistant to start adding memories.
![Add memories to playground](/images/playground/pg-add-memory.png)
</Step>
<Step title="Experience the power of Mem0">
Memories are stored in context for all future conversations, creating truly personal AI.
![Retrieve memories in playground](/images/playground/pg-retrieve-memory.png)
</Step>
</Steps>

View File

@@ -3,6 +3,8 @@ title: Quickstart
---
Mem0 offers two powerful ways to leverage our technology: [our managed platform](#mem0-platform-managed-solution) and [our open source solution](#mem0-open-source).
Check out our [Playground](https://mem0.dev/pd-pg) to see Mem0 in action.
<CardGroup cols={2}>
<Card title="Mem0 Platform" icon="chart-simple" href="#mem0-platform-managed-solution">
Better, faster, fully managed, and hassle free solution.
@@ -13,7 +15,7 @@ Mem0 offers two powerful ways to leverage our technology: [our managed platform]
</CardGroup>
## Mem0 Platform (Managed Solution)
## Mem0 Platform
Our fully managed platform provides a hassle-free way to integrate Mem0's capabilities into your AI agents and assistants. Sign up for Mem0 platform [here](https://mem0.dev/pd).
@@ -53,8 +55,12 @@ npm install mem0ai
<Accordion title="Instantiate client">
<CodeGroup>
```python Python
import os
from mem0 import MemoryClient
client = MemoryClient(api_key="your-api-key")
os.environ["MEM0_API_KEY"] = "your-api-key"
client = MemoryClient()
```
```javascript JavaScript
@@ -98,7 +104,15 @@ curl -X POST "https://api.mem0.ai/v1/memories/" \
```
```json Output
{'message': 'ok'}
[{'id': '24e466b5-e1c6-4bde-8a92-f09a327ffa60',
'memory': 'Name is Alex',
'event': 'ADD'},
{'id': 'f2d874ac-09c7-49db-b34a-22cf666bd4ad',
'memory': 'Is a vegetarian',
'event': 'ADD'},
{'id': 'bce04006-01e8-4dbc-8a22-67fa46f1822c',
'memory': 'Is allergic to nuts',
'event': 'ADD'}]
```
</CodeGroup>
</Accordion>
@@ -112,23 +126,43 @@ curl -X POST "https://api.mem0.ai/v1/memories/" \
```python Python
query = "What can I cook for dinner tonight?"
client.search(query, user_id="alex")
filters = {
"AND": [
{
"user_id": "alex"
}
]
}
client.search(query, version="v2", filters=filters)
```
```javascript JavaScript
const query = "What can I cook for dinner tonight?";
client.search(query, { user_id: "alex" })
const filters = {
"AND": [
{
"user_id": "alex"
}
]
};
client.search(query, { version: "v2", filters })
.then(results => console.log(results))
.catch(error => console.error(error));
```
```bash cURL
curl -X POST "https://api.mem0.ai/v1/memories/search/" \
curl -X POST "https://api.mem0.ai/v1/memories/search/?version=v2" \
-H "Authorization: Token your-api-key" \
-H "Content-Type: application/json" \
-d '{
"query": "What can I cook for dinner tonight?",
"user_id": "alex"
"filters": {
"AND": [
{
"user_id": "alex"
}
]
}
}'
```
@@ -163,18 +197,44 @@ curl -X POST "https://api.mem0.ai/v1/memories/search/" \
<CodeGroup>
```python Python
user_memories = client.get_all(user_id="alex")
filters = {
"AND": [
{
"user_id": "alice"
}
]
}
all_memories = client.get_all(version="v2", filters=filters, page=1, page_size=50)
```
```javascript JavaScript
client.getAll({ user_id: "alex" })
const filters = {
"AND": [
{
"user_id": "alice"
}
]
};
client.getAll({ version: "v2", filters, page: 1, page_size: 50 })
.then(memories => console.log(memories))
.catch(error => console.error(error));
```
```bash cURL
curl -X GET "https://api.mem0.ai/v1/memories/?user_id=alex" \
-H "Authorization: Token your-api-key"
curl -X GET "https://api.mem0.ai/v1/memories/?version=v2&page=1&page_size=50" \
-H "Authorization: Token your-api-key" \
-H "Content-Type: application/json" \
-d '{
"filters": {
"AND": [
{
"user_id": "alice"
}
]
}
}'
```
```json Output
@@ -244,7 +304,9 @@ result = m.add("I like to take long walks on weekends.", user_id="alice", metada
```
```json Output
{'message': 'ok'}
[{'id': 'ea9b08ee-09d7-4e8b-9912-687ad65548b4',
'memory': 'Likes to take long walks on weekends',
'event': 'ADD'}]
```
</CodeGroup>
</Accordion>