The kscli kb group — create, inspect, update, delete Knowledge Bases and query metrics
A Knowledge Base stores the indexed content produced by parsing documents and is the data carrier for retrieval. This group has 6 commands.
Shared conventions for authentication, workspace ID, global flags, output formats, confirmation prompts, and dry-run mode are covered in the CLI overview. The examples below assume the workspace ID is already set in the config file, so
List Knowledge Bases in the workspace.
Parameters
Output
Show Knowledge Base configuration details.
Parameters
Output
Create a Knowledge Base and import data center files or categories.
Parameters
Update the Knowledge Base name, description, or rerank score threshold.
Parameters
At least one of
Delete a Knowledge Base along with all its documents and chunks.
Parameters
Output
Source files in the data center are unaffected; only the Knowledge Base index is removed. To delete source files, use
Show storage usage and QPS metrics for a Knowledge Base.
Parameters
Output
Both
--workspace-id is omitted.
kscli kb list
List Knowledge Bases in the workspace.
| Parameter | Type | Required | Description |
|---|---|---|---|
--name <text> | string | No | Fuzzy filter by Knowledge Base name, 1–20 chars |
--page-number <n> | number | No | Page number, default 1 |
--page-size <n> | number | No | Items per page, default 20, range 1–100 |
text mode prints one Knowledge Base per line with fields separated by double spaces, followed by the total:
quiet mode prints one Knowledge Base ID per line. json mode returns the full result, with the list under data.rows.
The ID in the output is what you pass as --index-id to later commands.
Examples
kscli kb info
Show Knowledge Base configuration details.
| Parameter | Type | Required | Description |
|---|---|---|---|
--index-id <id> | string | Yes | Knowledge Base ID |
text mode groups the settings by dimension:
quiet mode prints the Knowledge Base ID. json mode returns the full configuration.
Examples
kscli kb create
Create a Knowledge Base and import data center files or categories.
| Parameter | Type | Required | Description |
|---|---|---|---|
--name <text> | string | Yes | Knowledge Base name, 1–20 chars, unique in the workspace |
--doc-id <id> | array | One of two | Data center file ID, repeatable; mutually exclusive with --category-id |
--category-id <id> | array | One of two | Import every file under this category, repeatable; mutually exclusive with --doc-id |
--embedding-model <name> | string | No | Embedding model name, default text-embedding-v4 |
--chunk-size <n> | number | No | Chunk size in characters, default 600, recommended 300–800 |
--wait | switch | No | Poll the initial import job to a terminal state |
--poll-interval <seconds> | number | No | Polling interval in seconds, default 5 |
--doc-id and --category-id are mutually exclusive; exactly one is required.
Output
quiet mode prints only the Knowledge Base ID. json mode returns the Knowledge Base ID and import job ID, plus a final_status field when --wait is used.
Notes
- The created Knowledge Base is document-type (unstructured).
- Use the returned
ingestion_idwithkscli doc statusto track import progress, or pass--waitto block until it finishes. - With
--wait, if some documents fail to parse the command exits non-zero, but the Knowledge Base itself was created successfully — the error message names the failed documents.
kscli kb update
Update the Knowledge Base name, description, or rerank score threshold.
| Parameter | Type | Required | Description |
|---|---|---|---|
--index-id <id> | string | Yes | Knowledge Base ID |
--name <text> | string | No | New name, 1–20 chars |
--description <text> | string | No | New description |
--rerank-min-score <score> | number | No | Rerank minimum score threshold, range 0–1; chunks below it are filtered out |
--name, --description, or --rerank-min-score is required, otherwise the command reports Nothing to update.
Output
quiet mode prints nothing. json mode returns the full result.
Examples
kscli kb delete
Delete a Knowledge Base along with all its documents and chunks.
| Parameter | Type | Required | Description |
|---|---|---|---|
--index-id <id> | string | Yes | Knowledge Base ID |
--yes | switch | No | Skip the confirmation prompt |
kscli file delete.
Examples
kscli kb stats
Show storage usage and QPS metrics for a Knowledge Base.
| Parameter | Type | Required | Description |
|---|---|---|---|
--index-id <id> | string | Yes | Knowledge Base ID |
--start <time> | string | No | Range start, Unix seconds or ISO date, must be in the past, default 24 hours ago |
--end <time> | string | No | Range end, Unix seconds or ISO date, must be in the past, default now |
quiet and json modes return the full storage and QPS monitoring data.
--start and --end accept both Unix second timestamps and ISO dates (such as 2026-07-30); millisecond timestamps are handled automatically.
Examples