docs: Mem0 Integration (#1216)

Co-authored-by: Anush  <anushshetty90@gmail.com>
This commit is contained in:
Dev Khant
2024-10-05 13:47:48 +05:30
committed by GitHub
co-authored by Anush
parent dcb0a9115b
commit e639d55a82
3 changed files with 67 additions and 0 deletions
@@ -19,6 +19,7 @@ weight: 20
| [Langchain-Go](/documentation/frameworks/langchain-go/) | Go framework for building context-aware, reasoning applications using LLMs. |
| [Langchain4j](/documentation/frameworks/langchain4j/) | Java framework for building context-aware, reasoning applications using LLMs. |
| [LlamaIndex](/documentation/frameworks/llama-index/) | A data framework for building LLM applications with modular integrations. |
| [Mem0](/documentation/frameworks/mem0/) | Self-improving memory layer for LLM applications, enabling personalized AI experiences. |
| [MemGPT](/documentation/frameworks/memgpt/) | System to build LLM agents with long term memory & custom tools |
| [Pandas-AI](/documentation/frameworks/pandas-ai/) | Python library to query/visualize your data (CSV, XLSX, PostgreSQL, etc.) in natural language |
| [Semantic Router](/documentation/frameworks/semantic-router/) | Python library to build a decision-making layer for AI applications using vector search. |
@@ -0,0 +1,66 @@
---
title: Mem0
---
![Mem0 Logo](/documentation/frameworks/mem0/mem0-banner.png)
[Mem0](https://mem0.ai) is a self-improving memory layer for LLM applications, enabling personalized AI experiences that save costs and delight users. Mem0 remembers user preferences, adapts to individual needs, and continuously improves over time, ideal for chatbots and AI systems.
Mem0 supports various vector store providers, including Qdrant, for efficient data handling and search capabilities.
## Installation
To install Mem0 with Qdrant support, use the following command:
```sh
pip install mem0ai
```
## Usage
Here's a basic example of how to use Mem0 with Qdrant:
```python
import os
from mem0 import Memory
os.environ["OPENAI_API_KEY"] = "sk-xx"
config = {
"vector_store": {
"provider": "qdrant",
"config": {
"collection_name": "test",
"host": "localhost",
"port": 6333,
}
}
}
m = Memory.from_config(config)
m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})
```
## Configuration
When configuring Mem0 to use Qdrant as the vector store, you can specify [various parameters](https://docs.mem0.ai/components/vectordbs/dbs/qdrant#config) in the `config` dictionary.
## Advanced Usage
Mem0 provides additional functionality for managing and querying your vector data. Here are some examples:
```python
# Search memories
related_memories = m.search(query="What are Alice's hobbies?", user_id="alice")
# Update existing memory
result = m.update(memory_id="m1", data="Likes to play tennis on weekends")
# Get memory history
history = m.history(memory_id="m1")
```
## Further Reading
- [Mem0 GitHub Repository](https://github.com/mem0ai/mem0)
- [Mem0 Documentation](https://docs.mem0.ai/).