Skip to main content

Knowledge Base

Upload documents (PDFs, text files) to the knowledge base so the AI assistant can reference them when answering customer questions.

How It Works

  1. Upload a document to the knowledge base
  2. WAzion extracts the text content and processes it
  3. The document is synced to the AI's vector store
  4. The AI references the document when answering relevant questions

Upload a Document

curl

# Note: File upload requires multipart/form-data, which isn't possible
# through the JSON-RPC protocol directly. Use the create_knowledge_file
# tool to create text-based knowledge files.

curl -X POST https://www.wazion.com/api/mcp/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $WAZION_TOKEN" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "create_knowledge_file",
"arguments": {
"title": "Return Policy",
"content": "Our return policy allows returns within 30 days of purchase...",
"description": "Customer-facing return and refund policy"
}
},
"id": 1
}'

Python

import requests

def create_knowledge_file(token, title, content, description=""):
return requests.post(
"https://www.wazion.com/api/mcp/",
headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {token}"
},
json={
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "create_knowledge_file",
"arguments": {
"title": title,
"content": content,
"description": description
}
},
"id": 1
}
).json()

List Knowledge Files

{
"name": "list_knowledge_files",
"arguments": {}
}

Update a Knowledge File

{
"name": "update_knowledge_file",
"arguments": {
"file_id": 1,
"title": "Updated Return Policy",
"content": "New policy text..."
}
}

Toggle File Active/Inactive

Deactivate a file without deleting it (the AI will stop using it):

{
"name": "toggle_knowledge_file",
"arguments": {
"file_id": 1,
"is_active": false
}
}

Delete a Knowledge File

{
"name": "delete_knowledge_file",
"arguments": {
"file_id": 1
}
}

System files cannot be deleted.

Storage Status

Check your storage usage and quota:

{
"name": "get_storage_status",
"arguments": {}
}

Force Sync

Manually trigger synchronization of learned facts to the vector store:

{
"name": "sync_knowledge_now",
"arguments": {}
}

All Knowledge Base Tools

ToolTypeDescription
list_knowledge_filesqueryList all knowledge files
create_knowledge_filemutationCreate from text content
upload_knowledge_filemutationUpload a file (PDF, doc)
update_knowledge_filemutationUpdate title/content
delete_knowledge_filemutationDelete a file
toggle_knowledge_filemutationActivate/deactivate
download_knowledge_filequeryGet download URL
get_knowledge_processing_statusqueryCheck processing status
get_storage_statusqueryStorage usage and quota
list_storage_filesqueryList files with sizes
sync_knowledge_nowmutationForce vector store sync

Gotchas

  • File processing takes a few seconds to minutes depending on size. Check status with get_knowledge_processing_status.
  • Each shop has a storage quota (default 1GB). Check with get_storage_status.
  • System files (auto-generated) cannot be deleted.
  • The create_knowledge_file tool creates files from text content. For uploading binary files (PDF), use upload_knowledge_file.