Delete Knowledgebase
Delete a knowledge base or remove its association with the current project.
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 = {
"knowledgebase_id": "basee5ec9050-c964-484f-abf1-ce3e8e2aa5b7" # Replace with the Knowledge Base ID to delete
}
headers = {
"Content-Type": "application/json",
"Authorization": f"Token {os.environ['MEMOS_API_KEY']}"
}
url = f"{os.environ['MEMOS_BASE_URL']}/delete/knowledgebase"
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
# Initialize client with API Key
client = MemOSClient(api_key="YOUR_API_KEY")
knowledgebase_id = "basee5ec9050-c964-484f-abf1-ce3e8e2aa5b7" # Replace with the Knowledge Base ID to delete
res = client.delete_knowledgebase(knowledgebase_id=knowledgebase_id)
print(f"result: {res}")
curl --request POST \
--url https://memos.memtensor.cn/api/openmem/v1/delete/knowledgebase \
--header 'Authorization: Token YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"knowledgebase_id": "basee5ec9050-c964-484f-abf1-ce3e8e2aa5b7"
}'
{
"code": 0,
"data": {
"success": true
},
"message": "<string>"
}Authorizations
Authorization
string
header
required
Token API_key, available in API Console > API Keys
Body
application/json
knowledgebase_id
string
required
ID of the knowledge base to delete or remove from the current project
delete_all
boolean
default: false
Whether to permanently delete the knowledge base. Defaults to false, which only removes the association with the project that owns the current API key. Set it to true to delete the knowledge base and its files, and remove its associations with all projects.
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 = {
"knowledgebase_id": "basee5ec9050-c964-484f-abf1-ce3e8e2aa5b7" # Replace with the Knowledge Base ID to delete
}
headers = {
"Content-Type": "application/json",
"Authorization": f"Token {os.environ['MEMOS_API_KEY']}"
}
url = f"{os.environ['MEMOS_BASE_URL']}/delete/knowledgebase"
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
# Initialize client with API Key
client = MemOSClient(api_key="YOUR_API_KEY")
knowledgebase_id = "basee5ec9050-c964-484f-abf1-ce3e8e2aa5b7" # Replace with the Knowledge Base ID to delete
res = client.delete_knowledgebase(knowledgebase_id=knowledgebase_id)
print(f"result: {res}")
curl --request POST \
--url https://memos.memtensor.cn/api/openmem/v1/delete/knowledgebase \
--header 'Authorization: Token YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"knowledgebase_id": "basee5ec9050-c964-484f-abf1-ce3e8e2aa5b7"
}'
{
"code": 0,
"data": {
"success": true
},
"message": "<string>"
}