This guide explains the different parameters available in the Mem0 MCP server and how they relate to Mem0's organization structure.
userId: Required. Identifies the user whose memories to store/search.- Fallback:
DEFAULT_USER_IDenvironment variable - Example:
"user123"
- Fallback:
sessionId: Optional. Groups memories by conversation/session.- Maps to
run_idin Mem0 API - Example:
"conversation_abc123"
- Maps to
agentId: Optional. Identifies which LLM/agent is making the request.- Fallback:
DEFAULT_AGENT_IDenvironment variable - Example:
"Claude","GPT-4" - Note: This should appear as
"agent_id"in search results, not"actor_id"
- Fallback:
- Optional application identifier
- Fallback:
DEFAULT_APP_IDenvironment variable - Creates an "app" entry in Mem0 dashboard
- Example:
"my-chatbot-v1"
- Optional project identifier for Mem0 Pro plan project organization
- Fallback:
DEFAULT_PROJECT_IDenvironment variable - Should use format:
proj_ABC123... - Purpose: Organizes memories within specific project buckets in Mem0 dashboard
- Example:
"proj_ABC123456789"
- Optional organization identifier for organization-level management
- Fallback:
DEFAULT_ORG_IDenvironment variable - Purpose: Manages memories at the organization level
- Example:
"org_XYZ789012345"
Possible Causes:
- Parameter not being passed correctly to API
- API response format differences between SDK and direct REST calls
- Mem0 API version differences
Debug Steps:
- Check the console logs for parameter resolution details
- Verify the
agentIdparameter is being passed - Try using both SDK and direct REST API methods
Solution:
- Ensure you're using the correct
proj_format ID from your Mem0 dashboard - The
projectIdshould match exactly what appears in your Mem0 Pro account appIdandprojectIdserve different purposes - useprojectIdfor project organization
Solution:
- Verify the
DEFAULT_USER_IDenvironment variable is properly set - Check that the environment variable is loaded before the MCP server starts
- Explicitly pass
userIdparameter if environment variable approach isn't working
Set these in your environment to provide fallback values:
# Required (one of these approaches)
DEFAULT_USER_ID="your-default-user-id"
# Optional fallbacks
DEFAULT_AGENT_ID="Claude" # or "GPT-4", etc.
DEFAULT_APP_ID="my-app"
DEFAULT_PROJECT_ID="proj_ABC123456789" # From your Mem0 dashboard
DEFAULT_ORG_ID="org_XYZ789012345" # From your Mem0 dashboardThe MCP server automatically converts camelCase parameters to snake_case for the Mem0 API:
| MCP Parameter | Mem0 API Parameter | Purpose |
|---|---|---|
userId |
user_id |
User identification |
sessionId |
run_id |
Session/conversation tracking |
agentId |
agent_id |
Agent/LLM identification |
appId |
app_id |
Application identification (legacy) |
projectId |
project_id |
Project organization (Pro plans) |
orgId |
org_id |
Organization management |
{
"content": "User prefers dark mode",
"userId": "user123",
"agentId": "Claude"
}{
"content": "Customer feedback about product feature",
"userId": "user123",
"projectId": "proj_ABC123456789",
"agentId": "Claude",
"metadata": {
"category": "feedback",
"product": "main-app"
}
}{
"content": "Company policy update",
"userId": "admin123",
"orgId": "org_XYZ789012345",
"projectId": "proj_ABC123456789",
"agentId": "Claude"
}- Enable Debug Logging: Check console output for parameter resolution details
- Test Parameters Individually: Try each parameter one at a time to isolate issues
- Verify API Responses: Look for the expected field names in search results
- Check Mem0 Dashboard: Verify that memories appear in the expected project/organization buckets