Configuration & Stats
Manage KB settings and view statistics
Configure Knowledge Base settings per workspace and view usage statistics.
Get Configuration
curl -X GET "https://platform.protobox.ai/api/v1/knowledge/config" \
-H "Authorization: Bearer <access_token>"Response
{
"success": true,
"data": {
"config": {
"enabled": true,
"maxDocuments": 1000,
"retentionDays": 365,
"maxFileSize": 10485760,
"allowedFileTypes": [
"text/plain",
"text/markdown",
"text/html",
"application/pdf"
],
"ingestion": {
"chunkSize": 1000,
"chunkOverlap": 200,
"autoEmbed": true
},
"search": {
"defaultMode": "hybrid",
"defaultLimit": 20,
"minScore": 0.7
},
"currentDocumentCount": 42
}
}
}Update Configuration
Request
curl -X PATCH "https://platform.protobox.ai/api/v1/knowledge/config" \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"maxDocuments": 2000,
"retentionDays": 180,
"ingestion": {
"chunkSize": 1200,
"chunkOverlap": 250
},
"search": {
"defaultMode": "hybrid",
"defaultLimit": 10,
"minScore": 0.6
}
}'const response = await fetch('https://platform.protobox.ai/api/v1/knowledge/config', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer ' + accessToken,
'Content-Type': 'application/json',
},
body: JSON.stringify({
maxDocuments: 2000,
search: {
defaultMode: 'hybrid',
minScore: 0.6
}
})
});
const { data } = await response.json();
console.log('Updated config:', data.config);Response
{
"success": true,
"data": {
"config": {
"enabled": true,
"maxDocuments": 2000,
"retentionDays": 180,
"maxFileSize": 10485760,
"allowedFileTypes": ["text/plain", "text/markdown", "text/html", "application/pdf"],
"ingestion": {
"chunkSize": 1200,
"chunkOverlap": 250,
"autoEmbed": true
},
"search": {
"defaultMode": "hybrid",
"defaultLimit": 10,
"minScore": 0.6
},
"currentDocumentCount": 42
}
}
}Configuration Options
enabledbooleandefault: trueEnable or disable Knowledge Base for the workspace.
maxDocumentsnumberdefault: 1000Maximum number of documents allowed.
retentionDaysnumberdefault: 365Auto-delete documents after N days. Use 0 for no expiration.
maxFileSizenumberdefault: 10485760Maximum file size in bytes (default 10MB).
allowedFileTypesarrayList of allowed MIME types for uploads.
ingestionobjectIngestion settings.
ingestion properties
ingestion.chunkSizenumberdefault: 1000Target chunk size in tokens.
ingestion.chunkOverlapnumberdefault: 200Overlap between chunks in tokens.
ingestion.autoEmbedbooleandefault: trueAutomatically generate embeddings on upload.
searchobjectSearch default settings.
search properties
search.defaultModestringdefault: hybridDefault search mode: hybrid, vector, or text.
search.defaultLimitnumberdefault: 20Default number of results.
search.minScorenumberdefault: 0.7Default minimum relevance score.
Get Statistics
curl -X GET "https://platform.protobox.ai/api/v1/knowledge/stats" \
-H "Authorization: Bearer <access_token>"Response
{
"success": true,
"data": {
"stats": {
"totalDocuments": 156,
"totalChunks": 1247,
"storageBytes": 47423488,
"bySource": {
"manual": 42,
"document": 68,
"webpage": 32,
"faq": 14
},
"byFolder": [
{ "folderId": "folder_abc123", "name": "Policies", "count": 24 },
{ "folderId": "folder_def456", "name": "Products", "count": 48 },
{ "folderId": null, "name": "(root)", "count": 84 }
],
"recentActivity": {
"documentsAdded24h": 5,
"documentsUpdated24h": 12,
"searchesLast24h": 234
}
}
}
}Statistics Fields
| Field | Type | Description |
|---|---|---|
totalDocuments | number | Total knowledge entries |
totalChunks | number | Total indexed chunks |
storageBytes | number | Total storage used |
bySource | object | Count by source type |
byFolder | array | Count by folder |
recentActivity | object | Last 24h activity |