Python
# To use the Python SDK, install the package:
# pip install mem0ai
from mem0 import MemoryClient
client = MemoryClient(api_key="your_api_key")
new_categories = [
{"cooking": "For users interested in cooking and culinary experiences"},
{"fitness": "Includes content related to fitness and workouts"}
]
response = client.update_project(custom_categories=new_categories)
print(response)// To use the JavaScript SDK, install the package:
// npm i mem0ai
import MemoryClient from 'mem0ai';
const client = new MemoryClient({ apiKey: "your-api-key" });
const newCategories = [
{"cooking": "For users interested in cooking and culinary experiences"},
{"fitness": "Includes content related to fitness and workouts"}
];
client.updateProject({ custom_categories: newCategories })
.then(response => console.log(response))
.catch(err => console.error(err));curl --request PATCH \
--url https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/ \
--header 'Authorization: Token <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"custom_categories": [
{"cooking": "For users interested in cooking and culinary experiences"},
{"fitness": "Includes content related to fitness and workouts"}
]
}'// 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")
newCategories := []map[string]string{
{"cooking": "For users interested in cooking and culinary experiences"},
{"fitness": "Includes content related to fitness and workouts"},
}
response, err := client.UpdateProject(mem0.UpdateProjectParams{
CustomCategories: newCategories,
})
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
fmt.Printf("%+v\n", response)
}<?php
// To use the PHP SDK, install the package:
// composer require mem0ai/mem0-php
require_once('vendor/autoload.php');
use Mem0\MemoryClient;
$client = new MemoryClient('your-api-key');
$newCategories = [
['cooking' => 'For users interested in cooking and culinary experiences'],
['fitness' => 'Includes content related to fitness and workouts']
];
try {
$response = $client->updateProject(['custom_categories' => $newCategories]);
print_r($response);
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}// To use the Java SDK, add this dependency to your pom.xml:
// <dependency>
// <groupId>ai.mem0</groupId>
// <artifactId>mem0-java</artifactId>
// <version>1.0.0</version>
// </dependency>
import ai.mem0.MemoryClient;
import java.util.*;
public class Example {
public static void main(String[] args) {
MemoryClient client = new MemoryClient("your-api-key");
List<Map<String, String>> newCategories = Arrays.asList(
Collections.singletonMap("cooking", "For users interested in cooking and culinary experiences"),
Collections.singletonMap("fitness", "Includes content related to fitness and workouts")
);
try {
Map<String, Object> params = new HashMap<>();
params.put("custom_categories", newCategories);
Object response = client.updateProject(params);
System.out.println(response);
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
}
}require 'uri'
require 'net/http'
url = URI("https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"custom_instructions\": [\n \"<string>\"\n ],\n \"custom_categories\": [\n {}\n ],\n \"multilingual\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "Project updated successfully"
}{
"message": "Organization or project not found"
}Projects
Update Project
Update a project’s settings, including name, custom instructions, and other configuration options.
PATCH
/
api
/
v1
/
orgs
/
organizations
/
{org_id}
/
projects
/
{project_id}
/
Python
# To use the Python SDK, install the package:
# pip install mem0ai
from mem0 import MemoryClient
client = MemoryClient(api_key="your_api_key")
new_categories = [
{"cooking": "For users interested in cooking and culinary experiences"},
{"fitness": "Includes content related to fitness and workouts"}
]
response = client.update_project(custom_categories=new_categories)
print(response)// To use the JavaScript SDK, install the package:
// npm i mem0ai
import MemoryClient from 'mem0ai';
const client = new MemoryClient({ apiKey: "your-api-key" });
const newCategories = [
{"cooking": "For users interested in cooking and culinary experiences"},
{"fitness": "Includes content related to fitness and workouts"}
];
client.updateProject({ custom_categories: newCategories })
.then(response => console.log(response))
.catch(err => console.error(err));curl --request PATCH \
--url https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/ \
--header 'Authorization: Token <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"custom_categories": [
{"cooking": "For users interested in cooking and culinary experiences"},
{"fitness": "Includes content related to fitness and workouts"}
]
}'// 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")
newCategories := []map[string]string{
{"cooking": "For users interested in cooking and culinary experiences"},
{"fitness": "Includes content related to fitness and workouts"},
}
response, err := client.UpdateProject(mem0.UpdateProjectParams{
CustomCategories: newCategories,
})
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
fmt.Printf("%+v\n", response)
}<?php
// To use the PHP SDK, install the package:
// composer require mem0ai/mem0-php
require_once('vendor/autoload.php');
use Mem0\MemoryClient;
$client = new MemoryClient('your-api-key');
$newCategories = [
['cooking' => 'For users interested in cooking and culinary experiences'],
['fitness' => 'Includes content related to fitness and workouts']
];
try {
$response = $client->updateProject(['custom_categories' => $newCategories]);
print_r($response);
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}// To use the Java SDK, add this dependency to your pom.xml:
// <dependency>
// <groupId>ai.mem0</groupId>
// <artifactId>mem0-java</artifactId>
// <version>1.0.0</version>
// </dependency>
import ai.mem0.MemoryClient;
import java.util.*;
public class Example {
public static void main(String[] args) {
MemoryClient client = new MemoryClient("your-api-key");
List<Map<String, String>> newCategories = Arrays.asList(
Collections.singletonMap("cooking", "For users interested in cooking and culinary experiences"),
Collections.singletonMap("fitness", "Includes content related to fitness and workouts")
);
try {
Map<String, Object> params = new HashMap<>();
params.put("custom_categories", newCategories);
Object response = client.updateProject(params);
System.out.println(response);
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
}
}require 'uri'
require 'net/http'
url = URI("https://api.mem0.ai/api/v1/orgs/organizations/{org_id}/projects/{project_id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"custom_instructions\": [\n \"<string>\"\n ],\n \"custom_categories\": [\n {}\n ],\n \"multilingual\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "Project updated successfully"
}{
"message": "Organization or project not found"
}Authorizations
API key authentication. Prefix your Mem0 API key with 'Token '. Example: 'Token your_api_key'
Path Parameters
Unique identifier of the organization.
Unique identifier of the project to be updated.
Body
application/json
Name of the project
Description of the project
Custom instructions for memory processing in this project
List of custom categories to be used for memory categorization.
Whether to use the input language for memory storage and retrieval.
Response
Project updated successfully.
Example:
"Project updated successfully"
Was this page helpful?
⌘I