milvus-logo
LFAI
< Docs
  • Python

About PyMilvus

PyMilvus is a Python SDK of Milvus. Its source code is open-sourced and hosted on GitHub.

Since v2.3.7, you have the flexibility to choose MilvusClient or the original ORM module to talk with Milvus.

Compatibility

Milvus versionRecommended PyMilvus version
1.0.*1.0.1
1.1.*1.1.2
2.0.x2.0.2
2.1.x2.1.3
2.2.x2.2.3
2.3.02.3.7

Install & Update

You can run the following command 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 Milvus

from pymilvus import MilvusClient

# Authentication not enabled
client = MilvusClient("http://localhost:19530")

# Authentication enabled with the root user
client = MilvusClient(
    uri="http://localhost:19530",
    token="root:Milvus",
    db_name="default"
)

# Authentication enabled with a non-root user
client = MilvusClient(
    uri="http://localhost:19530",
    token="user:password", # replace this with your token
    db_name="default"
)

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.

Collection-related methods

Data-related methods

Alias-related methods

Partition-related methods

Index-related methods

User- and RBAC-related methods

Examples

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

Feedback & Issues

If you are having trouble or have questions about PyMilvus, ask your question on our PyMilvus Community Forum. Once you get an answer, it’d be great if you could work it back into this documentation and contribute!

Contributing

We are committed to building a collaborative, exuberant open-source community for PyMilvus. Therefore, contributions to PyMilvus are welcome from everyone. Refer to Contributing Guideline before making contributions to this project. You can file an issue or contact us on Slack if you need any assistance or want to propose your ideas about PyMilvus.