data
Milvus CLI for AI Agents
Use the Milvus CLI from KosmoKrator to call Milvus tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Milvus CLI Setup
Milvus can be configured headlessly with `kosmokrator integrations:configure milvus`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure milvus --set api_key="$MILVUS_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor milvus --json
kosmokrator integrations:status --json Credentials
Authentication type: API key api_key. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_key | MILVUS_API_KEY | Secret secret | yes | API Key |
url | MILVUS_URL | URL url | no | Milvus API URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call milvus.milvus_list_collections '{"limit":1,"offset":1}' --json kosmo integrations:milvus milvus_list_collections '{"limit":1,"offset":1}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs milvus --json
kosmo integrations:docs milvus.milvus_list_collections --json
kosmo integrations:schema milvus.milvus_list_collections --json
kosmo integrations:search "Milvus" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
milvus.milvus_list_collections
List all vector collections in Milvus. Returns collection names and details that can be used for further operations.
read - Parameters
- limit, offset
kosmo integrations:call milvus.milvus_list_collections '{"limit":1,"offset":1}' --json kosmo integrations:milvus milvus_list_collections '{"limit":1,"offset":1}' --json milvus.milvus_get_collection
Get details of a specific Milvus collection by its name, including schema and description.
read - Parameters
- collection_name
kosmo integrations:call milvus.milvus_get_collection '{"collection_name":"example_collection_name"}' --json kosmo integrations:milvus milvus_get_collection '{"collection_name":"example_collection_name"}' --json milvus.milvus_create_collection
Create a new vector collection in Milvus. A collection requires a name and the embedding dimension size.
write - Parameters
- name, dimension, description, params
kosmo integrations:call milvus.milvus_create_collection '{"name":"example_name","dimension":1,"description":"example_description","params":"example_params"}' --json kosmo integrations:milvus milvus_create_collection '{"name":"example_name","dimension":1,"description":"example_description","params":"example_params"}' --json milvus.milvus_insert_documents
Insert documents with embedding vectors into a Milvus collection. Each document requires a vector and an optional ID.
write - Parameters
- collection_name, data
kosmo integrations:call milvus.milvus_insert_documents '{"collection_name":"example_collection_name","data":"example_data"}' --json kosmo integrations:milvus milvus_insert_documents '{"collection_name":"example_collection_name","data":"example_data"}' --json milvus.milvus_search_documents
Search for similar documents in a Milvus collection using a query vector. Returns the most similar documents ranked by distance or similarity.
read - Parameters
- collection_name, vector, limit, output_fields, filter
kosmo integrations:call milvus.milvus_search_documents '{"collection_name":"example_collection_name","vector":"example_vector","limit":1,"output_fields":"example_output_fields","filter":"example_filter"}' --json kosmo integrations:milvus milvus_search_documents '{"collection_name":"example_collection_name","vector":"example_vector","limit":1,"output_fields":"example_output_fields","filter":"example_filter"}' --json milvus.milvus_get_collection_stats
Get statistics for a Milvus collection, including row count and index information.
read - Parameters
- collection_name
kosmo integrations:call milvus.milvus_get_collection_stats '{"collection_name":"example_collection_name"}' --json kosmo integrations:milvus milvus_get_collection_stats '{"collection_name":"example_collection_name"}' --json milvus.milvus_get_health
Check the health status of the Milvus vector database server. Returns health and version information.
read - Parameters
- none
kosmo integrations:call milvus.milvus_get_health '{}' --json kosmo integrations:milvus milvus_get_health '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
milvus.milvus_list_collections 2 parameters
kosmo integrations:schema milvus.milvus_list_collections --json | Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of collections to return (default: 100). |
offset | integer | no | Number of collections to skip for pagination. |
milvus.milvus_get_collection 1 parameters
kosmo integrations:schema milvus.milvus_get_collection --json | Parameter | Type | Required | Description |
|---|---|---|---|
collection_name | string | yes | The name of the collection. |
milvus.milvus_create_collection 4 parameters
kosmo integrations:schema milvus.milvus_create_collection --json | Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | The name of the collection to create. |
dimension | integer | yes | The dimension of the embedding vectors to be stored in this collection. |
description | string | no | An optional description of the collection. |
params | object | no | Optional collection parameters such as index type and metric type (JSON object). |
milvus.milvus_insert_documents 2 parameters
kosmo integrations:schema milvus.milvus_insert_documents --json | Parameter | Type | Required | Description |
|---|---|---|---|
collection_name | string | yes | The name of the collection to insert into. |
data | array | yes | Array of document objects. Each object should contain a "vector" field (array of floats) and optional "id", "color", or other scalar fields. |
milvus.milvus_search_documents 5 parameters
kosmo integrations:schema milvus.milvus_search_documents --json | Parameter | Type | Required | Description |
|---|---|---|---|
collection_name | string | yes | The name of the collection to search. |
vector | array | yes | The query embedding vector (array of floats). |
limit | integer | no | Maximum number of results to return (default: 10). |
output_fields | array | no | Fields to include in the response, e.g. ["id", "color", "text"]. |
filter | string | no | Filter expression for scalar fields, e.g. 'color == "red"'. |
milvus.milvus_get_collection_stats 1 parameters
kosmo integrations:schema milvus.milvus_get_collection_stats --json | Parameter | Type | Required | Description |
|---|---|---|---|
collection_name | string | yes | The name of the collection. |
milvus.milvus_get_health 0 parameters
kosmo integrations:schema milvus.milvus_get_health --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.