Quickstart
From nothing to a working vector search in a few minutes. Youβll allocate a database (control plane), then use the Milvus SDK for everything else (data plane).
Before you start
- A Dodil IAM service account (a
client_id+client_secret) and an access token from it β get one with the client-credentials flowΒ (ordodil login). That same token authenticates both the control plane and the Milvus connection; see Auth and Access. - The
dodilCLI (for the quickest path) β see Install the CLIΒ . Or call the control-plane API directly. pip install pymilvusfor the SDK steps.
1. Allocate a database
dodil vbase db create my-vectorsAllocation is asynchronous β the database starts in CREATING and becomes RUNNING within moments. (Over the API: AllocateDatabase then poll GetService until RUNNING.)
2. Get its connection details
dodil vbase db use <service-id>This resolves the databaseβs endpoint, port, and db_name (via GetServiceAccess) and stores them so the CLI β and you β can connect.
3. Connect the Milvus SDK
from pymilvus import MilvusClient
client = MilvusClient(
uri="https://<endpoint>:443", # endpoint + port from step 2
token="<IAM access token>", # your IAM token is your Milvus token
db_name="<db_name>", # the allocated database
)See Connecting with the Milvus SDK for the full contract (TLS, tokens, other languages).
4. Create a collection, index, and search
# create a collection with a 768-dim vector
client.create_collection(collection_name="docs", dimension=768)
# insert a few vectors
client.insert(collection_name="docs", data=[
{"id": 1, "vector": [0.1] * 768, "text": "hello"},
{"id": 2, "vector": [0.2] * 768, "text": "world"},
])
# search
hits = client.search(
collection_name="docs",
data=[[0.15] * 768],
limit=3,
output_fields=["text"],
)
print(hits)Thatβs standard Milvus 2.6 β collections, indexes, and search are all the Milvus SDK. For schemas, custom indexes (HNSW/IVF), hybrid + BM25 search, and more, see the Recipes and the Milvus docsΒ .
Next
- Core Concepts β databases, the two planes, what VBase manages
- Connecting with the Milvus SDK β the connection contract in depth
- Recipes β semantic search, hybrid search, bulk ingest