> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/milvus.md).

# Milvus

Manage Milvus collections, indexes, partitions, and aliases, upsert and search vector embeddings, and administer RBAC users and roles.

### Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector                     | Authentication |
| ----------------------------- | -------------- |
| Milvus                        | Password       |
| Milvus (Zilliz Cloud API Key) | API Key        |

#### Milvus

Connect to a self-hosted or BYOC Milvus instance with a username and password to manage collections and run vector search.

**Set up in Milvus**

1. Prepare the Milvus account or service that the workflow will access. Grant access to the required resources and operations.
2. Create or obtain the API credential identified in the fields below. Use the provider instructions linked with those fields to find its key-management page.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **Milvus**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field | Required | What to enter                                                                                                |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| Server URL    | Yes      | HTTPS base URL of your Milvus instance, including the port if it is not 443. Milvus must be served over TLS. |
| Username      | Yes      | A Milvus user with RBAC privileges for the operations you plan to run.                                       |
| Password      | Yes      | Password for the Milvus user above.                                                                          |

#### Milvus (Zilliz Cloud API Key)

Connect to a Zilliz Cloud cluster using its endpoint and an issued API key, instead of a self-hosted username and password.

**Set up in Milvus**

1. Prepare the Milvus account or service that the workflow will access. Grant access to the required resources and operations.
2. **Cluster Endpoint:** Your Zilliz Cloud cluster's public endpoint, from the cluster details page.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **Milvus (Zilliz Cloud API Key)**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field    | Required | What to enter                                                                                                                                          |
| ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Cluster Endpoint | Yes      | Your Zilliz Cloud cluster's public endpoint, from the cluster details page. [Provider instructions](https://docs.zilliz.com/docs/cluster-credentials). |
| API Key          | Yes      | A Zilliz Cloud API key with access to this cluster. [Provider instructions](https://docs.zilliz.com/docs/manage-api-keys).                             |

#### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

### Use an action

1. Add the required **Milvus** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

### Actions

#### Create Collection

Create a collection.

**Inputs**

| Field                  | Type            | Required | Description                                                                                                                                       |
| ---------------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| Collection Name        | string          | Yes      | Name for the new collection.                                                                                                                      |
| Vector Dimension       | integer         | Yes      | The size of the embedding vectors you'll store (must match your embedding model's output size).                                                   |
| Similarity Metric      | select (string) | No       | How similarity between vectors is measured. Cosine is the standard choice for text embeddings. Available values: L2, IP, COSINE. Default: COSINE. |
| Auto-Generate IDs      | boolean         | No       | Let Milvus assign a unique ID to each record automatically. Default: false.                                                                       |
| Primary Key Field Name | string          | No       | Name of the primary key field. Default: id.                                                                                                       |
| Vector Field Name      | string          | No       | Name of the field that stores the embedding vector. Default: vector.                                                                              |
| Database               | string          | No       | Target database, if you use multiple databases in this instance.                                                                                  |

**Outputs**

| Field           | Type    | Description                                      |
| --------------- | ------- | ------------------------------------------------ |
| Collection Name | string  | Name of the created collection.                  |
| Created         | boolean | Whether the collection was created successfully. |

#### Insert Entities

Insert new entities without replacing existing primary keys.

**Inputs**

| Field          | Type            | Required | Description                                                                   |
| -------------- | --------------- | -------- | ----------------------------------------------------------------------------- |
| Collection     | select (string) | Yes      | Collection to insert records into. Options load from the selected connection. |
| Partition      | select (string) | No       | Optional target partition. Options load from the selected connection.         |
| Records (JSON) | textarea        | Yes      | JSON array of entities matching the collection schema.                        |

**Outputs**

| Field            | Type    | Description                                                         |
| ---------------- | ------- | ------------------------------------------------------------------- |
| Records Inserted | integer | Number of entities inserted.                                        |
| Inserted IDs     | array   | Primary-key values returned by Milvus, including generated AutoIDs. |

#### Insert or Update Vectors

Insert or update vectors by ID.

**Inputs**

| Field          | Type            | Required | Description                                                                                                                     |
| -------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------- |
| Collection     | select (string) | Yes      | Collection to write records into. Options load from the selected connection.                                                    |
| Partition      | select (string) | No       | Optional partition to write into, if you use partitions to organize this collection. Options load from the selected connection. |
| Records (JSON) | textarea        | Yes      | The records to write, as a JSON array of objects with your vector field and metadata fields.                                    |

