Classify knowledge base chunks
POST /knowledge-bases/{knowledgeBaseId}/classify
Classify chunks using custom schemas beyond binary relevance. Supports tri-state classification (supporting/contradicting/neutral), built-in presets, and custom user-defined schemas.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”ID of the knowledge base
ID of the knowledge base
Request Body
Section titled “Request Body ”object
Chunks to classify directly (alternative to query)
object
Unique identifier for the chunk
Text content of the chunk
Query to fetch chunks (alternative to providing chunks)
Options for fetching chunks via query
object
Maximum number of chunks to fetch via query
Embedding model to use for query (defaults to primary)
Use a built-in classification preset
Simple classification labels (e.g., [‘supporting’, ‘contradicting’, ‘neutral’])
Detailed label definitions with natural language guidance
object
Custom JSON Schema for advanced classification (power users)
object
Classification behavior options
object
Additional context to help the LLM classify chunks accurately
Number of chunks to classify per LLM call (default: 5)
Responses
Section titled “ Responses ”Classification complete
object
Classification results for each chunk
object
object
Metadata about the classification operation
object
Bad Request - Validation error or invalid input
object
Unauthorized - Authentication required or invalid token
object
Forbidden - Insufficient permissions
object
Not Found - Resource does not exist