Organizations and projects provide multi-tenant support, access control, and team collaboration capabilities for Mem0 Platform. Use these APIs to build applications that support multiple teams, customers, or isolated environments.
Organizations and projects are optional features. You can use Mem0 without them for single-user or simple multi-user applications.
# Get all project detailsproject_info = client.project.get()# Get specific fields onlyproject_info = client.project.get(fields=["name", "description", "custom_categories"])
# Create a project with name and descriptionnew_project = client.project.create( name="My New Project", description="A project for managing customer support memories")
Modify project configuration including custom instructions, categories, graph settings, and language preferences:
# Update project with custom categoriesclient.project.update( custom_categories=[ {"customer_preferences": "Customer likes, dislikes, and preferences"}, {"support_history": "Previous support interactions and resolutions"} ])# Update project with custom instructionsclient.project.update( custom_instructions="...")# Enable graph memory for the projectclient.project.update(enable_graph=True)# Use the input language for memory storage and retrievalclient.project.update(multilingual=True)# Update multiple settings at onceclient.project.update( custom_instructions="...", custom_categories=[ {"personal_info": "User personal information and preferences"}, {"work_context": "Professional context and work-related information"} ], enable_graph=True, multilingual=True)
# Get all project membersmembers = client.project.get_members()# Add a new member as a readerclient.project.add_member( email="[email protected]", role="READER" # or "OWNER")# Update a member's roleclient.project.update_member( email="[email protected]", role="OWNER")# Remove a member from the projectclient.project.remove_member(email="[email protected]")
from mem0 import AsyncMemoryClientasync def manage_project(): client = AsyncMemoryClient(org_id='YOUR_ORG_ID', project_id='YOUR_PROJECT_ID') # All methods support async/await project_info = await client.project.get() await client.project.update(enable_graph=True) members = await client.project.get_members()# To call the async function properlyimport asyncioasyncio.run(manage_project())