**Outputs**

| Field           | Type    | Description                                |
| --------------- | ------- | ------------------------------------------ |
| Records Written | integer | Number of records written.                 |
| Record IDs      | array   | Primary key values of the written records. |

#### Search Similar Vectors

Search vectors.

**Inputs**

| Field               | Type            | Required | Description                                                                                                   |
| ------------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
| Collection          | select (string) | Yes      | Collection to search. Options load from the selected connection.                                              |
| Query Vector (JSON) | textarea        | Yes      | The embedding vector to search for, as a JSON array of numbers.                                               |
| Number of Results   | integer         | No       | How many closest matches to return. Default: 10.                                                              |
| Filter Expression   | string          | No       | Optional condition to narrow the search, e.g. only records in a category.                                     |
| Fields to Return    | string          | No       | Comma-separated metadata fields to include in results, besides ID and distance.                               |
| Vector Field        | select (string) | No       | Which vector field to search, if the collection has more than one. Options load from the selected connection. |
| Partitions          | string          | No       | Restrict the search to specific partitions.                                                                   |

**Outputs**

| Field   | Type          | Description                                                     |
| ------- | ------------- | --------------------------------------------------------------- |
| Results | object\_array | Matching records with similarity distance and requested fields. |
| Count   | integer       | Number of matches returned.                                     |

#### Hybrid Search

Search multiple vector fields and rerank the combined results.

**Inputs**

| Field            | Type            | Required | Description                                                             |
| ---------------- | --------------- | -------- | ----------------------------------------------------------------------- |
| Collection       | select (string) | Yes      | Loaded collection to search. Options load from the selected connection. |
| Searches (JSON)  | textarea        | Yes      | At least two vector-field search objects to combine.                    |
| Rerank (JSON)    | textarea        | Yes      | Milvus reranking strategy and its parameters.                           |
| Max Results      | integer         | No       | Maximum reranked entities to return. Default: 100.                      |
| Fields to Return | string          | No       | Optional comma-separated scalar fields.                                 |
| Partitions       | string          | No       | Optional comma-separated partitions.                                    |

**Outputs**

| Field   | Type          | Description        |
| ------- | ------------- | ------------------ |
| Results | object\_array | Reranked entities. |

#### Get Records by Filter

Fetch records by filter or ID.

**Inputs**

| Field             | Type            | Required | Description                                                                      |
| ----------------- | --------------- | -------- | -------------------------------------------------------------------------------- |
| Collection        | select (string) | Yes      | Collection to read from. Options load from the selected connection.              |
| Filter Expression | string          | Yes      | Condition selecting which records to return, e.g. an ID list or attribute match. |
| Fields to Return  | string          | No       | Comma-separated fields to include in each result.                                |
| Max Records       | integer         | No       | Cap on how many records to return per call. Default: 100.                        |
| Offset            | integer         | No       | Number of matching records to skip, for fetching the next page. Default: 0.      |
| Partitions        | string          | No       | Restrict the query to specific partitions.                                       |

**Outputs**

| Field       | Type          | Description                                                                 |
| ----------- | ------------- | --------------------------------------------------------------------------- |
| Records     | object\_array | Matching records.                                                           |
| Next Offset | integer       | Offset to use for the next page, if you expect more matches.                |
| Truncated   | boolean       | Whether more matching records may exist beyond the provider offset ceiling. |

#### Delete Records

Delete records.

**Inputs**

| Field             | Type            | Required | Description                                                                    |
| ----------------- | --------------- | -------- | ------------------------------------------------------------------------------ |
| Collection        | select (string) | Yes      | Collection to delete from. Options load from the selected connection.          |
| Filter Expression | string          | Yes      | Which records to delete, e.g. a list of IDs or an attribute condition.         |
| Partition         | select (string) | No       | Restrict deletion to one partition. Options load from the selected connection. |

**Outputs**

| Field   | Type    | Description                           |
| ------- | ------- | ------------------------------------- |
| Deleted | boolean | Whether the delete request succeeded. |

#### Manage Partition

Create, load, release, or drop a partition.

**Inputs**

