Update Docs (#3520)

This commit is contained in:
Deshraj Yadav
2025-09-30 08:41:36 -07:00
committed by GitHub
parent 135883935f
commit d68ed11d58
134 changed files with 2193 additions and 2090 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
title: AI Companion in Node.js
---
You can create a personalised AI Companion using Mem0. This guide will walk you through the necessary steps and provide the complete code to get you started.
You can create a personalized AI Companion using Mem0. This guide will walk you through the necessary steps and provide the complete code to get you started.
## Overview
+9 -9
View File
@@ -36,7 +36,7 @@ This sets up Mem0 with:
- [AWS Bedrock for LLM](https://docs.mem0.ai/components/llms/models/aws_bedrock)
- [AWS Bedrock for embeddings](https://docs.mem0.ai/components/embedders/models/aws_bedrock#aws-bedrock)
- [OpenSearch as the vector store](https://docs.mem0.ai/components/vectordbs/dbs/opensearch)
- [Neptune Analytics as your graph store](https://docs.mem0.ai/open-source/graph_memory/overview#initialize-neptune-analytics).
- [Neptune Analytics as your graph store](https://docs.mem0.ai/open-source/graph_memory/overview#initialize-neptune-analytics)
```python
import boto3
@@ -93,12 +93,12 @@ m = Memory.from_config(config)
Reference [Notebook example](https://github.com/mem0ai/mem0/blob/main/examples/graph-db-demo/neptune-example.ipynb)
#### Add a memory:
### Add a memory
```python
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."}
]
@@ -107,24 +107,24 @@ messages = [
result = m.add(messages, user_id="alice", metadata={"category": "movie_recommendations"})
```
#### Search a memory:
### Search a memory
```python
relevant_memories = m.search(query, user_id="alice")
```
#### Get all memories:
### Get all memories
```python
all_memories = m.get_all(user_id="alice")
```
#### Get a specific memory:
### Get a specific memory
```python
memory = m.get(memory_id)
```
---
## Conclusion
With Mem0 and AWS services like Bedrock, OpenSearch, and Neptune Analytics, you can build intelligent AI companions that remember, adapt, and personalize their responses over time. This makes them ideal for long-term assistants, tutors, or support bots with persistent memory and natural conversation abilities.
+3 -3
View File
@@ -1,9 +1,9 @@
# Mem0 Chrome Extension
Enhance your AI interactions with **Mem0**, a Chrome extension that introduces a universal memory layer across platforms like `ChatGPT`, `Claude`, and `Perplexity`. Mem0 ensures seamless context sharing, making your AI experiences more personalized and efficient.
Enhance your AI interactions with Mem0, a Chrome extension that introduces a universal memory layer across platforms like ChatGPT, Claude, and Perplexity. Mem0 ensures seamless context sharing, making your AI experiences more personalized and efficient.
<Note>
🎉 We now support Grok! The Mem0 Chrome Extension has been updated to work with Grok, bringing the same powerful memory capabilities to your Grok conversations.
We now support Grok! The Mem0 Chrome Extension has been updated to work with Grok, bringing the same powerful memory capabilities to your Grok conversations.
</Note>
@@ -44,7 +44,7 @@ You can install the Mem0 Chrome Extension using one of the following methods:
## Configuration
- **API Key**: Obtain your API key from the Mem0 Dashboard to connect the extension to the Mem0 API.
- **User ID**: This is your unique identifier in the Mem0 system. If not provided, it defaults to 'chrome-extension-user'.
- **User ID**: This is your unique identifier in the Mem0 system. If not provided, it defaults to `chrome-extension-user`.
## Demo Video
+9 -10
View File
@@ -2,13 +2,14 @@
title: Eliza OS Character
---
You can create a personalised Eliza OS Character using Mem0. This guide will walk you through the necessary steps and provide the complete code to get you started.
You can create a personalized Eliza OS Character using Mem0. This guide will walk you through the necessary steps and provide the complete code to get you started.
## Overview
ElizaOS is a powerful AI agent framework for autonomy & personality. It is a collection of tools that help you create a personalised AI agent.
ElizaOS is a powerful AI agent framework for autonomy and personality. It is a collection of tools that help you create a personalized AI agent.
## Setup
You can start by cloning the eliza-os repository:
```bash
@@ -35,14 +36,14 @@ pnpm build
## Setup ENVs
Create a `.env` file in the root of the project and add the following ( You can use the `.env.example` file as a reference):
Create a `.env` file in the root of the project and add the following (you can use the `.env.example` file as a reference):
```bash
# Mem0 Configuration
MEM0_API_KEY= # Mem0 API Key ( Get from https://app.mem0.ai/dashboard/api-keys )
MEM0_API_KEY= # Mem0 API Key (get from https://app.mem0.ai/dashboard/api-keys)
MEM0_USER_ID= # Default: eliza-os-user
MEM0_PROVIDER= # Default: openai
MEM0_PROVIDER_API_KEY= # API Key for the provider (openai, anthropic, etc.)
MEM0_PROVIDER_API_KEY= # API Key for the provider (OpenAI, Anthropic, etc.)
SMALL_MEM0_MODEL= # Default: gpt-4o-mini
MEDIUM_MEM0_MODEL= # Default: gpt-4o
LARGE_MEM0_MODEL= # Default: gpt-4o
@@ -50,7 +51,7 @@ LARGE_MEM0_MODEL= # Default: gpt-4o
## Make the default character use Mem0
By default, there is a character called `eliza` that uses the `ollama` model. You can make this character use Mem0 by changing the config in the `agent/src/defaultCharacter.ts` file.
By default, there is a character called `eliza` that uses the Ollama model. You can make this character use Mem0 by changing the config in the `agent/src/defaultCharacter.ts` file.
```ts
modelProvider: ModelProviderName.MEM0,
@@ -66,8 +67,6 @@ pnpm start
## Conclusion
You have now created a personalised Eliza OS Character using Mem0. You can now start interacting with the character by running the project and talking to the character.
This is a simple example of how to use Mem0 to create a personalised AI agent. You can use this as a starting point to create your own AI agent.
You have now created a personalized Eliza OS Character using Mem0. You can now start interacting with the character by running the project and talking to the character.
This is a simple example of how to use Mem0 to create a personalized AI agent. You can use this as a starting point to create your own AI agent.
+1 -1
View File
@@ -180,5 +180,5 @@ print(f"Found {len(meeting_emails['results'])} relevant emails")
## Conclusion
By combining Mem0's memory capabilities with email processing, you can create intelligent email management systems that help users organize, prioritize, and act on their inbox effectively. The advanced capabilities like automatic categorization, action item extraction, and priority management can significantly reduce the time spent on email management, allowing users to focus on more important tasks.
By combining Mem0's memory capabilities with email processing, you can create intelligent email management systems that help users organize, prioritize, and act on their inbox effectively. Advanced capabilities like automatic categorization, action item extraction, and priority management can significantly reduce the time spent on email management, allowing users to focus on more important tasks.
+29 -16
View File
@@ -4,10 +4,12 @@ title: LlamaIndex ReAct Agent
Create a ReAct Agent with LlamaIndex which uses Mem0 as the memory store.
### Overview
## Overview
A ReAct agent combines reasoning and action capabilities, making it versatile for tasks requiring both thought processes (reasoning) and interaction with tools or APIs (acting). Mem0 as memory enhances these capabilities by allowing the agent to store and retrieve contextual information from past interactions.
### Setup
## Setup
```bash
pip install llama-index-core llama-index-memory-mem0
```
@@ -67,6 +69,7 @@ order_food_tool = FunctionTool.from_defaults(fn=order_food)
```
Initialize the agent with tools and memory.
```python
from llama_index.core.agent import FunctionCallingAgent
@@ -79,14 +82,16 @@ agent = FunctionCallingAgent.from_tools(
```
Start the chat.
<Note> The agent will use the Mem0 to store the relevant memories from the chat. </Note>
Input
<Note>The agent will use Mem0 to store the relevant memories from the chat.</Note>
**Input**
```python
response = agent.chat("Hi, My name is David")
print(response)
```
Output
**Output**
```text
> Running step bf44a75a-a920-4cf3-944e-b6e6b5695043. Step input: Hi, My name is David
Added user message to memory: Hi, My name is David
@@ -94,24 +99,27 @@ Added user message to memory: Hi, My name is David
Hello, David! How can I assist you today?
```
Input
**Input**
```python
response = agent.chat("I love to eat pizza on weekends")
print(response)
```
Output
**Output**
```text
> Running step 845783b0-b85b-487c-baee-8460ebe8b38d. Step input: I love to eat pizza on weekends
Added user message to memory: I love to eat pizza on weekends
=== LLM Response ===
Pizza is a great choice for the weekend! If you'd like, I can help you order some. Just let me know what kind of pizza you prefer!
```
Input
**Input**
```python
response = agent.chat("My preferred way of communication is email")
print(response)
```
Output
**Output**
```text
> Running step 345842f0-f8a0-42ea-a1b7-612265d72a92. Step input: My preferred way of communication is email
Added user message to memory: My preferred way of communication is email
@@ -119,8 +127,9 @@ Added user message to memory: My preferred way of communication is email
Got it! If you need any assistance or have any requests, feel free to let me know, and I can communicate with you via email.
```
### Using the agent WITHOUT memory
Input
## Using the Agent Without Memory
**Input**
```python
agent = FunctionCallingAgent.from_tools(
[call_tool, email_tool, order_food_tool],
@@ -131,17 +140,20 @@ agent = FunctionCallingAgent.from_tools(
response = agent.chat("I am feeling hungry, order me something and send me the bill")
print(response)
```
Output
**Output**
```text
> Running step e89eb75d-75e1-4dea-a8c8-5c3d4b77882d. Step input: I am feeling hungry, order me something and send me the bill
Added user message to memory: I am feeling hungry, order me something and send me the bill
=== LLM Response ===
Please let me know your name and the dish you'd like to order, and I'll take care of it for you!
```
<Note> The agent is not able to remember the past preferences that user shared in previous chats. </Note>
### Using the agent WITH memory
Input
<Note>The agent is not able to remember the past preferences the user shared in previous chats.</Note>
## Using the Agent With Memory
**Input**
```python
agent = FunctionCallingAgent.from_tools(
[call_tool, email_tool, order_food_tool],
@@ -170,4 +182,5 @@ Emailing... David
=== LLM Response ===
I've ordered a pizza for you, and the bill has been sent to your email. Enjoy your meal! If there's anything else you need, feel free to let me know.
```
<Note> The agent is able to remember the past preferences that user shared and use them to perform actions. </Note>
<Note>The agent is able to remember the past preferences the user shared and use them to perform actions.</Note>
@@ -11,7 +11,7 @@ Build an intelligent multi-agent learning system that uses Mem0 to maintain pers
This example showcases a **Multi-Agent Personal Learning System** that combines:
- **LlamaIndex AgentWorkflow** for multi-agent orchestration
- **Mem0** for persistent, shared memory across agents
- **Multi-agents** that collaborate on teaching tasks
- **Multiple agents** that collaborate on teaching tasks
The system consists of two agents:
- **TutorAgent**: Primary instructor for explanations and concept teaching
@@ -350,7 +350,7 @@ Based on our previous session, I remember we covered Vision Language Models and
1. **Clear Agent Roles**: Define specific responsibilities for each agent
2. **Memory Context**: Use descriptive context for memory isolation
3. **Handoff Strategy**: Design clear handoff criteria between agents
5. **Memory Hygiene**: Regularly review and clean memory for optimal performance
4. **Memory Hygiene**: Regularly review and clean memory for optimal performance
## Help & Resources
+1 -2
View File
@@ -3,8 +3,7 @@ title: Mem0 as an Agentic Tool
---
Integrate Mem0's memory capabilities with OpenAI's Agents SDK to create AI agents with persistent memory.
You can create agents that remember past conversations and use that context to provide better responses.
Integrate Mem0's memory capabilities with OpenAI's Agents SDK to create AI agents with persistent memory. You can create agents that remember past conversations and use that context to provide better responses.
## Installation
+3 -3
View File
@@ -53,9 +53,9 @@ Before you begin, follow these steps to set up the demo application:
## Enhancing the Next.js Application
Once the demo is running, you can customize and enhance the Next.js application by modifying the components in the `mem0-demo` folder. Consider:
- Adding new memory features to improve contextual retention.
- Customizing the UI to better suit your application needs.
- Integrating additional APIs or third-party services to extend functionality.
- Adding new memory features to improve contextual retention
- Customizing the UI to better suit your application needs
- Integrating additional APIs or third-party services to extend functionality
## Full Code
@@ -4,7 +4,7 @@ description: 'Build a personalized healthcare agent that remembers patient infor
---
# Healthcare Assistant with Memory
## Healthcare Assistant with Memory
This example demonstrates how to build a healthcare assistant that remembers patient information across conversations using Google ADK and Mem0.
@@ -257,7 +257,7 @@ This healthcare assistant demonstrates several key capabilities:
## Key Implementation Details
### User ID Management
## User ID Management
Instead of passing the user ID as a parameter to the memory tools (which would require modifying the ADK's tool calling system), we attach it directly to the function object:
@@ -276,7 +276,7 @@ user_id = getattr(save_patient_info, 'user_id', 'default_user')
This approach allows our tools to maintain user context without complicating their parameter signatures.
### Mem0 Integration
## Mem0 Integration
The integration with Mem0 happens through two primary functions:
+10 -11
View File
@@ -2,8 +2,7 @@
title: Mem0 with Mastra
---
In this example you'll learn how to use the Mem0 to add long-term memory capabilities to [Mastra's agent](https://mastra.ai/) via tool-use.
This memory integration can work alongside Mastra's [agent memory features](https://mastra.ai/docs/agents/01-agent-memory).
In this example you'll learn how to use Mem0 to add long-term memory capabilities to [Mastra's agent](https://mastra.ai/) via tool-use. This memory integration can work alongside Mastra's [agent memory features](https://mastra.ai/docs/agents/01-agent-memory).
You can find the complete example code in the [Mastra repository](https://github.com/mastra-ai/mastra/tree/main/examples/memory-with-mem0).
@@ -11,9 +10,9 @@ You can find the complete example code in the [Mastra repository](https://github
This guide will show you how to integrate Mem0 with Mastra to add long-term memory capabilities to your agents. We'll create tools that allow agents to save and retrieve memories using Mem0's API.
### Installation
## Installation
1. **Install the Integration Package**
**Install the Integration Package**
To install the Mem0 integration, run:
@@ -21,7 +20,7 @@ To install the Mem0 integration, run:
npm install @mastra/mem0
```
2. **Add the Integration to Your Project**
**Add the Integration to Your Project**
Create a new file for your integrations and import the integration:
@@ -36,7 +35,7 @@ export const mem0 = new Mem0Integration({
});
```
3. **Use the Integration in Tools or Workflows**
**Use the Integration in Tools or Workflows**
You can now use the integration when defining tools for your agents or in workflows.
@@ -86,7 +85,7 @@ export const mem0MemorizeTool = createTool({
});
```
4. **Create a new agent**
**Create a New Agent**
```typescript agents/index.ts
import { openai } from '@ai-sdk/openai';
@@ -103,7 +102,7 @@ export const mem0Agent = new Agent({
});
```
5. **Run the agent**
**Run the Agent**
```typescript index.ts
import { Mastra } from '@mastra/core/mastra';
@@ -121,6 +120,6 @@ export const mastra = new Mastra({
```
In the example above:
- We import the `@mastra/mem0` integration.
- We define two tools that uses the Mem0 API client to create new memories and recall previously saved memories.
- The tool accepts `question` as an input and returns the memory as a string.
- We import the `@mastra/mem0` integration
- We define two tools that use the Mem0 API client to create new memories and recall previously saved memories
- The tool accepts `question` as an input and returns the memory as a string
+1 -1
View File
@@ -3,7 +3,7 @@ title: 'Mem0 with OpenAI Agents SDK for Voice'
description: 'Integrate memory capabilities into your voice agents using Mem0 and OpenAI Agents SDK'
---
# Building Voice Agents with Memory using Mem0 and OpenAI Agents SDK
## Building Voice Agents with Memory using Mem0 and OpenAI Agents SDK
This guide demonstrates how to combine OpenAI's Agents SDK for voice applications with Mem0's memory capabilities to create a voice assistant that remembers user preferences and past interactions.
+9 -9
View File
@@ -6,15 +6,15 @@ title: Mem0 with Ollama
Mem0 can be utilized entirely locally by leveraging Ollama for both the embedding model and the language model (LLM). This guide will walk you through the necessary steps and provide the complete code to get you started.
### Overview
## Overview
By using Ollama, you can run Mem0 locally, which allows for greater control over your data and models. This setup uses Ollama for both the embedding model and the language model, providing a fully local solution.
### Setup
## Setup
Before you begin, ensure you have Mem0 and Ollama installed and properly configured on your local machine.
### Full Code Example
## Full Code Example
Below is the complete code to set up and use Mem0 locally with Ollama:
@@ -60,13 +60,13 @@ m.add("I'm visiting Paris", user_id="john")
memories = m.get_all(user_id="john")
```
### Key Points
## Key Points
- **Configuration**: The setup involves configuring the vector store, language model, and embedding model to use local resources.
- **Vector Store**: Qdrant is used as the vector store, running on localhost.
- **Language Model**: Ollama is used as the LLM provider, with the "llama3.1:latest" model.
- **Embedding Model**: Ollama is also used for embeddings, with the "nomic-embed-text:latest" model.
- **Configuration**: The setup involves configuring the vector store, language model, and embedding model to use local resources
- **Vector Store**: Qdrant is used as the vector store, running on localhost
- **Language Model**: Ollama is used as the LLM provider, with the `llama3.1:latest` model
- **Embedding Model**: Ollama is also used for embeddings, with the `nomic-embed-text:latest` model
### Conclusion
## Conclusion
This local setup of Mem0 using Ollama provides a fully self-contained solution for memory management and AI interactions. It allows for greater control over your data and models while still leveraging the powerful capabilities of Mem0.
+16 -15
View File
@@ -31,7 +31,7 @@ USER_ID = "content_writer"
RUN_ID = "smart_editing_session"
```
## **Storing Your Writing Preferences in Mem0**
## Storing Your Writing Preferences in Mem0
```python
def store_writing_preferences():
@@ -60,7 +60,7 @@ def store_writing_preferences():
return response
```
## **Editing Content Using Stored Preferences**
## Editing Content Using Stored Preferences
```python
def apply_writing_style(original_content):
@@ -111,7 +111,7 @@ Preferences:
return clean_response
```
## **Complete Workflow: Content Editing**
## Complete Workflow: Content Editing
```python
def content_writing_workflow(content):
@@ -136,7 +136,7 @@ def content_writing_workflow(content):
return edited_content
```
## **Example Usage**
## Example Usage
```python
# Define your document
@@ -156,11 +156,11 @@ We plan to launch the campaign in July and continue through September.
result = content_writing_workflow(original_content)
```
## **Expected Output**
## Expected Output
Your document will be transformed into a structured, well-formatted version based on your preferences.
### **Original Document**
### Original Document
```
Project Proposal
@@ -174,37 +174,38 @@ Expand our social media following
We plan to launch the campaign in July and continue through September.
```
### **Edited Document**
```
# **Project Proposal**
### Edited Document
## **Q3 Marketing Campaign Strategy**
```
# Project Proposal
## Q3 Marketing Campaign Strategy
This proposal outlines our strategy for the Q3 marketing campaign. We aim to significantly increase our market share with this approach.
### **Objectives**
### Objectives
- **Increase Brand Awareness**: Implement targeted advertising and community engagement to enhance visibility.
- **Boost Sales by 15%**: Increase sales by 15% compared to Q2 figures.
- **Expand Social Media Following**: Grow our social media audience by 20%.
### **Timeline**
### Timeline
- **Launch Date**: July
- **Duration**: July – September
### **Key Actions**
### Key Actions
- **Targeted Advertising**: Utilize platforms like Google Ads and Facebook to reach specific demographics.
- **Community Engagement**: Host webinars and live Q&A sessions.
- **Content Creation**: Produce engaging videos and infographics.
### **Supporting Data**
### Supporting Data
- **Previous Campaign Success**: Our Q2 campaign increased sales by 12%. We will refine similar strategies for Q3.
- **Social Media Growth**: Last year, our Instagram followers grew by 25% during a similar campaign.
### **Conclusion**
### Conclusion
We believe this strategy will effectively increase our market share. To achieve these goals, we need your support and collaboration. Let’s work together to make this campaign a success. Please review the proposal and provide your feedback by the end of the week.
```
+10 -10
View File
@@ -2,24 +2,24 @@
title: Multimodal Demo with Mem0
---
Enhance your AI interactions with **Mem0**'s multimodal capabilities. Mem0 now supports image understanding, allowing for richer context and more natural interactions across supported AI platforms.
Enhance your AI interactions with Mem0's multimodal capabilities. Mem0 now supports image understanding, allowing for richer context and more natural interactions across supported AI platforms.
> Experience the power of multimodal AI! Test out Mem0's image understanding capabilities at [multimodal-demo.mem0.ai](https://multimodal-demo.mem0.ai)
## Features
- **Image Understanding**: Share and discuss images with AI assistants while maintaining context.
- **Smart Visual Context**: Automatically capture and reference visual elements in conversations.
- **Cross-Modal Memory**: Link visual and textual information seamlessly in your memory layer.
- **Cross-Session Recall**: Reference previously discussed visual content across different conversations.
- **Seamless Integration**: Works naturally with existing chat interfaces for a smooth experience.
- **Image Understanding**: Share and discuss images with AI assistants while maintaining context
- **Smart Visual Context**: Automatically capture and reference visual elements in conversations
- **Cross-Modal Memory**: Link visual and textual information seamlessly in your memory layer
- **Cross-Session Recall**: Reference previously discussed visual content across different conversations
- **Seamless Integration**: Works naturally with existing chat interfaces for a smooth experience
## How It Works
1. **Upload Visual Content**: Simply drag and drop or paste images into your conversations.
2. **Natural Interaction**: Discuss the visual content naturally with AI assistants.
3. **Memory Integration**: Visual context is automatically stored and linked with your conversation history.
4. **Persistent Recall**: Retrieve and reference past visual content effortlessly.
1. **Upload Visual Content**: Simply drag and drop or paste images into your conversations
2. **Natural Interaction**: Discuss the visual content naturally with AI assistants
3. **Memory Integration**: Visual context is automatically stored and linked with your conversation history
4. **Persistent Recall**: Retrieve and reference past visual content effortlessly
## Demo Video
+6 -6
View File
@@ -35,7 +35,7 @@ const openAIClient = new OpenAI();
const mem0Client = new MemoryClient(mem0Config);
```
### Adding Memories
## Adding Memories
Store user preferences, past interactions, or any relevant information:
<CodeGroup>
@@ -84,7 +84,7 @@ await addUserPreferences();
]
```
</CodeGroup>
### Retrieving Memories
## Retrieving Memories
Search for relevant memories based on the current user input:
@@ -92,7 +92,7 @@ Search for relevant memories based on the current user input:
const relevantMemories = await mem0Client.search(userInput, mem0Config);
```
### Structured Responses with Zod
## Structured Responses with Zod
Define structured response schemas to get consistent output formats:
@@ -125,7 +125,7 @@ const response = await openAIClient.responses.create({
});
```
### Using Web Search
## Using Web Search
Combine memory with web search for up-to-date recommendations:
@@ -139,7 +139,7 @@ const response = await openAIClient.responses.create({
## Examples
### Complete Car Recommendation System
## Complete Car Recommendation System
```javascript
import MemoryClient from "mem0ai";
@@ -230,7 +230,7 @@ const getMemoryString = (memories) => {
run().catch(console.error);
```
### Responses
## Responses
<CodeGroup>
```json Without Memories
+6 -5
View File
@@ -9,6 +9,7 @@ You can create a personalized AI Tutor using Mem0. This guide will walk you thro
The Personalized AI Tutor leverages Mem0 to retain information across interactions, enabling a tailored learning experience. By integrating with OpenAI's GPT-4 model, the tutor can provide detailed and context-aware responses to user queries.
## Setup
Before you begin, ensure you have the required dependencies installed. You can install the necessary packages using pip:
```bash
@@ -100,12 +101,12 @@ for m in memories['results']:
print(m['memory'])
```
### Key Points
## Key Points
- **Initialization**: The PersonalAITutor class is initialized with the necessary memory configuration and OpenAI client setup.
- **Asking Questions**: The ask method sends a question to the AI and stores the relevant information in memory.
- **Retrieving Memories**: The get_memories method fetches all stored memories associated with a user.
- **Initialization**: The PersonalAITutor class is initialized with the necessary memory configuration and OpenAI client setup
- **Asking Questions**: The ask method sends a question to the AI and stores the relevant information in memory
- **Retrieving Memories**: The get_memories method fetches all stored memories associated with a user
### Conclusion
## Conclusion
As the conversation progresses, Mem0's memory automatically updates based on the interactions, providing a continuously improving personalized learning experience. This setup ensures that the AI Tutor can offer contextually relevant and accurate responses, enhancing the overall educational process.
+1 -2
View File
@@ -4,7 +4,7 @@ title: Personalized Deep Research
Deep Research is an intelligent agent that synthesizes large amounts of online data and completes complex research tasks, customized to your unique preferences and insights. Built on Mem0's technology, it enhances AI-driven online exploration with personalized memories.
You can checkout GitHub repositry here: [Personalized Deep Research](https://github.com/mem0ai/personalized-deep-research/tree/mem0)
You can check out the GitHub repository here: [Personalized Deep Research](https://github.com/mem0ai/personalized-deep-research/tree/mem0)
## Overview
@@ -59,7 +59,6 @@ Watch Deep Research in action:
- **Technical Research**: Technology evaluation, solution comparison
- **Business Research**: Strategic planning, opportunity analysis
## Try It Out
> To try it yourself, clone the repository and follow the instructions in the README to run it locally or deploy it.
@@ -4,19 +4,19 @@ title: 'Personalized Search with Mem0 and Tavily'
<Snippet file="security-compliance.mdx" />
Imagine asking a search assistant for "coffee shops nearby" and instead of generic results, it shows remote-work-friendly cafes with great wifi in your city because it remembers you mentioned working remotely before. Or when you search for "lunchbox ideas for kids" it knows you have a **7-year-old daughter** and recommends **peanut-free options** that align with her allergy.
Imagine asking a search assistant for "coffee shops nearby" and instead of generic results, it shows remote-work-friendly cafes with great WiFi in your city because it remembers you mentioned working remotely before. Or when you search for "lunchbox ideas for kids" it knows you have a 7-year-old daughter and recommends peanut-free options that align with her allergy.
That's what we are going to build today, a **Personalized Search Assistant** powered by **Mem0** for memory and [Tavily](https://tavily.com) for real-time search.
That's what we are going to build today, a Personalized Search Assistant powered by Mem0 for memory and [Tavily](https://tavily.com) for real-time search.
## Why Personalized Search
Most assistants treat every query like they’ve never seen you before. That means repeating yourself about your location, diet, or preferences, and getting results that feel generic.
Most assistants treat every query like they've never seen you before. That means repeating yourself about your location, diet, or preferences, and getting results that feel generic.
- With **Mem0**, your assistant builds a memory of the user’s world.
- With **Tavily**, it fetches fresh and accurate results in real time.
- With Mem0, your assistant builds a memory of the user's world.
- With Tavily, it fetches fresh and accurate results in real time.
Together, they make every interaction **smarter, faster, and more personal**.
Together, they make every interaction smarter, faster, and more personal.
## Prerequisites
@@ -55,7 +55,7 @@ and extract facts and memories accordingly.
'''
)
```
Now, if a user casually mentions "I need to pick up my daughter", or "What's the weather at Los Angeles", Mem0 remembers they have a daughter or user is somewhat interested/connected with Los Angeles in terms of location, those will be referred for future searches.
Now, if a user casually mentions "I need to pick up my daughter" or "What's the weather at Los Angeles", Mem0 remembers they have a daughter or the user is interested in or connected with Los Angeles in terms of location. These details will be referenced for future searches.
### 2. Simulating User History
To test personalization, we preload some sample conversation history for a user:
@@ -173,17 +173,19 @@ if __name__ == "__main__":
```
## How It Works in Practice
Here’s how personalization plays out:
- Context Gathering: User previously mentioned living in Los Angeles, being vegan, and having a 7-year-old daughter allergic to peanuts.
- Enhanced Search Query:
Query -> "good coffee shops nearby for working"
Enhanced Query -> "good coffee shops in Los Angeles with strong wifi, remote-work-friendly"
- Personalized Results: The assistant only returns wifi-friendly, work-friendly cafes near Los Angeles.
- Memory Update: Interaction is saved for better future recommendations.
Here's how personalization plays out:
- **Context Gathering**: User previously mentioned living in Los Angeles, being vegan, and having a 7-year-old daughter allergic to peanuts.
- **Enhanced Search Query**:
- Query: "good coffee shops nearby for working"
- Enhanced Query: "good coffee shops in Los Angeles with strong WiFi, remote-work-friendly"
- **Personalized Results**: The assistant only returns WiFi-friendly, work-friendly cafes near Los Angeles.
- **Memory Update**: Interaction is saved for better future recommendations.
## Conclusion
With Mem0 + Tavily, you can build a search assistant that doesn’t just fetch results but it understands the person behind the query.
With Mem0 and Tavily, you can build a search assistant that doesn't just fetch results but understands the person behind the query.
Whether for shopping, travel, or daily life, this approach turns a generic search into a truly personalized experience.
+7 -8
View File
@@ -2,7 +2,7 @@
title: YouTube Assistant Extension
---
Enhance your YouTube experience with Mem0's **YouTube Assistant**, a Chrome extension that brings AI-powered chat directly to your YouTube videos. Get instant, personalized answers about video content while leveraging your own knowledge and memories - all without leaving the page.
Enhance your YouTube experience with Mem0's YouTube Assistant, a Chrome extension that brings AI-powered chat directly to your YouTube videos. Get instant, personalized answers about video content while leveraging your own knowledge and memories, all without leaving the page.
## Features
@@ -29,12 +29,12 @@ This extension is not available on the Chrome Web Store yet. You can install it
### Manual Installation (Developer Mode)
1. **Download the Extension**: Clone or download the extension files from the [Mem0 GitHub repository](https://github.com/mem0ai/mem0/tree/main/examples).
2. **Build**: Run `npm install` followed by `npm run build` to install the dependencies and build the extension.
3. **Access Chrome Extensions**: Open Google Chrome and navigate to `chrome://extensions`.
4. **Enable Developer Mode**: Toggle the "Developer mode" switch in the top right corner.
5. **Load Unpacked Extension**: Click "Load unpacked" and select the directory containing the extension files.
6. **Confirm Installation**: The Mem0 YouTube Assistant Extension should now appear in your Chrome toolbar.
1. **Download the Extension**: Clone or download the extension files from the [Mem0 GitHub repository](https://github.com/mem0ai/mem0/tree/main/examples)
2. **Build**: Run `npm install` followed by `npm run build` to install the dependencies and build the extension
3. **Access Chrome Extensions**: Open Google Chrome and navigate to `chrome://extensions`
4. **Enable Developer Mode**: Toggle the "Developer mode" switch in the top right corner
5. **Load Unpacked Extension**: Click "Load unpacked" and select the directory containing the extension files
6. **Confirm Installation**: The Mem0 YouTube Assistant Extension should now appear in your Chrome toolbar
## Setup
@@ -50,7 +50,6 @@ This extension is not available on the Chrome Web Store yet. You can install it
- "How does this relate to what I already know?"
- "What are some practical applications of this topic related to my work?"
## Privacy and Data Security
Your API keys are stored locally in your browser. Your messages are sent to the Mem0 API for extracting and retrieving memories. Mem0 is committed to ensuring your data's privacy and security.