Re-embed All Knowledges
Used to re-process and re-embed all knowledge base entries. This is useful when updating embedding models, refreshing the knowledge base index, or applying new configurations to existing content.
API Endpoint
| Property | Value |
|---|---|
| Request Method | POST |
| Request URL | https://api.seliseblocks.com/kb/reembed |
Request
Request Example
curl -X POST 'https://api.seliseblocks.com/kb/reembed' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"project_key": "YOUR_PROJECT_KEY",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"kbs": [
{
"kb_id": "kb_001",
"type": "file",
"source": "document.pdf"
},
{
"kb_id": "kb_002",
"type": "text",
"source": "raw_text_content"
}
]
}'
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
| Content-Type | application/json | Yes | Data type, must be application/json. |
Request Body
Request Body Schema
{
"project_key": "string",
"agent_id": "string",
"kbs": [
{
"additionalProp1": {}
}
]
}
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| project_key | string | Yes | The project key for your project. |
| agent_id | string | Yes | UUID of the AI agent whose knowledge base will be re-embedded. |
| kbs | array | Yes | Array of knowledge base entry objects to re-embed. |
Knowledge Base Entry Object
Each entry in the kbs array is an object containing information about a specific knowledge base item. The structure may vary depending on the knowledge type:
| Field | Type | Description |
|---|---|---|
| kb_id | string | Unique identifier of the knowledge base entry. |
| type | string | Type of knowledge (e.g., file, text, qa, link). |
| source | string | Source identifier or content reference. |
note
When to Re-embed
- After changing the embedding model in RAG configuration
- When updating to a newer version of an embedding model
- To refresh the vector index with improved embeddings
- After making significant changes to chunking strategies
warning
Re-embedding can be a resource-intensive operation, especially for large knowledge bases. The process may take considerable time depending on:
- The number of knowledge base entries
- The size of the content
- The complexity of the embedding model
- Current system load
Response
Success Response (200 OK)
Returns an object containing the re-embedding status.
{
"is_success": true,
"detail": "Knowledge base entries re-embedded successfully. Processed 150 entries.",
"error": {}
}
Response Fields
| Field | Type | Description |
|---|---|---|
| is_success | boolean | Indicates whether the re-embedding was successful. |
| detail | string | Success or failure message with additional context. |
| error | object | Error details if the operation failed (empty if successful). |
Error Response (422 Unprocessable Entity)
Returns validation error details when the request body is invalid.
{
"detail": [
{
"loc": [
"body",
"kbs"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}
Error Response Fields
| Field | Type | Description |
|---|---|---|
| detail | array | Array of validation error objects. |
| loc | array | Location of the error in the request (e.g., body field). |
| msg | string | Human-readable error message. |
| type | string | Error type identifier. |
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | Successful Response | Success |
| 400 | Bad Request - Invalid knowledge base data | Bad Request |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |
| 500 | Internal Server Error - Re-embedding failed | Server Error |