Protobox

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: true

Enable or disable Knowledge Base for the workspace.

maxDocumentsnumberdefault: 1000

Maximum number of documents allowed.

retentionDaysnumberdefault: 365

Auto-delete documents after N days. Use 0 for no expiration.

maxFileSizenumberdefault: 10485760

Maximum file size in bytes (default 10MB).

allowedFileTypesarray

List of allowed MIME types for uploads.

ingestionobject

Ingestion settings.

ingestion properties
ingestion.chunkSizenumberdefault: 1000

Target chunk size in tokens.

ingestion.chunkOverlapnumberdefault: 200

Overlap between chunks in tokens.

ingestion.autoEmbedbooleandefault: true

Automatically generate embeddings on upload.

searchobject

Search default settings.

search properties
search.defaultModestringdefault: hybrid

Default search mode: hybrid, vector, or text.

search.defaultLimitnumberdefault: 20

Default number of results.

search.minScorenumberdefault: 0.7

Default 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

FieldTypeDescription
totalDocumentsnumberTotal knowledge entries
totalChunksnumberTotal indexed chunks
storageBytesnumberTotal storage used
bySourceobjectCount by source type
byFolderarrayCount by folder
recentActivityobjectLast 24h activity

On this page