File size: 5,144 Bytes
0ae3f27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
---
title: Organizations & Projects
icon: "building"
description: "Manage multi-tenant applications with organization and project APIs"
---

## Overview

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>

## Key Capabilities

- **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

---

## Using Organizations & Projects

### Initialize with Org/Project Context

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>

---

## Project Management

The Mem0 client provides comprehensive project management through the `client.project` interface:

### Get Project Details

Retrieve information about the current project:

```python
# Get all project details
project_info = client.project.get()

# Get specific fields only
project_info = client.project.get(fields=["name", "description", "custom_categories"])
```

### Create a New Project

Create a new project within your organization:

```python
# Create a project with name and description
new_project = client.project.create(
    name="My New Project",
    description="A project for managing customer support memories"
)
```

### Update Project Settings

Modify project configuration including custom instructions, categories, graph settings, and language preferences:

```python
# Update project with custom categories
client.project.update(
    custom_categories=[
        {"customer_preferences": "Customer likes, dislikes, and preferences"},
        {"support_history": "Previous support interactions and resolutions"}
    ]
)

# Update project with custom instructions
client.project.update(
    custom_instructions="..."
)

# Enable graph memory for the project
client.project.update(enable_graph=True)

# Use the input language for memory storage and retrieval
client.project.update(multilingual=True)

# Update multiple settings at once
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
)
```

### Delete Project

<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
# Delete the current project (irreversible)
result = client.project.delete()
```

---

## Member Management

Manage project members and their access levels:

```python
# Get all project members
members = client.project.get_members()

# Add a new member as a reader
client.project.add_member(
    email="colleague@company.com",
    role="READER"  # or "OWNER"
)

# Update a member's role
client.project.update_member(
    email="colleague@company.com",
    role="OWNER"
)

# Remove a member from the project
client.project.remove_member(email="colleague@company.com")
```

### Member Roles

| 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 |

---

## Async Support

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')

    # 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 properly
import asyncio
asyncio.run(manage_project())
```

---

## API Reference

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>