Update knowledge base entry
Beta
Updates a knowledge base entry with training content. This is the second step in the training process after creating an entry. You can provide "rawText" which is the content you want your replica to learn from (such as product information, company policies, or specialized knowledge). The system will automatically process this text and make it available for your replica to use when answering questions. The entry status will change to PROCESSING and then to READY once fully processed.
Path parameters
-
The unique identifier of the knowledge base entry
-
The replica unique identifier (UUID)
Body
-
The initial text content you want your replica to learn. This is the information you provide that will be processed and optimized for the knowledge base.
Minimum length is
1
. -
Generated facts related to the knowledge base entry.
-
Segments of textual content that have been extracted from the original sources and split into smaller, manageable pieces.
-
Title for this knowledge base entry. Helps identify the content in listings.
-
Auto-generated title for the knowledge base entry based on the content.
-
A concise 1-2 sentence summary of rawText.
-
Website content related to the knowledge base entry
Additional properties are NOT allowed.
-
YouTube content related to the knowledge base entry
Additional properties are NOT allowed.
-
File content related to the knowledge base entry
Additional properties are NOT allowed.
-
Error information related to the knowledge base entry
Additional properties are NOT allowed.
curl \
--request PATCH 'https://api.sensay.io/v1/replicas/03db5651-cb61-4bdf-9ef0-89561f7c9c53/knowledge-base/12345' \
--header "X-ORGANIZATION-SECRET: $API_KEY" \
--header "Content-Type: application/json" \
--header "X-API-Version: 2025-03-25" \
--data '{"rawText":"Our company was founded in 2020. We specialize in AI-powered customer service solutions.","generatedFacts":["The company was founded in 2020.","We specialize in AI-powered customer service solutions."],"rawTextChunks":[{"content":"First part of the document content.","chunkChars":35,"chunkIndex":0,"chunkTokens":7},{"content":"Second part of the document content.","chunkChars":36,"chunkIndex":1,"chunkTokens":7}],"title":"Company information","generatedTitle":"Company information and Business Hours","summary":"Basic company details including founding date, business focus, and operating hours.","website":{"url":"https://example.com","html":"\u003chtml\u003e...\u003c/html\u003e","text":"This is the main text content extracted from the website.","links":["https://example.com","https://another-example.com"],"title":"Example Website Title","screenshot":"data:image/png;base64,...","description":"Example Website Description"},"youtube":{"url":"https://www.youtube.com/watch?v=VIDEO_ID","title":"Example YouTube Video Title","summary":"A concise summary of the key points covered in the video.","description":"This is a description of the YouTube video content.","thumbnailURL":"https://i.ytimg.com/vi/VIDEO_ID/hqdefault.jpg","transcription":"This is the complete transcript of the video content...","visualTranscription":"Visual elements and scenes described in text format"},"file":{"name":"company_handbook.pdf","size":204800,"mimeType":"application/epub+zip","screenshot":"data:image/png;base64,..."},"error":{"message":"Failed to process the entry due to invalid format.","fingerprint":"12345"}}'
# Headers
X-API-Version: 2025-03-25
# Payload
{
"rawText": "Our company was founded in 2020. We specialize in AI-powered customer service solutions.",
"generatedFacts": [
"The company was founded in 2020.",
"We specialize in AI-powered customer service solutions."
],
"rawTextChunks": [
{
"content": "First part of the document content.",
"chunkChars": 35,
"chunkIndex": 0,
"chunkTokens": 7
},
{
"content": "Second part of the document content.",
"chunkChars": 36,
"chunkIndex": 1,
"chunkTokens": 7
}
],
"title": "Company information",
"generatedTitle": "Company information and Business Hours",
"summary": "Basic company details including founding date, business focus, and operating hours.",
"website": {
"url": "https://example.com",
"html": "<html>...</html>",
"text": "This is the main text content extracted from the website.",
"links": [
"https://example.com",
"https://another-example.com"
],
"title": "Example Website Title",
"screenshot": "data:image/png;base64,...",
"description": "Example Website Description"
},
"youtube": {
"url": "https://www.youtube.com/watch?v=VIDEO_ID",
"title": "Example YouTube Video Title",
"summary": "A concise summary of the key points covered in the video.",
"description": "This is a description of the YouTube video content.",
"thumbnailURL": "https://i.ytimg.com/vi/VIDEO_ID/hqdefault.jpg",
"transcription": "This is the complete transcript of the video content...",
"visualTranscription": "Visual elements and scenes described in text format"
},
"file": {
"name": "company_handbook.pdf",
"size": 204800,
"mimeType": "application/epub+zip",
"screenshot": "data:image/png;base64,..."
},
"error": {
"message": "Failed to process the entry due to invalid format.",
"fingerprint": "12345"
}
}
{
"success": true
}
{
"error": "A text representation of the error",
"success": false,
"request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
"fingerprint": "14fceadd84e74ec499afe9b0f7952d6b"
}
{
"error": "A text representation of the error",
"success": false,
"request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
"fingerprint": "14fceadd84e74ec499afe9b0f7952d6b"
}
{
"error": "A text representation of the error",
"success": false,
"request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab"
}
{
"error": "A text representation of the error",
"success": false,
"request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
"fingerprint": "14fceadd84e74ec499afe9b0f7952d6b"
}
{
"error": "A text representation of the error",
"success": false,
"request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
"fingerprint": "14fceadd84e74ec499afe9b0f7952d6b",
"inner_exception": {
"name": "Server overheated",
"cause": "Request too complicated",
"stack": "Error: Server overheated due to an unexpected situation\n at Object.eval (eval at <anonymous>...",
"message": "The server overheated due to an unexpected situation"
}
}