Skip to main content

Python SDK Reference

MilvusClient provides a simple and easy-to-use alternative to the legacy ORM approach. It adopts a purely functional approach to simplify interactions with the server. Each MilvusClient establishes a gRPC connection to the server you specified. To set up multiple connections, you can create multiple MilvusClient instances.

Install & Update

You can run the following command in your terminal to install the latest PyMilvus or update your PyMilvus to this version.

pip install --upgrade pymilvus==v2.3.7

After the installation, you can check the pymilvus version by running the following

from pymilvus import __version__

print(__version__)

# v2.3.7

Connect to Cluster

from pymilvus import MilvusClient

# Authentication enabled with a cluster user
client = MilvusClient(
uri="https://inxx-xxxxxxxxxxxx.api.gcp-us-west1.zillizcloud.com:19530",
token="user:password", # replace this with your token
)

What's New

In this version, PyMilvus adds a MilvusClient module that incorporates several functional methods, aligning its functionality overall with that of the legacy ORM module.

Examples

In addition to the documents, you can also refer to the example sets in our GitHub repo.