Update Docs (#3520)
This commit is contained in:
@@ -7,7 +7,7 @@ iconType: "solid"
|
||||
|
||||
## AsyncMemory
|
||||
|
||||
The `AsyncMemory` class is a direct asynchronous interface to Mem0's in-process memory operations. Unlike the memory, which interacts with an API, `AsyncMemory` works directly with the underlying storage systems. This makes it ideal for applications where you want to embed Mem0 directly into your codebase.
|
||||
The `AsyncMemory` class is a direct asynchronous interface to Mem0's in-process memory operations. Unlike the synchronous memory class, which interacts with an API, `AsyncMemory` works directly with the underlying storage systems. This makes it ideal for applications where you want to embed Mem0 directly into your codebase.
|
||||
|
||||
### Initialization
|
||||
|
||||
@@ -30,10 +30,10 @@ memory = AsyncMemory(config=custom_config)
|
||||
|
||||
### Key Features
|
||||
|
||||
1. **Non-blocking Operations** - All memory operations use `asyncio` to avoid blocking the event loop
|
||||
2. **Concurrent Processing** - Parallel execution of vector store and graph operations
|
||||
3. **Efficient Resource Utilization** - Better handling of I/O bound operations
|
||||
4. **Compatible with Async Frameworks** - Seamless integration with FastAPI, aiohttp, and other async frameworks
|
||||
1. **Non-blocking Operations**: All memory operations use `asyncio` to avoid blocking the event loop.
|
||||
2. **Concurrent Processing**: Parallel execution of vector store and graph operations.
|
||||
3. **Efficient Resource Utilization**: Better handling of I/O-bound operations.
|
||||
4. **Compatible with Async Frameworks**: Seamless integration with FastAPI, aiohttp, and other async frameworks.
|
||||
|
||||
### Methods
|
||||
|
||||
@@ -182,7 +182,7 @@ except Exception as e:
|
||||
|
||||
### Example: Concurrent Usage with Other APIs
|
||||
|
||||
`AsyncMemory` can be effectively combined with other async operations. Here's an example showing how to use it alongside OpenAI API calls in separate threads:
|
||||
`AsyncMemory` can be effectively combined with other async operations. Here's an example showing how to use it alongside OpenAI API calls:
|
||||
|
||||
```python Python
|
||||
import asyncio
|
||||
@@ -199,7 +199,7 @@ async def chat_with_memories(message: str, user_id: str = "default_user") -> str
|
||||
relevant_memories = search_result["results"]
|
||||
memories_str = "\n".join(f"- {entry['memory']}" for entry in relevant_memories)
|
||||
|
||||
# Generate Assistant response
|
||||
# Generate assistant response
|
||||
system_prompt = f"You are a helpful AI. Answer the question based on query and memories.\nUser Memories:\n{memories_str}"
|
||||
messages = [{"role": "system", "content": system_prompt}, {"role": "user", "content": message}]
|
||||
response = await async_openai_client.chat.completions.create(model="gpt-4o-mini", messages=messages)
|
||||
|
||||
@@ -7,8 +7,7 @@ iconType: "solid"
|
||||
|
||||
## Introduction to Custom Fact Extraction Prompt
|
||||
|
||||
Custom fact extraction prompt allow you to tailor the behavior of your Mem0 instance to specific use cases or domains.
|
||||
By defining it, you can control how information is extracted from the user's message.
|
||||
Custom fact extraction prompts allow you to tailor the behavior of your Mem0 instance to specific use cases or domains. By defining them, you can control how information is extracted from the user's messages.
|
||||
|
||||
To create an effective custom fact extraction prompt:
|
||||
1. Be specific about the information to extract.
|
||||
@@ -146,8 +145,7 @@ await memory.add('Yesterday, I ordered a laptop, the order id is 12345', { userI
|
||||
|
||||
### Example 2
|
||||
|
||||
In this example, we are adding a memory of a user liking to go on hikes. This add message is not specific to the use-case mentioned in the custom prompt.
|
||||
Hence, the memory is not added.
|
||||
In this example, we are adding a memory of a user liking to go on hikes. This message is not specific to the use case mentioned in the custom prompt. Hence, the memory is not added.
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
|
||||
@@ -5,23 +5,18 @@ iconType: "solid"
|
||||
---
|
||||
|
||||
|
||||
Update memory prompt is a prompt used to determine the action to be performed on the memory.
|
||||
By customizing this prompt, you can control how the memory is updated.
|
||||
The update memory prompt is used to determine the action to be performed on the memory. By customizing this prompt, you can control how the memory is updated.
|
||||
|
||||
## Introduction
|
||||
|
||||
The Mem0 memory system compares newly retrieved facts with existing memory and determines the action to be performed. The types of actions are:
|
||||
- **Add**: Add the newly retrieved facts to the memory.
|
||||
- **Update**: Update the existing memory with the newly retrieved facts.
|
||||
- **Delete**: Delete the existing memory.
|
||||
- **No Change**: Do not make any changes to the memory.
|
||||
|
||||
## Introduction
|
||||
Mem0 memory system compares the newly retrieved facts with the existing memory and determines the action to be performed on the memory.
|
||||
The kinds of actions are:
|
||||
- Add
|
||||
- Add the newly retrieved facts to the memory.
|
||||
- Update
|
||||
- Update the existing memory with the newly retrieved facts.
|
||||
- Delete
|
||||
- Delete the existing memory.
|
||||
- No Change
|
||||
- Do not make any changes to the memory.
|
||||
|
||||
### Example
|
||||
|
||||
Example of a custom update memory prompt:
|
||||
|
||||
<CodeGroup>
|
||||
@@ -178,7 +173,8 @@ Please note to return the IDs in the output from the input IDs only and do not g
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
## Output format
|
||||
## Output Format
|
||||
|
||||
The prompt needs to guide the output to follow the structure as shown below:
|
||||
<CodeGroup>
|
||||
```json Add
|
||||
@@ -232,10 +228,10 @@ The prompt needs to guide the output to follow the structure as shown below:
|
||||
</CodeGroup>
|
||||
|
||||
|
||||
## custom update memory prompt vs custom prompt
|
||||
## Custom Update Memory Prompt vs Custom Prompt
|
||||
|
||||
| Feature | `custom_update_memory_prompt` | `custom_prompt` |
|
||||
|---------|-------------------------------|-----------------|
|
||||
| Use case | Determine the action to be performed on the memory | Extract the facts from messages |
|
||||
| Use case | Determine the action to be performed on the memory | Extract facts from messages |
|
||||
| Reference | Retrieved facts from messages and old memory | Messages |
|
||||
| Output | Action to be performed on the memory | Extracted facts |
|
||||
@@ -69,10 +69,10 @@ client.add(messages, user_id="alice")
|
||||
## Supported Image Formats
|
||||
|
||||
Mem0 supports common image formats:
|
||||
- **JPEG/JPG** - Standard photos and images
|
||||
- **PNG** - Images with transparency support
|
||||
- **WebP** - Modern web-optimized format
|
||||
- **GIF** - Animated and static graphics
|
||||
- **JPEG/JPG**: Standard photos and images
|
||||
- **PNG**: Images with transparency support
|
||||
- **WebP**: Modern web-optimized format
|
||||
- **GIF**: Animated and static graphics
|
||||
|
||||
## Local Files vs URLs
|
||||
|
||||
@@ -224,9 +224,9 @@ client.add(messages, user_id="user123")
|
||||
- **Resolution**: Images are automatically resized if needed
|
||||
|
||||
### Performance Tips
|
||||
1. **Compress large images** before sending to reduce processing time
|
||||
2. **Use appropriate formats** - JPEG for photos, PNG for graphics with text
|
||||
3. **Batch processing** - Send multiple images in separate requests for better reliability
|
||||
1. **Compress large images** before sending to reduce processing time.
|
||||
2. **Use appropriate formats**: JPEG for photos, PNG for graphics with text.
|
||||
3. **Batch processing**: Send multiple images in separate requests for better reliability.
|
||||
|
||||
## Error Handling
|
||||
|
||||
@@ -291,19 +291,19 @@ try {
|
||||
## Best Practices
|
||||
|
||||
### Image Selection
|
||||
- **Use high-quality images** with clear, readable text and details
|
||||
- **Ensure good lighting** in photos for better text extraction
|
||||
- **Avoid heavily stylized fonts** that may be difficult to read
|
||||
- **Use high-quality images** with clear, readable text and details.
|
||||
- **Ensure good lighting** in photos for better text extraction.
|
||||
- **Avoid heavily stylized fonts** that may be difficult to read.
|
||||
|
||||
### Memory Context
|
||||
- **Provide context** about what information you want extracted
|
||||
- **Combine with text** to give Mem0 better understanding of the image's purpose
|
||||
- **Be specific** about what aspects of the image are important
|
||||
- **Provide context** about what information you want extracted.
|
||||
- **Combine with text** to give Mem0 better understanding of the image's purpose.
|
||||
- **Be specific** about what aspects of the image are important.
|
||||
|
||||
### Privacy and Security
|
||||
- **Avoid sensitive information** in images (SSN, passwords, private data)
|
||||
- **Use secure image hosting** for URLs to prevent unauthorized access
|
||||
- **Consider local processing** for highly sensitive visual content
|
||||
- **Avoid sensitive information** in images (SSN, passwords, private data).
|
||||
- **Use secure image hosting** for URLs to prevent unauthorized access.
|
||||
- **Consider local processing** for highly sensitive visual content.
|
||||
|
||||
Using these methods, you can seamlessly incorporate various visual content types into your interactions, further enhancing Mem0's multimodal capabilities for more comprehensive memory management.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ iconType: "solid"
|
||||
|
||||
Mem0 can be easily integrated into chat applications to enhance conversational agents with structured memory. Mem0's APIs are designed to be compatible with OpenAI's, with the goal of making it easy to leverage Mem0 in applications you may have already built.
|
||||
|
||||
If you have a `Mem0 API key`, you can use it to initialize the client. Alternatively, you can initialize Mem0 without an API key if you're using it locally.
|
||||
If you have a Mem0 API key, you can use it to initialize the client. Alternatively, you can initialize Mem0 without an API key if you're using it locally.
|
||||
|
||||
Mem0 supports several language models (LLMs) through integration with various [providers](https://litellm.vercel.app/docs/providers).
|
||||
|
||||
@@ -21,7 +21,7 @@ client = Mem0(api_key="m0-xxx")
|
||||
messages = [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "I love indian food but I cannot eat pizza since allergic to cheese."
|
||||
"content": "I love Indian food but I cannot eat pizza since I'm allergic to cheese."
|
||||
},
|
||||
]
|
||||
user_id = "alice"
|
||||
@@ -51,7 +51,7 @@ print(chat_completion.choices[0].message.content)
|
||||
|
||||
In this example, you can see how the second response is tailored based on the information provided in the first interaction. Mem0 remembers the user's preference for Indian food and their cheese allergy, using this information to provide more relevant and personalized restaurant suggestions in San Francisco.
|
||||
|
||||
### Use Mem0 OSS
|
||||
## Use Mem0 OSS
|
||||
|
||||
```python
|
||||
config = {
|
||||
|
||||
@@ -54,4 +54,4 @@ Choose your preferred approach:
|
||||
- Check out our [examples](/examples) for practical implementations
|
||||
- Join our [Discord community](https://mem0.dev/DiD) for support
|
||||
|
||||
We're excited to see what you'll build with Mem0 open-source. Let's create smarter, more personalized AI experiences together!
|
||||
We're excited to see what you'll build with Mem0 open-source.
|
||||
|
||||
@@ -12,13 +12,13 @@ Mem0 provides a REST API server (written using FastAPI). Users can perform all o
|
||||
|
||||
## Features
|
||||
|
||||
- **Create memories:** Create memories based on messages for a user, agent, or run.
|
||||
- **Retrieve memories:** Get all memories for a given user, agent, or run.
|
||||
- **Search memories:** Search stored memories based on a query.
|
||||
- **Update memories:** Update an existing memory.
|
||||
- **Delete memories:** Delete a specific memory or all memories for a user, agent, or run.
|
||||
- **Reset memories:** Reset all memories for a user, agent, or run.
|
||||
- **OpenAPI Documentation:** Accessible via `/docs` endpoint.
|
||||
- **Create memories**: Create memories based on messages for a user, agent, or run.
|
||||
- **Retrieve memories**: Get all memories for a given user, agent, or run.
|
||||
- **Search memories**: Search stored memories based on a query.
|
||||
- **Update memories**: Update an existing memory.
|
||||
- **Delete memories**: Delete a specific memory or all memories for a user, agent, or run.
|
||||
- **Reset memories**: Reset all memories for a user, agent, or run.
|
||||
- **OpenAPI Documentation**: Accessible via `/docs` endpoint.
|
||||
|
||||
## Running Locally
|
||||
|
||||
|
||||
@@ -5,15 +5,13 @@ icon: "list-check"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Graph Memory is a powerful feature that allows users to create and utilize complex relationships between pieces of information.
|
||||
Graph Memory is a powerful feature that allows you to create and utilize complex relationships between pieces of information.
|
||||
|
||||
## Graph Memory supports the following features:
|
||||
## Graph Memory Features
|
||||
|
||||
### Using Custom Prompts
|
||||
|
||||
Users can specify a custom prompt that will be used to extract specific entities from the given input text.
|
||||
This allows for more targeted and relevant information extraction based on the user's needs.
|
||||
Here's an example of how to specify a custom prompt:
|
||||
You can specify a custom prompt that will be used to extract specific entities from the given input text. This allows for more targeted and relevant information extraction based on your needs. Here's an example of how to specify a custom prompt:
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
|
||||
@@ -5,13 +5,7 @@ icon: "info"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Mem0 now supports **Graph Memory**.
|
||||
With Graph Memory, users can now create and utilize complex relationships between pieces of information, allowing for more nuanced and context-aware responses.
|
||||
This integration enables users to leverage the strengths of both vector-based and graph-based approaches, resulting in more accurate and comprehensive information retrieval and generation.
|
||||
|
||||
<Note>
|
||||
NodeSDK now supports Graph Memory. 🎉
|
||||
</Note>
|
||||
Mem0 now supports **Graph Memory**. With Graph Memory, you can create and utilize complex relationships between pieces of information, allowing for more nuanced and context-aware responses. This integration enables you to leverage the strengths of both vector-based and graph-based approaches, resulting in more accurate and comprehensive information retrieval and generation.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -47,17 +41,16 @@ allowfullscreen
|
||||
|
||||
## Initialize Graph Memory
|
||||
|
||||
To initialize Graph Memory you'll need to set up your configuration with graph
|
||||
store providers. Currently, we support [Neo4j](#initialize-neo4j), [Memgraph](#initialize-memgraph), [Neptune Analytics](#initialize-neptune-analytics), [Neptune DB Cluster](#initialize-neptune-db),and [Kuzu](#initialize-kuzu) as graph store providers.
|
||||
To initialize Graph Memory you'll need to set up your configuration with graph store providers. Currently, we support [Neo4j](#initialize-neo4j), [Memgraph](#initialize-memgraph), [Neptune Analytics](#initialize-neptune-analytics), [Neptune DB Cluster](#initialize-neptune-db),and [Kuzu](#initialize-kuzu) as graph store providers.
|
||||
|
||||
|
||||
### Initialize Neo4j
|
||||
|
||||
You can setup [Neo4j](https://neo4j.com/) locally or use the hosted [Neo4j AuraDB](https://neo4j.com/product/auradb/).
|
||||
|
||||
<Note>If you are using Neo4j locally, then you need to install [APOC plugins](https://neo4j.com/labs/apoc/4.1/installation/).</Note>
|
||||
<Note>If you are using Neo4j locally, you need to install [APOC plugins](https://neo4j.com/labs/apoc/4.1/installation/).</Note>
|
||||
|
||||
User can also customize the LLM for Graph Memory from the [Supported LLM list](https://docs.mem0.ai/components/llms/overview) with three levels of configuration:
|
||||
You can also customize the LLM for Graph Memory from the [Supported LLM list](https://docs.mem0.ai/components/llms/overview) with three levels of configuration:
|
||||
|
||||
1. **Main Configuration**: If `llm` is set in the main config, it will be used for all graph operations.
|
||||
2. **Graph Store Configuration**: If `llm` is set in the graph_store config, it will override the main config `llm` and be used specifically for graph operations.
|
||||
@@ -176,13 +169,11 @@ Run Memgraph with Docker:
|
||||
docker run -p 7687:7687 memgraph/memgraph-mage:latest --schema-info-enabled=True
|
||||
```
|
||||
|
||||
The `--schema-info-enabled` flag is set to `True` for more performant schema
|
||||
generation.
|
||||
The `--schema-info-enabled` flag is set to `True` for more performant schema generation.
|
||||
|
||||
Additional information can be found on [Memgraph
|
||||
documentation](https://memgraph.com/docs).
|
||||
Additional information can be found in the [Memgraph documentation](https://memgraph.com/docs).
|
||||
|
||||
User can also customize the LLM for Graph Memory from the [Supported LLM list](https://docs.mem0.ai/components/llms/overview) with three levels of configuration:
|
||||
You can also customize the LLM for Graph Memory from the [Supported LLM list](https://docs.mem0.ai/components/llms/overview) with three levels of configuration:
|
||||
|
||||
1. **Main Configuration**: If `llm` is set in the main config, it will be used for all graph operations.
|
||||
2. **Graph Store Configuration**: If `llm` is set in the graph_store config, it will override the main config `llm` and be used specifically for graph operations.
|
||||
@@ -234,6 +225,7 @@ m = Memory.from_config(config_dict=config)
|
||||
Note: You can use Neptune Analytics as part of an Amazon tech stack [Setup AWS Bedrock, AOSS, and Neptune](https://docs.mem0.ai/examples/aws_example#aws-bedrock-and-aoss)
|
||||
|
||||
Create an instance of Amazon Neptune Analytics in your AWS account following the [AWS documentation](https://docs.aws.amazon.com/neptune-analytics/latest/userguide/get-started.html).
|
||||
|
||||
- Public connectivity is not enabled by default, and if accessing from outside a VPC, it needs to be enabled.
|
||||
- Once the Amazon Neptune Analytics instance is available, you will need the graph-identifier to connect.
|
||||
- The Neptune Analytics instance must be created using the same vector dimensions as the embedding model creates. See: [Vector indexing in Neptune Analytics](https://docs.aws.amazon.com/neptune-analytics/latest/userguide/vector-index.html).
|
||||
@@ -329,8 +321,7 @@ Troubleshooting:
|
||||
|
||||
### Initialize Kuzu
|
||||
|
||||
[Kuzu](https://kuzudb.com) is a fully local in-process graph database system that runs openCypher queries.
|
||||
Kuzu comes embedded into the Python package and there is no additional setup required.
|
||||
[Kuzu](https://kuzudb.com) is a fully local in-process graph database system that runs openCypher queries. Kuzu comes embedded into the Python package and there is no additional setup required.
|
||||
|
||||
Kuzu needs a path to a file where it will store the graph database. For example:
|
||||
|
||||
@@ -347,8 +338,7 @@ config = {
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
Kuzu can also store its database in memory. Note that in this mode, all stored memories will be lost
|
||||
after the program has finished executing.
|
||||
Kuzu can also store its database in memory. Note that in this mode, all stored memories will be lost after the program has finished executing.
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
@@ -374,6 +364,7 @@ m = Memory.from_config(config_dict=config)
|
||||
</CodeGroup>
|
||||
|
||||
## Graph Operations
|
||||
|
||||
Mem0's graph memory supports the following operations:
|
||||
|
||||
### Add Memories
|
||||
@@ -529,7 +520,8 @@ memory.deleteAll({ userId: "alice", agentId: "food-assistant" });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
# Example Usage
|
||||
## Example Usage
|
||||
|
||||
Here's an example of how to use Mem0's graph operations:
|
||||
|
||||
1. First, we'll add some memories for a user named Alice.
|
||||
@@ -679,7 +671,7 @@ memory.search("What is my name?", { userId: "alice123" });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
Below graph visualization shows what nodes and relationships are fetched from the graph for the provided query.
|
||||
The graph visualization below shows what nodes and relationships are fetched from the graph for the provided query.
|
||||
|
||||

|
||||
|
||||
@@ -708,14 +700,13 @@ memory.search("Who is spiderman?", { userId: "alice123" });
|
||||
|
||||
## Using Multiple Agents with Graph Memory
|
||||
|
||||
When working with multiple agents and sessions, you can use the `agent_id` and `run_id` parameters to organize memories by user, agent, and run context. This allows you to:
|
||||
|
||||
When working with multiple agents and sessions, you can use the "agent_id" and "run_id" parameters to organize memories by user, agent, and run context. This allows you to:
|
||||
|
||||
1. Create agent-specific knowledge graphs
|
||||
2. Share common knowledge between agents
|
||||
3. Isolate sensitive or specialized information to specific agents
|
||||
4. Track conversation sessions and runs separately
|
||||
5. Maintain context across different execution contexts
|
||||
1. Create agent-specific knowledge graphs.
|
||||
2. Share common knowledge between agents.
|
||||
3. Isolate sensitive or specialized information to specific agents.
|
||||
4. Track conversation sessions and runs separately.
|
||||
5. Maintain context across different execution contexts.
|
||||
|
||||
### Example: Multi-Agent Setup
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ icon: "image"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Mem0 extends its capabilities beyond text by supporting multimodal data, including images. Users can seamlessly integrate images into their interactions, allowing Mem0 to extract pertinent information from visual content and enrich the memory system.
|
||||
Mem0 extends its capabilities beyond text by supporting multimodal data, including images. You can seamlessly integrate images into your interactions, allowing Mem0 to extract pertinent information from visual content and enrich the memory system.
|
||||
|
||||
## How It Works
|
||||
|
||||
When a user provides an image, Mem0 processes the image to extract textual information and relevant details, which are then added to the user's memory. This feature enhances the system's ability to understand and remember details based on visual inputs.
|
||||
When you provide an image, Mem0 processes it to extract textual information and relevant details, which are then added to your memory. This feature enhances the system's ability to understand and remember details based on visual inputs.
|
||||
|
||||
<Note>
|
||||
To enable multimodal support, you must set `enable_vision = True` in your configuration. The `vision_details` parameter can be set to "auto" (default), "low", or "high" to control the level of detail in image processing.
|
||||
@@ -104,7 +104,7 @@ await client.add(messages, { userId: "alice" })
|
||||
|
||||
Mem0 allows you to add images to user interactions through two primary methods: by providing an image URL or by using a Base64-encoded image. Below are examples demonstrating each approach.
|
||||
|
||||
## 1. Using an Image URL (Recommended)
|
||||
### Using an Image URL (Recommended)
|
||||
|
||||
You can include an image by passing its direct URL. This method is simple and efficient for online images.
|
||||
|
||||
@@ -146,7 +146,7 @@ await client.add([imageMessage], { userId: "alice" })
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
## 2. Using Base64 Image Encoding for Local Files
|
||||
### Using Base64 Image Encoding for Local Files
|
||||
|
||||
For local images or scenarios where embedding the image directly is preferable, you can use a Base64-encoded string.
|
||||
|
||||
@@ -196,7 +196,7 @@ await client.add([imageMessage], { userId: "alice" })
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
## 3. OpenAI-Compatible Message Format
|
||||
### OpenAI-Compatible Message Format
|
||||
|
||||
You can also use the OpenAI-compatible format to combine text and images in a single message:
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ const memory = new Memory({
|
||||
```typescript Code
|
||||
const messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -303,9 +303,9 @@ await memory.reset(); // Reset all memories
|
||||
|
||||
### History Store
|
||||
|
||||
Mem0 TypeScript SDK support history stores to run on a serverless environment:
|
||||
The Mem0 TypeScript SDK supports history stores to run in serverless environments.
|
||||
|
||||
We recommend using `Supabase` as a history store for serverless environments or disable history store to run on a serverless environment.
|
||||
We recommend using Supabase as a history store for serverless environments, or disabling the history store to run in serverless environments.
|
||||
|
||||
<CodeGroup>
|
||||
```typescript Supabase
|
||||
@@ -353,7 +353,7 @@ create table memory_history (
|
||||
|
||||
## Configuration Parameters
|
||||
|
||||
Mem0 offers extensive configuration options to customize its behavior according to your needs. These configurations span across different components like vector stores, language models, embedders, and graph stores.
|
||||
Mem0 offers extensive configuration options to customize its behavior according to your needs. These configurations span different components like vector stores, language models, embedders, and graph stores.
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Vector Store Configuration">
|
||||
|
||||
@@ -4,9 +4,9 @@ icon: "eye"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Welcome to Mem0 Open Source - a powerful, self-hosted memory management solution for AI agents and assistants. With Mem0 OSS, you get full control over your infrastructure while maintaining complete customization flexibility.
|
||||
Welcome to Mem0 Open Source, a powerful, self-hosted memory management solution for AI agents and assistants. With Mem0 OSS, you get full control over your infrastructure while maintaining complete customization flexibility.
|
||||
|
||||
We offer two SDKs for Python and Node.js.
|
||||
We offer two SDKs: Python and Node.js.
|
||||
|
||||
Check out our [GitHub repository](https://mem0.dev/gd) to explore the source code.
|
||||
|
||||
@@ -21,8 +21,8 @@ Check out our [GitHub repository](https://mem0.dev/gd) to explore the source cod
|
||||
|
||||
## Key Features
|
||||
|
||||
- **Full Infrastructure Control**: Host Mem0 on your own servers
|
||||
- **Customizable Implementation**: Modify and extend functionality as needed
|
||||
- **Local Development**: Perfect for development and testing
|
||||
- **No Vendor Lock-in**: Own your data and infrastructure
|
||||
- **Community Driven**: Benefit from and contribute to community improvements
|
||||
- **Full Infrastructure Control**: Host Mem0 on your own servers.
|
||||
- **Customizable Implementation**: Modify and extend functionality as needed.
|
||||
- **Local Development**: Perfect for development and testing.
|
||||
- **No Vendor Lock-in**: Own your data and infrastructure.
|
||||
- **Community Driven**: Benefit from and contribute to community improvements.
|
||||
|
||||
@@ -107,7 +107,7 @@ m = Memory.from_config(config_dict=config)
|
||||
```python Code
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
@@ -342,9 +342,9 @@ m.reset() # Reset all memories
|
||||
|
||||
Mem0 supports three key parameters for organizing memories:
|
||||
|
||||
- **`user_id`**: Organize memories by user identity
|
||||
- **`agent_id`**: Organize memories by AI agent or assistant
|
||||
- **`run_id`**: Organize memories by session, workflow, or execution context
|
||||
- **`user_id`**: Organize memories by user identity.
|
||||
- **`agent_id`**: Organize memories by AI agent or assistant.
|
||||
- **`run_id`**: Organize memories by session, workflow, or execution context.
|
||||
|
||||
### Using All Three Parameters
|
||||
|
||||
@@ -369,7 +369,7 @@ session_search = m.search("What do you know about me?", user_id="alice", run_id=
|
||||
|
||||
## Configuration Parameters
|
||||
|
||||
Mem0 offers extensive configuration options to customize its behavior according to your needs. These configurations span across different components like vector stores, language models, embedders, and graph stores.
|
||||
Mem0 offers extensive configuration options to customize its behavior according to your needs. These configurations span different components like vector stores, language models, embedders, and graph stores.
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Vector Store Configuration">
|
||||
@@ -425,7 +425,7 @@ Mem0 offers extensive configuration options to customize its behavior according
|
||||
| `history_db_path` | Path to the history database | "{mem0_dir}/history.db" |
|
||||
| `version` | API version | "v1.1" |
|
||||
| `custom_fact_extraction_prompt` | Custom prompt for memory processing | None |
|
||||
| `custom_update_memory_prompt` | Custom prompt for update memory | None |
|
||||
| `custom_update_memory_prompt` | Custom prompt for memory updates | None |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Complete Configuration Example">
|
||||
@@ -510,7 +510,7 @@ chat_completion = client.chat.completions.create(
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome contributions to Mem0! Here's how you can contribute:
|
||||
We welcome contributions to Mem0. Here's how you can contribute:
|
||||
|
||||
1. Fork the repository and create your branch from `main`.
|
||||
2. Clone the forked repository to your local machine.
|
||||
@@ -538,7 +538,7 @@ We welcome contributions to Mem0! Here's how you can contribute:
|
||||
7. If all tests pass, commit your changes and push to your fork.
|
||||
8. Open a pull request with a clear title and description.
|
||||
|
||||
Please make sure your code follows our coding conventions and is well-documented. We appreciate your contributions to make Mem0 better!
|
||||
Please ensure your code follows our coding conventions and is well-documented.
|
||||
|
||||
|
||||
If you have any questions, please feel free to reach out to us using one of the following methods:
|
||||
|
||||
Reference in New Issue
Block a user