### Start the stack with browser-first setup Source: https://docs.mem0.ai/open-source/setup Initializes containers and database migrations for the browser-based setup wizard. ```bash cd server make up ``` -------------------------------- ### GET /auth/setup-status Source: https://docs.mem0.ai/open-source/features/rest-api Checks if the system needs setup. No authentication required. ```APIDOC ## GET /auth/setup-status ### Description Returns {needsSetup: bool}. Open, no auth required. ### Method GET ### Endpoint /auth/setup-status ### Response #### Success Response (200) - **needsSetup** (bool) - Indicates if the system requires setup ``` -------------------------------- ### Install Cassandra on macOS Source: https://docs.mem0.ai/components/vectordbs/dbs/cassandra Commands to install and start Cassandra using Homebrew. ```bash # Using Homebrew brew install cassandra # Start Cassandra brew services start cassandra # Connect to CQL shell cqlsh ``` -------------------------------- ### Install and Start Flowise Source: https://docs.mem0.ai/integrations/flowise Commands to install the Flowise package globally and initiate the server. ```bash npm install -g flowise npx flowise start ``` -------------------------------- ### Launch Evaluation UI Source: https://docs.mem0.ai/core-concepts/memory-evaluation Commands to install dependencies and start the local development server for the evaluation dashboard. ```bash npm install npm run dev -- -p 3001 # Open http://localhost:3001 ``` -------------------------------- ### Install Weaviate Client Source: https://docs.mem0.ai/components/vectordbs/dbs/weaviate Install the necessary client library for your environment. ```bash pip install weaviate-client ``` ```bash npm install weaviate-client ``` -------------------------------- ### Run Server Directly Source: https://docs.mem0.ai/open-source/features/rest-api Install dependencies and start the FastAPI server with auto-reload enabled. ```bash pip install -r requirements.txt uvicorn main:app --reload ``` -------------------------------- ### Install Integration SDKs Source: https://docs.mem0.ai/templates/integration_guide_template Package installation commands for the integration. ```bash pip install mem0ai [partner-package] ``` ```bash npm install mem0ai [partner-package] ``` -------------------------------- ### Install Mem0 SDK Source: https://docs.mem0.ai/cookbooks/companions/voice-companion-openai Install the Mem0 SDK to enable memory management. ```bash pip install mem0ai ``` -------------------------------- ### Install dependencies Source: https://docs.mem0.ai/cookbooks/frameworks/gemini-3-with-mem0-mcp Install the necessary Python packages for the integration. ```bash pip install pydantic-ai nest-asyncio python-dotenv google-genai ``` -------------------------------- ### Install dependencies Source: https://docs.mem0.ai/cookbooks/integrations/tavily-search Install the required packages for LangChain, Mem0, and Tavily integration. ```bash pip install langchain mem0ai langchain-tavily langchain-openai ``` -------------------------------- ### Install Additional Dependencies Source: https://docs.mem0.ai/cookbooks/companions/voice-companion-openai Install required supporting libraries for the voice assistant. ```bash pip install numpy sounddevice pydantic ``` -------------------------------- ### Install Vertex AI SDK Source: https://docs.mem0.ai/components/embedders/models/vertexai Install the required SDK for the Vertex AI provider. ```bash pip install vertexai ``` ```bash npm install @google-cloud/aiplatform ``` -------------------------------- ### Install Hermes Agent Source: https://docs.mem0.ai/integrations/hermes Execute the installation script to set up the Hermes Agent environment. ```bash curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash source ~/.bashrc ``` -------------------------------- ### Install Platform Dependencies Source: https://docs.mem0.ai/cookbooks/operations/email-automation Install the necessary packages for using the Mem0 platform with OpenAI. ```bash pip install mem0ai openai ``` -------------------------------- ### Install Frontend Dependencies Source: https://docs.mem0.ai/integrations/chatdev Install necessary Node.js packages for the ChatDev web console. ```bash cd frontend && npm install && cd .. ``` -------------------------------- ### Install Required Libraries Source: https://docs.mem0.ai/integrations/langchain Install the necessary dependencies for LangChain, OpenAI, and Mem0 integration. ```bash pip install langchain langchain_openai mem0ai python-dotenv ``` -------------------------------- ### Run Mem0 Onboarding Source: https://docs.mem0.ai/integrations/claude-code Execute the setup wizard to verify API keys, import project files, and configure memory categories. ```bash /mem0:onboard ``` -------------------------------- ### Get Project Details (PHP) Source: https://docs.mem0.ai/api-reference/project/get-project Example of how to get project details using the Mem0 PHP SDK. Ensure you have installed the package via Composer ('composer require mem0ai/mem0-php'). ```PHP getProject(); print_r($response); } catch (Exception $e) { echo 'Error: ' . $e->getMessage(); } ``` -------------------------------- ### Install dependencies Source: https://docs.mem0.ai/cookbooks/integrations/healthcare-google-adk Install the required packages for Google ADK, Mem0, and environment variable management. ```bash pip install google-adk mem0ai python-dotenv ``` -------------------------------- ### Initialize Fresh Install Source: https://docs.mem0.ai/migration/server-pgvector-upgrade Commands to set up a new Mem0 server instance. ```bash cd server cp .env.example .env # Edit .env: set POSTGRES_PASSWORD (required) and OPENAI_API_KEY at minimum make up ``` -------------------------------- ### Start the Project Source: https://docs.mem0.ai/cookbooks/frameworks/eliza-os-character Launch the Eliza OS agent. ```bash pnpm start ``` -------------------------------- ### Start Docker Compose Stack Source: https://docs.mem0.ai/open-source/features/rest-api Start the stack in detached mode to complete setup via the browser wizard. ```bash cd server docker compose up -d ``` -------------------------------- ### Start the development server Source: https://docs.mem0.ai/cookbooks/companions/quickstart-demo Launch the local development environment for the demo. ```bash pnpm run dev ``` -------------------------------- ### Get Users with Java Source: https://docs.mem0.ai/api-reference/entities/get-users An example using Unirest to make a GET request for retrieving users. This requires the Unirest library to be included in your project. ```Java HttpResponse response = Unirest.get("https://api.mem0.ai/v1/entities/") ``` -------------------------------- ### Start Local Infrastructure Source: https://docs.mem0.ai/cookbooks/operations/content-writing Launch the Qdrant vector database and pull the required Ollama models. ```bash docker run -d -p 6333:6333 qdrant/qdrant ollama pull llama3.1:latest ollama pull nomic-embed-text:latest ``` -------------------------------- ### Interactive OSS Setup Source: https://docs.mem0.ai/integrations/hermes Run the interactive wizard to configure self-hosted Mem0. ```bash hermes memory setup # Select "mem0", then "Open Source (self-hosted)" # Follow the prompts for LLM, embedder, and vector store ``` -------------------------------- ### Interactive Platform Setup Source: https://docs.mem0.ai/integrations/hermes Use the interactive wizard to configure Mem0 Platform mode. ```bash hermes memory setup ``` -------------------------------- ### Get Project Details (Go) Source: https://docs.mem0.ai/api-reference/project/get-project This Go code snippet demonstrates fetching project details using the Mem0 Go SDK. Install the SDK with 'go get github.com/mem0ai/mem0-go'. ```Go // To use the Go SDK, install the package: // go get github.com/mem0ai/mem0-go package main import ( "fmt" "github.com/mem0ai/mem0-go" ) func main() { client := mem0.NewClient("your-api-key") response, err := client.GetProject() if err != nil { fmt.Printf("Error: %v\n", err) return } fmt.Printf("%+v\n", response) } ``` -------------------------------- ### Environment Setup Source: https://docs.mem0.ai/cookbooks/frameworks/gemini-3-with-mem0-mcp Define the required API keys in a .env file. ```bash MEM0_API_KEY=m0-xxxxxxxxxxxxxxxxx GEMINI_API_KEY=your-gemini-api-key-here ``` -------------------------------- ### Get Project Details (Python) Source: https://docs.mem0.ai/api-reference/project/get-project Use this snippet to retrieve project details using the Mem0 Python SDK. Ensure you have installed the SDK using 'pip install mem0ai'. ```Python # To use the Python SDK, install the package: # pip install mem0ai from mem0 import MemoryClient client = MemoryClient(api_key="your_api_key") response = client.get_project() print(response) ``` -------------------------------- ### Get Webhooks Output Source: https://docs.mem0.ai/platform/features/webhooks This is an example of the JSON output when retrieving a list of webhooks for a project. ```json [ { "webhook_id": "wh_123", "url": "https://mem0.ai", "name": "mem0", "owner": "john", "event_types": ["memory_add"], "project": "default-project", "is_active": true, "created_at": "2025-02-18T22:59:56.804993-08:00", "updated_at": "2025-02-18T23:06:41.479361-08:00" } ] ``` -------------------------------- ### Start API and Verify Source: https://docs.mem0.ai/migration/server-pgvector-upgrade Launch the Mem0 API and confirm the service is operational. ```bash docker compose up -d mem0 ``` ```bash # Check service health cd server && make health # Confirm memories are accessible curl -s http://localhost:8888/memories?user_id= \ -H "X-API-Key: " ``` -------------------------------- ### Initialize Dependencies and Environment Source: https://docs.mem0.ai/cookbooks/companions/voice-companion-openai Import required modules, configure API keys, and initialize the Mem0 client. ```python # OpenAI Agents SDK imports from agents import ( Agent, function_tool ) from agents.voice import ( AudioInput, SingleAgentVoiceWorkflow, VoicePipeline ) from agents.extensions.handoff_prompt import prompt_with_handoff_instructions # Mem0 imports from mem0 import AsyncMemoryClient # Set up API keys (replace with your actual keys) os.environ["OPENAI_API_KEY"] = "your-openai-api-key" os.environ["MEM0_API_KEY"] = "your-mem0-api-key" # Define a global user ID for simplicity USER_ID = "voice_user" # Initialize Mem0 client mem0_client = AsyncMemoryClient() ``` -------------------------------- ### Get Memory with cURL Source: https://docs.mem0.ai/api-reference/memory/get-memory Example of how to retrieve a memory using cURL. Replace '{memory_id}' and '' with your specific values. ```cURL curl --request GET \ --url https://api.mem0.ai/v1/memories/{memory_id}/ \ --header 'Authorization: Token ' ``` -------------------------------- ### Get Users with JavaScript SDK Source: https://docs.mem0.ai/api-reference/entities/get-users Retrieve all users using the JavaScript SDK. Install the mem0ai package first. ```JavaScript // To use the JavaScript SDK, install the package: # npm i mem0ai import MemoryClient from 'mem0ai'; const client = new MemoryClient({ apiKey: "your-api-key" }); // Retrieve all users client.users() .then(result => console.log(result)) .catch(error => console.error(error)); ``` -------------------------------- ### OSS Setup with Flags Source: https://docs.mem0.ai/integrations/hermes Configure self-hosted Mem0 using command-line flags. ```bash hermes memory setup mem0 --mode oss \ --oss-llm openai --oss-llm-key sk-... \ --oss-vector qdrant ``` -------------------------------- ### Run Mintlify Development Server Source: https://docs.mem0.ai/contributing/documentation Start the local documentation development server. Navigate to the 'docs/' directory before running this command. ```bash mintlify dev ``` -------------------------------- ### Get Users with Python SDK Source: https://docs.mem0.ai/api-reference/entities/get-users Use the Python SDK to retrieve all users. Ensure you have installed the mem0ai package. ```Python # To use the Python SDK, install the package: # pip install mem0ai from mem0 import MemoryClient client = MemoryClient(api_key="your_api_key") users = client.users() print(users) ``` -------------------------------- ### Initialize Clients Source: https://docs.mem0.ai/integrations/elevenlabs Set up the ElevenLabs client and the Mem0 memory client. ```python # Initialize ElevenLabs client client = ElevenLabs(api_key=API_KEY) # Initialize memory client and tools client_tools = ClientTools() mem0_client = AsyncMemoryClient() ``` -------------------------------- ### Get Users with cURL Source: https://docs.mem0.ai/api-reference/entities/get-users Example of how to fetch users using a cURL request. Replace with your actual API key. ```cURL curl --request GET \ --url https://api.mem0.ai/v1/entities/ \ --header 'Authorization: Token ' ``` -------------------------------- ### Define Custom Instructions Source: https://docs.mem0.ai/open-source/features/custom-instructions Define a string containing extraction rules and few-shot examples to guide the model's output format. ```python custom_instructions = """ Please only extract entities containing customer support information, order details, and user information. Here are some few shot examples: Input: Hi. Output: {"facts" : []} Input: The weather is nice today. Output: {"facts" : []} Input: My order #12345 hasn't arrived yet. Output: {"facts" : ["Order #12345 not received"]} Input: I'm John Doe, and I'd like to return the shoes I bought last week. Output: {"facts" : ["Customer name: John Doe", "Wants to return shoes", "Purchase made last week"]} Input: I ordered a red shirt, size medium, but received a blue one instead. Output: {"facts" : ["Ordered red shirt, size medium", "Received blue shirt instead"]} Return the facts and customer information in a json format as shown above. """ ``` ```ts const customInstructions = ` Please only extract entities containing customer support information, order details, and user information. Here are some few shot examples: Input: Hi. Output: {"facts" : []} Input: The weather is nice today. Output: {"facts" : []} Input: My order #12345 hasn't arrived yet. Output: {"facts" : ["Order #12345 not received"]} Input: I am John Doe, and I would like to return the shoes I bought last week. Output: {"facts" : ["Customer name: John Doe", "Wants to return shoes", "Purchase made last week"]} Input: I ordered a red shirt, size medium, but received a blue one instead. Output: {"facts" : ["Ordered red shirt, size medium", "Received blue shirt instead"]} Return the facts and customer information in a json format as shown above. `; ``` -------------------------------- ### Comprehensive Example with Multiple File Types Source: https://docs.mem0.ai/platform/features/multimodal-support Demonstrates adding an image URL, a text document URL, and a PDF URL to memory. This example shows how to integrate different media types. ```python import base64 from mem0 import MemoryClient client = MemoryClient() def file_to_base64(file_path): with open(file_path, "rb") as file: return base64.b64encode(file.read()).decode('utf-8') # Example 1: Using an image URL image_message = { "role": "user", "content": { "type": "image_url", "image_url": { "url": "https://example.com/sample-image.jpg" } } } # Example 2: Using a text document URL text_message = { "role": "user", "content": { "type": "mdx_url", "mdx_url": { "url": "https://www.w3.org/TR/2003/REC-PNG-20031110/iso_8859-1.txt" } } } # Example 3: Using a PDF URL pdf_message = { "role": "user", "content": { "type": "pdf_url", "pdf_url": { "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf" } } } # Add each message to the memory system client.add([image_message], user_id="alice") client.add([text_message], user_id="alice") client.add([pdf_message], user_id="alice") ``` -------------------------------- ### Get Events in Java Source: https://docs.mem0.ai/api-reference/events/get-events A concise Java example using Unirest to retrieve events. Replace '' with your Mem0 API key for authentication. ```Java HttpResponse response = Unirest.get("https://api.mem0.ai/v1/events/") .header("Authorization", "Token ") .asString(); ``` -------------------------------- ### Bootstrap the stack via command line Source: https://docs.mem0.ai/open-source/setup Automates container startup, admin account creation, and API key generation without browser interaction. ```bash cd server make bootstrap ``` ```bash make bootstrap EMAIL=admin@company.com PASSWORD='strong-password' NAME='Admin' ``` -------------------------------- ### Get Project Details (cURL) Source: https://docs.mem0.ai/api-reference/project/get-project Example of how to retrieve project details using a cURL command. Replace '{org_id}', '{project_id}', and '' with your specific values. ```cURL curl --request GET \ --url https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/ \ --header 'Authorization: Token ' ``` -------------------------------- ### Initialize SDK Setup Source: https://docs.mem0.ai/templates/cookbook_template Standard boilerplate for initializing the Mem0 SDK in both Python and TypeScript environments. ```python default_language = "python" # replace with real imports ``` ```typescript // Equivalent TypeScript setup goes here ``` -------------------------------- ### Get Project Details (JavaScript) Source: https://docs.mem0.ai/api-reference/project/get-project This JavaScript snippet shows how to fetch project details with the Mem0 SDK. Install the SDK using 'npm i mem0ai'. ```JavaScript // To use the JavaScript SDK, install the package: // npm i mem0ai import MemoryClient from 'mem0ai'; const client = new MemoryClient({ apiKey: "your-api-key" }); client.getProject() .then(response => console.log(response)) .catch(err => console.error(err)); ``` -------------------------------- ### Initialize Mem0 and OpenAI clients Source: https://docs.mem0.ai/cookbooks/integrations/openai-tool-calls Set up the client instances for both services using environment variables. ```javascript const USER_ID = "sample-user"; const openAIClient = new OpenAI(); const mem0Client = new MemoryClient({ apiKey: process.env.MEM0_API_KEY }); ``` -------------------------------- ### Configuring the Agent Entrypoint Source: https://docs.mem0.ai/integrations/livekit Sets up the LiveKit session with STT, LLM, and TTS components, and starts the worker application. ```python async def entrypoint(ctx: JobContext): """Main entrypoint for the agent.""" await ctx.connect() session = AgentSession( stt=deepgram.STT(), llm=openai.LLM(model="gpt-5-mini"), tts=openai.TTS(voice="ash",), turn_detection=EnglishModel(), vad=silero.VAD.load(), ) await session.start( agent=MemoryEnabledAgent(), room=ctx.room, room_input_options=RoomInputOptions( noise_cancellation=noise_cancellation.BVC(), ), ) # Initial greeting await session.generate_reply( instructions="Greet the user warmly as George the travel guide and ask how you can help them plan their next adventure.", allow_interruptions=True ) # Run the application if __name__ == "__main__": cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint)) ``` -------------------------------- ### Get Project Webhooks (PHP) Source: https://docs.mem0.ai/api-reference/webhook/get-webhook Initiate a cURL request to retrieve all webhooks for a specific project using PHP. This snippet shows the setup for the cURL request. ```PHP ' and 'your_api_key' with actual values. ```Python # To use the Python SDK, install the package: # pip install mem0ai from mem0 import MemoryClient client = MemoryClient(api_key="your_api_key") memory = client.get(memory_id="") ``` -------------------------------- ### Get Project Webhooks (JavaScript) Source: https://docs.mem0.ai/api-reference/webhook/get-webhook Retrieve all webhooks for a specific project using the Mem0 JavaScript SDK. Ensure you have installed the SDK and initialized the client with your API key. ```JavaScript // To use the JavaScript SDK, install the package: // npm i mem0ai import MemoryClient from 'mem0ai'; const client = new MemoryClient({ apiKey: 'your-api-key' }); // Get all webhooks client.getWebhooks('your_project_id') .then(webhooks => console.log(webhooks)) .catch(err => console.error(err)); ``` -------------------------------- ### Initialize Mem0 with Interactive Wizard Source: https://docs.mem0.ai/integrations/openclaw Run the guided 4-step wizard to configure Mem0 providers and user ID. ```bash openclaw mem0 init --mode open-source ``` -------------------------------- ### Get Project Webhooks (Python) Source: https://docs.mem0.ai/api-reference/webhook/get-webhook Retrieve all webhooks for a specific project using the Mem0 Python SDK. Ensure you have installed the SDK and initialized the client with your API key. ```Python # To use the Python SDK, install the package: # pip install mem0ai from mem0 import MemoryClient client = MemoryClient(api_key="your_api_key") # Get all webhooks webhooks = client.get_webhooks(project_id="your_project_id") print(webhooks) ``` -------------------------------- ### Get Memory with JavaScript SDK Source: https://docs.mem0.ai/api-reference/memory/get-memory Retrieve a specific memory using the JavaScript SDK. Install the SDK via npm and provide your API key and the memory ID. ```JavaScript // To use the JavaScript SDK, install the package: // npm i mem0ai import MemoryClient from 'mem0ai'; const client = new MemoryClient({ apiKey: "your-api-key" }); // Retrieve a specific memory client.get("") .then(result => console.log(result)) .catch(error => console.error(error)); ``` -------------------------------- ### Retrieve Memory History (Python) Source: https://docs.mem0.ai/api-reference/memory/history-memory Use this Python snippet to retrieve the history of a memory. Ensure you have installed the mem0ai package and have your API key. This example first adds messages to create history, then retrieves it. ```Python # To use the Python SDK, install the package: # pip install mem0ai from mem0 import MemoryClient client = MemoryClient(api_key="your_api_key") # Add some message to create history messages = [{"role": "user", "content": ""}] client.add(messages, user_id="") # Add second message to update history messages.append({"role": "user", "content": ""}) client.add(messages, user_id="") # Get history of how memory changed over time memory_id = "" history = client.history(memory_id) ``` -------------------------------- ### Full Usage Example in Python Source: https://docs.mem0.ai/components/rerankers/models/cohere Complete workflow for initializing memory, adding data, and searching with reranking. ```python import os from mem0 import Memory # Set API key os.environ["COHERE_API_KEY"] = "your-api-key" # Initialize memory with Cohere reranker config = { "vector_store": {"provider": "chroma"}, "llm": {"provider": "openai", "config": {"model": "gpt-4o-mini"}}, "rerank": { "provider": "cohere", "config": { "model": "rerank-v3.5", "top_k": 3 } } } memory = Memory.from_config(config) # Add memories messages = [ {"role": "user", "content": "I work as a data scientist at Microsoft"}, {"role": "user", "content": "I specialize in machine learning and NLP"}, {"role": "user", "content": "I enjoy playing tennis on weekends"} ] memory.add(messages, user_id="bob") # Search with reranking results = memory.search("What is the user's profession?", filters={"user_id": "bob"}) for result in results['results']: print(f"Memory: {result['memory']}") print(f"Vector Score: {result['score']:.3f}") print(f"Rerank Score: {result['rerank_score']:.3f}") print() ``` -------------------------------- ### Retrieve Memory History (JavaScript) Source: https://docs.mem0.ai/api-reference/memory/history-memory This JavaScript snippet demonstrates how to fetch a memory's history. Install the mem0ai package and provide your API key. The example shows how to call the history function and handle the response or errors. ```JavaScript // To use the JavaScript SDK, install the package: // npm i mem0ai import MemoryClient from 'mem0ai'; const client = new MemoryClient({ apiKey: "your-api-key" }); // Get history of how memory changed over time client.history("") .then(result => console.log(result)) .catch(error => console.error(error)); ``` -------------------------------- ### Get and Create Webhooks with Go Source: https://docs.mem0.ai/api-reference/webhook/get-webhook Shows how to fetch all webhooks and subsequently create a new webhook using Go's standard `net/http` package. Error handling is omitted for brevity. ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { // Get all webhooks req, _ := http.NewRequest("GET", "https://api.mem0.ai/api/v1/webhooks/your_project_id/webhook/", nil) req.Header.Add("Authorization", "Token your-api-key") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(string(body)) // Create a webhook payload := strings.NewReader(`{ "url": "https://your-webhook-url.com", "name": "My Webhook", "event_types": ["memory:add"] }`) req, _ = http.NewRequest("POST", "https://api.mem0.ai/api/v1/webhooks/your_project_id/webhook/", payload) req.Header.Add("Authorization", "Token your-api-key") req.Header.Add("Content-Type", "application/json") res, _ = http.DefaultClient.Do(req) defer res.Body.Close() body, _ = ioutil.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Install OpenSearch Client Libraries Source: https://docs.mem0.ai/components/vectordbs/dbs/opensearch Install the necessary client library for your specific SDK to enable OpenSearch support. ```bash pip install opensearch-py ``` ```bash npm install @opensearch-project/opensearch ``` -------------------------------- ### Setup Mem0 Evaluation Environment Source: https://docs.mem0.ai/core-concepts/memory-evaluation Initialize the benchmark repository and configure environment variables for either cloud or local Docker-based execution. ```bash git clone https://github.com/mem0ai/memory-benchmarks.git cd memory-benchmarks pip install -r requirements.txt # Set your API keys export MEM0_API_KEY=m0-your-key export OPENAI_API_KEY=sk-your-key ``` ```bash git clone https://github.com/mem0ai/memory-benchmarks.git cd memory-benchmarks pip install -r requirements.txt # Copy and configure environment cp .env.example .env # Edit .env to add OPENAI_API_KEY # Start local Mem0 server + Qdrant docker compose up -d # Mem0 server: http://localhost:8888 # Qdrant: http://localhost:6333 ``` -------------------------------- ### Install vLLM Source: https://docs.mem0.ai/components/llms/models/vllm Install the vLLM package via pip. ```bash pip install vllm ``` -------------------------------- ### Initialize AsyncMemory Client Source: https://docs.mem0.ai/open-source/features/async-memory Demonstrates default and custom configuration initialization for the AsyncMemory client. ```python import asyncio from mem0 import AsyncMemory # Default configuration memory = AsyncMemory() # Custom configuration from mem0.configs.base import MemoryConfig custom_config = MemoryConfig( # Your custom configuration here ) memory = AsyncMemory(config=custom_config) ``` -------------------------------- ### Install Mem0 SDK Source: https://docs.mem0.ai/open-source/node-quickstart Install the required package via npm. ```bash npm install mem0ai ``` -------------------------------- ### Install project dependencies Source: https://docs.mem0.ai/cookbooks/companions/quickstart-demo Install all required packages using pnpm. ```bash pnpm install ``` -------------------------------- ### Start vLLM Server Source: https://docs.mem0.ai/components/llms/models/vllm Launch the vLLM server for local inference. ```bash # For testing with a small model vllm serve microsoft/DialoGPT-medium --port 8000 # For production with a larger model (requires GPU) vllm serve Qwen/Qwen2.5-32B-Instruct --port 8000 ```