Add Feedback
This API is used to add feedback to current session messages, allowing MemOS to correct memories based on user feedback.
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",
"conversation_id": "memos_feedback_conv",
"feedback_content": "No, we are changing the meal allowance for tier-1 cities to 150 yuan/day and accommodation allowance to 700 yuan/day; tier-2 and tier-3 cities remain unchanged.",
"allow_knowledgebase_ids":["basee5ec9050-c964-484f-abf1-ce3e8e2aa5b7"] # Replace with Knowledge Base ID
}
headers = {
"Content-Type": "application/json",
"Authorization": f"Token {os.environ['MEMOS_API_KEY']}"
}
url = f"{os.environ['MEMOS_BASE_URL']}/add/feedback"
res = requests.post(url=url, headers=headers, data=json.dumps(data))
print(f"result: {res.json()}")
curl --request POST \
--url https://memos.memtensor.cn/api/openmem/v1/add/feedback \
--header 'Authorization: Token YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"user_id": "memos_user_123",
"conversation_id": "memos_feedback_conv",
"feedback_content": "No, we are changing the meal allowance for tier-1 cities to 150 yuan/day and accommodation allowance to 700 yuan/day; tier-2 and tier-3 cities remain unchanged.",
"allow_knowledgebase_ids":["basee5ec9050-c964-484f-abf1-ce3e8e2aa5b7"]
}'
Authorizations
Authorization
string
header
required
Token API_key, available in API Console > API Keys
Body
application/json
user_id
string
required
Unique identifier of the user associated with the feedback content.
conversation_id
string
required
Unique identifier of the conversation associated with the feedback content.
feedback_content
string
required
Feedback content text.
agent_id
string
Unique identifier of the Agent associated with the feedback content, primarily used to query exclusive memories between a user and that Agent during retrieval.
app_id
string
Unique identifier of the App associated with the feedback content, primarily used to query exclusive memories of a user under that App during retrieval.
feedback_time
string
Time when the feedback occurred, can be a structured timestamp or natural language time description. Providing this parameter allows memory to include time information.
allow_public
boolean
default: false
Whether memories generated from the feedback content are allowed to be written to the public memory store. When enabled, generated memories can be retrieved by other users in the project.
allow_knowledgebase_ids
string[]
List of knowledgebases where memories generated from the feedback content are allowed to be written.
Response
application/json
Successful Response
code
number
required
API status code. See Error Code for details.
data
object
Show child attributes
message
string
required
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",
"conversation_id": "memos_feedback_conv",
"feedback_content": "No, we are changing the meal allowance for tier-1 cities to 150 yuan/day and accommodation allowance to 700 yuan/day; tier-2 and tier-3 cities remain unchanged.",
"allow_knowledgebase_ids":["basee5ec9050-c964-484f-abf1-ce3e8e2aa5b7"] # Replace with Knowledge Base ID
}
headers = {
"Content-Type": "application/json",
"Authorization": f"Token {os.environ['MEMOS_API_KEY']}"
}
url = f"{os.environ['MEMOS_BASE_URL']}/add/feedback"
res = requests.post(url=url, headers=headers, data=json.dumps(data))
print(f"result: {res.json()}")
curl --request POST \
--url https://memos.memtensor.cn/api/openmem/v1/add/feedback \
--header 'Authorization: Token YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"user_id": "memos_user_123",
"conversation_id": "memos_feedback_conv",
"feedback_content": "No, we are changing the meal allowance for tier-1 cities to 150 yuan/day and accommodation allowance to 700 yuan/day; tier-2 and tier-3 cities remain unchanged.",
"allow_knowledgebase_ids":["basee5ec9050-c964-484f-abf1-ce3e8e2aa5b7"]
}'