Connect Milvus
Milvus is an external vector database suited to organizations that already operate Milvus or need a separately managed cluster. Source files remain in SpaceBuilder; Milvus stores vectors and the minimum payload required for retrieval.
Before you begin
- Required role: Workspace administrator and permission to create a Milvus collection
- The SpaceBuilder server must reach the Milvus endpoint.
- Confirm the output dimension of the embedding model.
- SetFN uses the Milvus REST v2 API on port
19530, so use a compatible Milvus release.
Prepare Milvus
Milvus provides an official Docker Compose installation for standalone deployments. The standard configuration exposes Milvus on 19530 and its WebUI on 9091.
After starting the service, verify health:
curl http://localhost:9091/healthz
Open http://<milvus-host>:9091/webui/ to inspect service and collection state on supported versions. Restrict ports 19530 and 9091 to trusted networks.
When authentication is enabled, configure a dedicated credential for SetFN. Milvus tokens use the username:password form. If both a token and username/password are entered in SetFN, the token is used.
Create the collection first
Unlike the Qdrant integration, SetFN does not create a Milvus collection. Create it before saving the connection.
| Field | Type and requirement |
|---|---|
id | VARCHAR(64), primary key |
instance_namespace | VARCHAR(64) |
generation_id | VARCHAR(64) |
chunk_id | INT64 |
space_flag | VARCHAR(16) |
owner_id | VARCHAR(64) |
source_path | VARCHAR, recommended max_length 4096 |
text | VARCHAR, recommended max_length 16384 |
vector | FLOAT_VECTOR; dim must match the embedding model |
The vector index must use the COSINE metric. AUTOINDEX is supported by Milvus, as described in the official collection guide. Disable dynamic fields for the SetFN collection.
The following example uses the REST v2 API. Replace the endpoint, token, collection name, and vector dimension.
curl -X POST "http://<milvus-host>:19530/v2/vectordb/collections/create" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <username>:<password>" \
-d '{
"collectionName": "setfn_knowledge_example",
"schema": {
"autoId": false,
"enableDynamicField": false,
"fields": [
{ "fieldName": "id", "dataType": "VarChar", "isPrimary": true, "elementTypeParams": { "max_length": 64 } },
{ "fieldName": "instance_namespace", "dataType": "VarChar", "elementTypeParams": { "max_length": 64 } },
{ "fieldName": "generation_id", "dataType": "VarChar", "elementTypeParams": { "max_length": 64 } },
{ "fieldName": "chunk_id", "dataType": "Int64" },
{ "fieldName": "space_flag", "dataType": "VarChar", "elementTypeParams": { "max_length": 16 } },
{ "fieldName": "owner_id", "dataType": "VarChar", "elementTypeParams": { "max_length": 64 } },
{ "fieldName": "source_path", "dataType": "VarChar", "elementTypeParams": { "max_length": 4096 } },
{ "fieldName": "text", "dataType": "VarChar", "elementTypeParams": { "max_length": 16384 } },
{ "fieldName": "vector", "dataType": "FloatVector", "elementTypeParams": { "dim": 1024 } }
]
},
"indexParams": [
{ "fieldName": "vector", "indexName": "vector", "metricType": "COSINE", "params": { "index_type": "AUTOINDEX" } }
]
}'
Remove the Authorization header only when authentication is disabled.
Configure the SetFN connection
- Open
Knowledge Services>Knowledge Storage. - Select
Milvusas the driver. - Enter the endpoint, such as
http://milvus.internal:19530. - Enter the collection name and credentials.
- Set the vector dimension to the collection's
dim. - Select
Save.
Saving a changed store queues a full reindex when required.
Verify the connection
| State | Meaning and action |
|---|---|
| Connected; dimension and metric match | The collection is ready. |
| Collection missing | Create the collection or correct its name. |
| Dimension mismatch | Create or select a collection whose dim matches the embedding model. |
| Metric must be COSINE | Recreate the vector index with COSINE. |
The entity count increases as indexing writes vectors. It counts only data owned by this SpaceBuilder installation; collection count covers the entire Milvus service.