| Field          | Type            | Required | Description                                                                     |
| -------------- | --------------- | -------- | ------------------------------------------------------------------------------- |
| Collection     | select (string) | Yes      | Collection the partition belongs to. Options load from the selected connection. |
| Action         | select (string) | Yes      | What to do with the partition. Available values: Create, Load, Release, Drop.   |
| Partition Name | select (string) | Yes      | Name of the partition. Options load from the selected connection.               |

**Outputs**

| Field          | Type    | Description                      |
| -------------- | ------- | -------------------------------- |
| Partition Name | string  | Name of the affected partition.  |
| Success        | boolean | Whether the operation succeeded. |

#### Manage Index

Create or drop a vector index.

**Inputs**

| Field               | Type            | Required | Description                                                                                                                                 |
| ------------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Collection          | select (string) | Yes      | Collection to index. Options load from the selected connection.                                                                             |
| Action              | select (string) | Yes      | Build a new index or remove an existing one. Available values: Create, Drop.                                                                |
| Field               | select (string) | Yes      | Field to index, usually the vector field. Options load from the selected connection.                                                        |
| Index Name          | string          | No       | Optional custom name for the index.                                                                                                         |
| Index Type          | select (string) | No       | Indexing algorithm; AUTOINDEX lets Milvus choose good defaults. Available values: AUTOINDEX, HNSW, IVF\_FLAT, IVF\_SQ8. Default: AUTOINDEX. |
| Similarity Metric   | select (string) | No       | Distance metric the index optimizes for; should match how you search. Available values: L2, IP, COSINE. Default: COSINE.                    |
| Index Params (JSON) | string          | No       | Algorithm build settings. Required for HNSW (M, efConstruction) and IVF\_FLAT/IVF\_SQ8 (nlist); leave blank for AUTOINDEX.                  |

**Outputs**

| Field        | Type    | Description                       |
| ------------ | ------- | --------------------------------- |
| Index Name   | string  | Name of the affected index.       |
| Index State  | string  | Current build state of the index. |
| Indexed Rows | integer | Number of rows indexed so far.    |

#### Load or Release Collection

Load a collection into memory, or release it.

**Inputs**

| Field      | Type            | Required | Description                                                               |
| ---------- | --------------- | -------- | ------------------------------------------------------------------------- |
| Collection | select (string) | Yes      | Collection to load or release. Options load from the selected connection. |
| Action     | select (string) | Yes      | Load into memory or release from memory. Available values: Load, Release. |

**Outputs**

| Field           | Type   | Description                      |
| --------------- | ------ | -------------------------------- |
| Collection Name | string | Name of the affected collection. |
| Load State      | string | Resulting load state.            |

#### Get Collection Info

Get collection info.

**Inputs**

| Field      | Type            | Required | Description                                                       |
| ---------- | --------------- | -------- | ----------------------------------------------------------------- |
| Collection | select (string) | Yes      | Collection to inspect. Options load from the selected connection. |

**Outputs**

| Field      | Type    | Description                                             |
| ---------- | ------- | ------------------------------------------------------- |
| Exists     | boolean | Whether the collection exists.                          |
| Row Count  | integer | Number of records currently stored.                     |
| Load State | string  | Whether the collection is currently loaded into memory. |
| Schema     | object  | Field names, types, and index info.                     |
| Aliases    | string  | Alias names pointing to this collection.                |

#### Manage Collection Alias

Point an alias at a collection, or remove it.

**Inputs**

| Field      | Type            | Required | Description                                                                                                 |
| ---------- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------- |
| Action     | select (string) | Yes      | Point the alias at a collection, or remove it. Available values: Point, Remove.                             |
| Alias Name | string          | Yes      | The stable name clients will query.                                                                         |
| Collection | select (string) | No       | Collection the alias should point to (required unless removing). Options load from the selected connection. |
| Database   | string          | No       | Database the alias lives in, if not the default.                                                            |

**Outputs**

| Field           | Type   | Description                         |
| --------------- | ------ | ----------------------------------- |
| Alias Name      | string | Name of the affected alias.         |
| Collection Name | string | Collection the alias now points to. |

#### Manage User

Create a user, change a password, or grant/revoke a role.

**Inputs**

| Field        | Type            | Required | Description                                                                                   |
| ------------ | --------------- | -------- | --------------------------------------------------------------------------------------------- |
| Action       | select (string) | Yes      | What to do with the user. Available values: Create, Update Password, Grant Role, Revoke Role. |
| Username     | string          | Yes      | The user's login name.                                                                        |
| Password     | secret          | No       | Password for a new user, or the current password when changing it.                            |
| New Password | secret          | No       | The replacement password.                                                                     |
| Role         | select (string) | No       | Role to grant or revoke. Options load from the selected connection.                           |

