The kscli service group — create, configure, publish, copy, and delete retrieval and Q&A services
A retrieval service (also called an agent) is the retrieval entry point for Knowledge Bases. It holds the model, policy, and rerank settings, and you reference it with
Configuration changes follow a draft-then-publish flow:
Configuration changes apply to the beta draft only. Validate the draft with
List retrieval or Q&A services in the workspace.
Parameters
Output
The last line automatically suggests whether to consume the service with
Show service details including per-version configuration.
Parameters
Output
Both
Create a retrieval or Q&A service. It starts in
Parameters
Output
Update the service name, description, or draft configuration.
Parameters
Constraints
Publish the beta draft as a new version.
Parameters
Output
Delete a retrieval or Q&A service.
Parameters
Output
Copy a service into a new draft; the name gets a
Parameters
Output
--agent-id in the search and chat commands. Services come in two scenes: search (retrieval) and chat (Q&A). This group has 7 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.
Version model
Configuration changes follow a draft-then-publish flow:
| Status | Description |
|---|---|
draft | Newly created; only a beta draft exists and nothing is published yet |
deployed | At least one version is published; production calls use the latest published version |
edited | Published, then the beta draft was modified; production calls still use the published version |
deleted | Deleted |
search or chat plus --agent-version beta, then publish it with service deploy. Version numbers increment automatically.
kscli service list
List retrieval or Q&A services in the workspace.
| Parameter | Type | Required | Description |
|---|---|---|---|
--scene <chat|search> | string | Yes | Service scene, chat (Q&A) or search (retrieval) |
--status <status> | string | No | Filter by status, draft, deployed (includes edited), or deleted |
--name <text> | string | No | Fuzzy filter by service name |
--agent-id <id> | string | No | Filter by exact service ID |
--index-id <id> | string | No | Filter by linked Knowledge Base ID |
--page-number <n> | number | No | Page number, default 1 |
--page-size <n> | number | No | Items per page, default 10, range 1–100 |
search or chat, based on --scene.
quiet mode prints one service ID per line. json mode returns the full result.
--scene is required, so listing both scenes takes two calls.
Examples
kscli service get
Show service details including per-version configuration.
| Parameter | Type | Required | Description |
|---|---|---|---|
--agent-id <id> | string | Yes | Service ID |
--agent-version <version> | string | No | A specific version to inspect, beta or a published number. Omit for all versions |
quiet and json modes return the full JSON result.
Combined with --output json, this exports the current configuration so you can edit it and write it back with service update --config-file.
Examples
kscli service create
Create a retrieval or Q&A service. It starts in draft status with a beta version.
| Parameter | Type | Required | Description |
|---|---|---|---|
--name <text> | string | Yes | Service name, up to 200 chars, unique per scene in the workspace |
--scene <chat|search> | string | Yes | Service scene, chat (Q&A) or search (retrieval) |
--description <text> | string | No | Service description, up to 1000 chars |
--index-id <id> | string | No | Bind this Knowledge Base; other settings use server defaults |
quiet mode prints the service ID. json mode returns the full result.
Notes
- Without
--index-idthe service is created with default settings; you can bind a Knowledge Base later withservice update --config-file. - A new service has only a beta draft, so regular
searchandchatcalls cannot reach it until it is published — test it with--agent-version beta. - Requires Knowledge Base create permission in the workspace.
kscli service update
Update the service name, description, or draft configuration.
| Parameter | Type | Required | Description |
|---|---|---|---|
--agent-id <id> | string | Yes | Service ID |
--name <text> | string | No | New name, up to 200 chars |
--description <text> | string | No | New description, up to 1000 chars |
--agent-version <version> | string | No | Target version, defaults to the beta draft. Published versions accept --version-desc only |
--version-desc <text> | string | No | Version description |
--policy <policy> | string | No | Service policy, turbo (fast) or agentic (multi-turn) |
--model <name> | string | No | Generation model name, must be on the platform allowlist |
--temperature <n> | number | No | Sampling temperature, range 0–2 |
--max-llm-calls <n> | number | No | Maximum model calls per request, range 1–30 |
--enable-session-file <bool> | string | No | Enable session files, true or false |
--enable-refusal <bool> | string | No | Enable refusal answers, true or false |
--enable-anti-leak <bool> | string | No | Enable anti prompt-leak, true or false |
--enable-rich-text <bool> | string | No | Enable rich text output, true or false |
--enable-citation <bool> | string | No | Enable citations, true or false |
--config-file <path> | string | No | Replace the whole service configuration with a JSON file, which can set nested fields such as Knowledge Base bindings; mutually exclusive with the scalar config flags above |
- At least one update field is required, otherwise the command reports
Nothing to update --config-fileis mutually exclusive with the scalar config flags (--policy,--model,--temperature, and so on)- Published versions accept
--version-desconly, not configuration changes - Boolean flags accept only
trueorfalse
quiet mode prints nothing. json mode returns the full result.
Notes
- Configuration changes affect the beta draft only and do not reach production calls until
service deployruns. - When using scalar config flags, any setting you do not pass stays unchanged.
--config-filereplaces the configuration wholesale — fields absent from the JSON are reset to defaults. Export the current configuration withservice get --output jsonfirst and edit from there.
kscli service deploy
Publish the beta draft as a new version.
| Parameter | Type | Required | Description |
|---|---|---|---|
--agent-id <id> | string | Yes | Service ID |
--version-desc <text> | string | No | Description for the newly published version |
--yes | switch | No | Skip the confirmation prompt |
quiet mode prints the new version number. json mode returns the full result.
The version number increments automatically and the service status becomes deployed. Requires Knowledge Base update permission in the workspace.
Examples
kscli service delete
Delete a retrieval or Q&A service.
| Parameter | Type | Required | Description |
|---|---|---|---|
--agent-id <id> | string | Yes | Service ID |
--yes | switch | No | Skip the confirmation prompt |
quiet mode prints nothing. json mode returns the full result.
Deleting an already deleted service does not raise an error. Requires Knowledge Base delete permission in the workspace.
Examples
kscli service copy
Copy a service into a new draft; the name gets a copy_ prefix.
| Parameter | Type | Required | Description |
|---|---|---|---|
--agent-id <id> | string | Yes | Source service ID |
quiet mode prints the new service ID. json mode returns the full result.
The copy starts as a draft with a beta version, and needs service deploy before it affects production calls. This is the safe way to experiment with a new configuration without touching a live service. Requires Knowledge Base create permission in the workspace.
Examples