C++ SDK Reference
The Milvus C++ SDK is the official C++ client for Milvus and Zilliz Cloud. It provides a native C++ API for managing collections, vectors, indexes, and database operations, with a fluent request-builder style.
Features
- Native C++ API — Fluent request-builder pattern with
Statusreturn values - Collection and vector management — Create, describe, load, and drop collections; manage schemas and indexes
- Data operations — Insert, upsert, delete, query, and search, including hybrid and sparse vector search
- Database and user management — RBAC, resource groups, aliases, and database administration
- Modern field types — Array, JSON, sparse, binary, float16/bfloat16, int8, and struct fields
- Milvus and Zilliz Cloud — Connect to both self-hosted Milvus and Zilliz Cloud instances via URI
Compatibility
The following table shows the recommended milvus-sdk-cpp versions for each Milvus version:
| Milvus version | Recommended SDK version |
|---|---|
| 2.3.x | 2.3 (branch) |
| 2.4.x | v2.4.1 |
| 2.5.x | v2.5.4 |
| 2.6.x | v2.6.6 |
| 3.0.x | v3.0.2 |
Installation
See the Development Guide for details on how to compile and install the SDK from source.
Quick Start
#include <milvus/MilvusClientV2.h>
using namespace milvus;
int main() {
auto client = MilvusClientV2::Create();
ConnectParam connect_param{"http://localhost:19530", "root:Milvus"};
auto status = client->Connect(connect_param);
if (!status.IsOk()) {
return 1;
}
// Create a simple collection with a primary field and a vector field
CreateSimpleCollectionRequest req;
req.WithCollectionName("my_collection")
.WithPrimaryFieldName("id")
.WithVectorFieldName("embedding")
.WithDimension(128);
status = client->CreateSimpleCollection(req);
client->Disconnect();
return 0;
}
Overview
The Milvus C++ SDK is the official C++ client for Milvus and Zilliz Cloud. It provides a native C++ API for managing collections, vectors, indexes, and database operations, with a fluent request-builder style.
Authentication
19 items
Client
13 items
Collections
37 items
Data Import
5 items
Database
6 items
File Resources
6 items
Management
22 items
Snapshots
9 items
Vector
10 items
Partitions
7 items
Examples
In addition to the documents, you can also refer to the example sets in our GitHub repository.