milvus-io/pymilvus
Python gRPC SDK for Milvus vector retrieval and collection management
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
PyMilvus is a Python client SDK, not the Milvus storage or search engine. Applications connect to a Milvus URI through MilvusClient for synchronous calls or AsyncMilvusClient for asyncio integration. In a server deployment, the application submits schema, data, and retrieval operations through the client; Milvus runs the database operations.
The protocol stack uses grpcio and protobuf, with orjson, pandas, and cachetools also declared as dependencies. Protocol bindings are generated from versioned milvus-proto definitions: the Git submodule supplies the definitions and make gen_proto regenerates the Python files. Packaging extras such as model and bulk_writer extend the install without turning the SDK into a backend abstraction.
Key Capabilities & Differentiators
The client covers vector retrieval and collection schema management, with recent releases adding more control over structured data. v3.0.3 extends Struct Arrays with nullable scalar and vector subfields and nested scalar arrays whose elements can be null. v3.0.4 adds Struct parent external_field mappings to both clients, including Struct templates and schema.add_field(...).
On the 2.6 line, v2.6.18 adds row-level security policy and principal-tag management, with rls_principal on supported reads and writes for server-side enforcement. Both clients can opt into gzip for outgoing gRPC messages; the server chooses its response encoding. Passing deflate raises ConnectionConfigException before the client connects.
Trade-offs & Limitations
PyMilvus is a strong fit when Milvus is already the chosen backend: its explicit schema and policy APIs expose Milvus-specific features, but those same interfaces make a backend change more than a connection-string swap. Compared with an in-process similarity library such as FAISS, a separate Milvus service adds a network boundary and another component to operate. A lighter in-process index may be sufficient if the application does not need server-managed schemas or data access policies.
The main operational constraint is compatibility: pin client and server together, and verify the specific APIs you use before upgrading either. Gzip is worth testing on representative payloads rather than enabling by default for assumed latency gains; it trades client CPU for potentially fewer outbound bytes. Remote SDK calls do not by themselves require a GPU on the Python host. Size the client, Milvus server, and any embedding runtime as separate workloads.
Hardware & Deployment Guide
For a current 3.0 deployment, use Python 3.9 or newer and pin PyMilvus alongside the server version. The release pairings are PyMilvus 3.0.4 with Milvus 3.0.7 and PyMilvus 3.0.3 with Milvus 3.0.6; PyMilvus 2.6.18 targets Milvus 2.6 and supports Python 3.8 or later. Install the SDK into the application environment and configure a reachable Milvus URI. Add the model or bulk_writer extra only if needed.
The root Dockerfile uses python:3.6-slim, pins pymilvus==2.0.0, and starts python. It is neither a current 3.x client image nor a Milvus server image. If deploying in containers, build the application image on a supported Python base and deploy Milvus separately. For SDK development, the maintained test commands use uv, make unittest, and make integration-lite; the Lite test target is not a production deployment recipe.
MilvusClient and AsyncMilvusClient provide synchronous and asynchronous entry points to Milvus.grpc_compression="gzip" for outgoing messages and reject deflate before connecting.external_field mappings.rls_principal on supported operations.model and bulk_writer extras.python, not a Milvus server.Python RAG, semantic search, and similar retrieval services that already use Milvus and need synchronous or asynchronous access, explicit collection schemas, and version-matched integrations.
You need a standalone local index, a complete RAG pipeline, or one client that works across multiple vector databases.
Quick Start & Installation
$ pip3 install pymilvus $ pip3 install pymilvus[model] # for milvus-model $ pip3 install pymilvus[bulk_writer] # for bulk_writer
Comparison vs. Top RAG, Data & Memory Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| pymilvus ★ | 1.4k | — | Python | Apache-2.0 | Python gRPC SDK for Milvus vector retrieval and collection management |
| llama_index | 53.1k | +104 | Python | MIT | A modular Python SDK for document ingestion, indexing, and RAG |
| auto-ontology | 19.1k | +3.7k | Python | Apache-2.0 | An ontology framework that grounds agent-generated SQL in reviewed business defi |
| langextract | 39.5k | +85 | Python | Apache-2.0 | Python SDK for extracting structured data with traceable source spans |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/milvus-io/pymilvus.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about pymilvus
How do I integrate PyMilvus into a Python retrieval service?
MilvusClient or AsyncMilvusClient. Choose the async client when retrieval needs to fit an existing asyncio request path. Collection schema and access policies still need to be configured for the target deployment.Does the SDK need a GPU, and how should I size its runtime?
Can I use PyMilvus commercially in a self-hosted product?
When should I choose PyMilvus over FAISS or another database's SDK?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy