| --- |
| title: Organizations & Projects |
| icon: "building" |
| description: "Manage multi-tenant applications with organization and project APIs" |
| --- |
| |
| |
|
|
| 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. |
|
|
| <Info> |
| Organizations and projects are **optional** features. You can use Mem0 without them for single-user or simple multi-user applications. |
| </Info> |
|
|
| |
|
|
| - **Multi-org/project Support**: Specify organization and project when initializing the Mem0 client to attribute API usage appropriately |
| - **Member Management**: Control access to data through organization and project membership |
| - **Access Control**: Only members can access memories and data within their organization/project scope |
| - **Team Isolation**: Maintain data separation between different teams and projects for secure collaboration |
|
|
| --- |
| |
| |
|
|
| |
|
|
| Example with the mem0 Python package: |
|
|
| <Tabs> |
| <Tab title="Python"> |
|
|
| ```python |
| from mem0 import MemoryClient |
| client = MemoryClient(org_id='YOUR_ORG_ID', project_id='YOUR_PROJECT_ID') |
| ``` |
|
|
| </Tab> |
|
|
| <Tab title="Node.js"> |
|
|
| ```javascript |
| import { MemoryClient } from "mem0ai"; |
| const client = new MemoryClient({ |
| organizationId: "YOUR_ORG_ID", |
| projectId: "YOUR_PROJECT_ID" |
| }); |
| ``` |
|
|
| </Tab> |
| </Tabs> |
|
|
| --- |
| |
| |
|
|
| The Mem0 client provides comprehensive project management through the `client.project` interface: |
|
|
| |
|
|
| Retrieve information about the current project: |
|
|
| ```python |
| |
| project_info = client.project.get() |
|
|
| |
| project_info = client.project.get(fields=["name", "description", "custom_categories"]) |
| ``` |
|
|
| |
|
|
| Create a new project within your organization: |
|
|
| ```python |
| |
| new_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: |
|
|
| ```python |
| |
| client.project.update( |
| custom_categories=[ |
| {"customer_preferences": "Customer likes, dislikes, and preferences"}, |
| {"support_history": "Previous support interactions and resolutions"} |
| ] |
| ) |
|
|
| |
| client.project.update( |
| custom_instructions="..." |
| ) |
|
|
| |
| client.project.update(enable_graph=True) |
|
|
| |
| client.project.update(multilingual=True) |
|
|
| |
| client.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 |
| ) |
| ``` |
|
|
| |
|
|
| <Warning> |
| This action will remove all memories, messages, and other related data in the project. **This operation is irreversible.** |
| </Warning> |
|
|
| Remove a project and all its associated data: |
|
|
| ```python |
| |
| result = client.project.delete() |
| ``` |
|
|
| --- |
| |
| |
|
|
| Manage project members and their access levels: |
|
|
| ```python |
| |
| members = client.project.get_members() |
|
|
| |
| client.project.add_member( |
| email="colleague@company.com", |
| role="READER" |
| ) |
|
|
| |
| client.project.update_member( |
| email="colleague@company.com", |
| role="OWNER" |
| ) |
|
|
| |
| client.project.remove_member(email="colleague@company.com") |
| ``` |
|
|
| |
|
|
| | Role | Permissions | |
| |------|-------------| |
| | **READER** | Can view and search memories, but cannot modify project settings or manage members | |
| | **OWNER** | Full access including project modification, member management, and all reader permissions | |
|
|
| --- |
| |
| |
|
|
| All project methods are available in async mode: |
|
|
| ```python |
| from mem0 import AsyncMemoryClient |
|
|
| async def manage_project(): |
| client = AsyncMemoryClient(org_id='YOUR_ORG_ID', project_id='YOUR_PROJECT_ID') |
|
|
| |
| project_info = await client.project.get() |
| await client.project.update(enable_graph=True) |
| members = await client.project.get_members() |
|
|
| |
| import asyncio |
| asyncio.run(manage_project()) |
| ``` |
|
|
| --- |
| |
| |
|
|
| For complete API specifications and additional endpoints, see: |
|
|
| <CardGroup cols={2}> |
| <Card title="Organizations APIs" icon="building" href="/api-reference/organization/create-org"> |
| Create, get, and manage organizations |
| </Card> |
|
|
| <Card title="Project APIs" icon="folder" href="/api-reference/project/create-project"> |
| Full project CRUD and member management endpoints |
| </Card> |
| </CardGroup> |
|
|