**Outputs**

| Field    | Type    | Description                      |
| -------- | ------- | -------------------------------- |
| Username | string  | Affected user.                   |
| Success  | boolean | Whether the operation succeeded. |

#### Manage Role & Privileges

Create or remove a role, or grant/revoke a privilege.

**Inputs**

| Field         | Type            | Required | Description                                                                                            |
| ------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| Action        | select (string) | Yes      | What to do with the role. Available values: Create Role, Drop Role, Grant Privilege, Revoke Privilege. |
| Role Name     | select (string) | Yes      | Name of the role. Options load from the selected connection.                                           |
| Privilege     | select (string) | No       | The specific permission to grant or revoke. Options load from the selected connection.                 |
| Resource Type | select (string) | No       | What kind of resource the privilege applies to. Available values: Global, Collection, User.            |
| Resource Name | string          | No       | Name of the specific resource, or \* for all.                                                          |

**Outputs**

| Field     | Type    | Description                      |
| --------- | ------- | -------------------------------- |
| Role Name | string  | Affected role.                   |
| Success   | boolean | Whether the operation succeeded. |

### Triggers

A trigger starts a workflow when its configured event occurs. Configure the event and filters before enabling the trigger.

#### New or Updated Records

Polls a collection for records whose strictly increasing cursor field changed after the last check. Updates require an updated\_at-style field that is rewritten to a greater value on every update.

Pick the **Collection** to watch and a **Cursor Field** whose value strictly increases whenever a record should trigger. Use an insert-only ID for new records, or an `updated_at` timestamp that is rewritten to a greater value on every update. Records whose cursor value does not increase cannot be detected as updates. Every poll fetches records where that field is greater than the highest value seen so far. Optionally add an **Additional Filter** to further narrow which records trigger this.

**Configuration**

| Field             | Type            | Required | Description                                                                                                                                                                                       |
| ----------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Collection        | select (string) | Yes      | Collection to watch. Options load from the selected connection.                                                                                                                                   |
| Cursor Field      | select (string) | Yes      | A field whose value increases whenever a record should trigger (for example, an insert-only ID or an updated\_at timestamp rewritten on every update). Options load from the selected connection. |
| Additional Filter | string          | No       | Optional extra condition to further narrow which records trigger this.                                                                                                                            |

**Event inputs**

| Field               | Type   | Required | Description                                                            |
| ------------------- | ------ | -------- | ---------------------------------------------------------------------- |
| Record              | dict   | Yes      | A new or updated record found this poll.                               |
| Latest Cursor Value | string | Yes      | The highest cursor field value seen, used to resume polling next time. |

**Outputs**

| Field               | Type   | Description                                                            |
| ------------------- | ------ | ---------------------------------------------------------------------- |
| Record              | dict   | A new or updated record found this poll.                               |
| Latest Cursor Value | string | The highest cursor field value seen, used to resume polling next time. |

#### Index Build Completed

Polls an index's build status and fires once it finishes building.

Select the collection and index to watch. This trigger fires once the index's build state reaches Finished.

**Configuration**

| Field      | Type            | Required | Description                                                                 |
| ---------- | --------------- | -------- | --------------------------------------------------------------------------- |
| Collection | select (string) | Yes      | Collection the index belongs to. Options load from the selected connection. |
| Index      | select (string) | Yes      | Index to watch. Options load from the selected connection.                  |

**Event inputs**

| Field        | Type    | Required | Description                                               |
| ------------ | ------- | -------- | --------------------------------------------------------- |
| Index Name   | string  | Yes      | Name of the completed index.                              |
| Index State  | string  | Yes      | Resulting state, expected to be Finished when this fires. |
| Indexed Rows | integer | No       | Total rows indexed.                                       |

**Outputs**

| Field        | Type    | Description                                               |
| ------------ | ------- | --------------------------------------------------------- |
| Index Name   | string  | Name of the completed index.                              |
| Index State  | string  | Resulting state, expected to be Finished when this fires. |
| Indexed Rows | integer | Total rows indexed.                                       |

### Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/integrations/catalog/milvus.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
