Edit Profile
Edit a Profile memory instance: add fields, update field values, remove fields, or lock fields against automatic updates by the algorithm. Only the target instance is affected; the template and other instances are not changed.
POST
import os
import requests
import json
# Replace with your API Key
os.environ["MEMOS_API_KEY"] = "YOUR_API_KEY"
os.environ["MEMOS_BASE_URL"] = "https://memos.memtensor.cn/api/openmem/v1"
data = {
"user_id": "memos_user_123",
"profile_template_id": "tpl_user_001",
"metadata": {
"Basic Info": {
"Location": {
"value": "Shanghai",
"algorithm_updatable": False
}
}
}
}
headers = {
"Content-Type": "application/json",
"Authorization": f"Token {os.environ['MEMOS_API_KEY']}"
}
url = f"{os.environ['MEMOS_BASE_URL']}/edit/profile"
res = requests.post(url=url, headers=headers, data=json.dumps(data))
print(f"result: {res.json()}")
# Ensure MemOS is installed (pip install MemoryOS -U)
from memos.api.client import MemOSClient
client = MemOSClient(api_key="YOUR_API_KEY")
res = client.edit_profile(
user_id="memos_user_123",
profile_template_id="tpl_user_001",
metadata={
"Basic Info": {
"Location": {
"value": "Shanghai",
"algorithm_updatable": False
}
}
}
)
print(f"result: {res}")
curl --request POST \
--url https://memos.memtensor.cn/api/openmem/v1/edit/profile \
--header 'Authorization: Token YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"user_id": "memos_user_123",
"profile_template_id": "tpl_user_001",
"metadata": {
"Basic Info": {
"Location": {
"value": "Shanghai",
"algorithm_updatable": false
}
}
}
}'
{
"code": 0,
"data": {
"success": true
},
"message": "<string>"
}Authorizations
Authorization
string
header
required
Token API_key, available in API Console > API Keys
Body
application/json
user_id
string
User ID. Use either user_id or agent_id. Required for single-perspective projects.
agent_id
string
Agent ID. Available only when independent Agent memory is enabled; use either user_id or agent_id.
profile_template_id
string
required
ID of the target Profile template.
metadata
object
Fields to update. Existing fields are updated with the new value; new fields are added to the current instance.
Show child attributes
remove_fields
string[]
List of field paths to remove, e.g. ["Basic Info.Occupation"].
Response
application/json
Successful Response
code
number
API status code.
data
object
Show child attributes
message
string
API response message.
import os
import requests
import json
# Replace with your API Key
os.environ["MEMOS_API_KEY"] = "YOUR_API_KEY"
os.environ["MEMOS_BASE_URL"] = "https://memos.memtensor.cn/api/openmem/v1"
data = {
"user_id": "memos_user_123",
"profile_template_id": "tpl_user_001",
"metadata": {
"Basic Info": {
"Location": {
"value": "Shanghai",
"algorithm_updatable": False
}
}
}
}
headers = {
"Content-Type": "application/json",
"Authorization": f"Token {os.environ['MEMOS_API_KEY']}"
}
url = f"{os.environ['MEMOS_BASE_URL']}/edit/profile"
res = requests.post(url=url, headers=headers, data=json.dumps(data))
print(f"result: {res.json()}")
# Ensure MemOS is installed (pip install MemoryOS -U)
from memos.api.client import MemOSClient
client = MemOSClient(api_key="YOUR_API_KEY")
res = client.edit_profile(
user_id="memos_user_123",
profile_template_id="tpl_user_001",
metadata={
"Basic Info": {
"Location": {
"value": "Shanghai",
"algorithm_updatable": False
}
}
}
)
print(f"result: {res}")
curl --request POST \
--url https://memos.memtensor.cn/api/openmem/v1/edit/profile \
--header 'Authorization: Token YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"user_id": "memos_user_123",
"profile_template_id": "tpl_user_001",
"metadata": {
"Basic Info": {
"Location": {
"value": "Shanghai",
"algorithm_updatable": false
}
}
}
}'
{
"code": 0,
"data": {
"success": true
},
"message": "<string>"
}