[docs] python quickstart fix (#3742)

This commit is contained in:
Parth Sharma
2025-11-13 10:18:55 -08:00
committed by GitHub
parent 9f921e27cb
commit 61e2a40d55
2 changed files with 23 additions and 4 deletions
+4
View File
@@ -1055,6 +1055,10 @@
{ {
"source": "/v0x/examples/aws_neptune_analytics_hybrid_store", "source": "/v0x/examples/aws_neptune_analytics_hybrid_store",
"destination": "/cookbooks/integrations/neptune-analytics" "destination": "/cookbooks/integrations/neptune-analytics"
},
{
"source": "/features/memory-export",
"destination": "/platform/features/memory-export"
} }
] ]
} }
+19 -4
View File
@@ -11,6 +11,16 @@ Get started with Mem0's Python SDK in under 5 minutes. This guide shows you how
- Python 3.10 or higher - Python 3.10 or higher
- OpenAI API key ([Get one here](https://platform.openai.com/api-keys)) - OpenAI API key ([Get one here](https://platform.openai.com/api-keys))
Set your OpenAI API key:
```bash
export OPENAI_API_KEY="your-openai-api-key"
```
<Note>
Uses OpenAI by default. Want to use Ollama, Anthropic, or local models? See [Configuration](/open-source/configuration).
</Note>
## Installation ## Installation
<Steps> <Steps>
@@ -24,8 +34,9 @@ pip install mem0ai
```python ```python
from mem0 import Memory from mem0 import Memory
m = Memory(api_key="your-openai-api-key") m = Memory()
```
````
</Step> </Step>
<Step title="Add a memory"> <Step title="Add a memory">
@@ -35,7 +46,8 @@ messages = [
{"role": "assistant", "content": "Hey Alex! I'll remember your interests."} {"role": "assistant", "content": "Hey Alex! I'll remember your interests."}
] ]
m.add(messages, user_id="alex") m.add(messages, user_id="alex")
``` ````
</Step> </Step>
<Step title="Search memories"> <Step title="Search memories">
@@ -45,6 +57,7 @@ print(results)
``` ```
**Output:** **Output:**
```json ```json
{ {
"results": [ "results": [
@@ -59,9 +72,11 @@ print(results)
] ]
} }
``` ```
</Step> </Step>
</Steps> </Steps>
<Note> <Note>
By default `Memory()` wires up: By default `Memory()` wires up:
- OpenAI `gpt-4.1-nano-2025-04-14` for fact extraction and updates - OpenAI `gpt-4.1-nano-2025-04-14` for fact extraction and updates
@@ -79,7 +94,7 @@ Learn how to search, update, and manage memories with full CRUD operations
</Card> </Card>
<Card title="Configuration" icon="sliders" href="/open-source/configuration"> <Card title="Configuration" icon="sliders" href="/open-source/configuration">
Customize Mem0 with different LLMs, vector stores, and embedders for production use Customize Mem0 with different LLMs, vector stores, and embedders for production use
</Card> </Card>
<Card title="Advanced Features" icon="sparkles" href="/open-source/features/async-memory"> <Card title="Advanced Features" icon="sparkles" href="/open-source/features/async-memory">