# Repository Briefing: milvus-io/pymilvus
> Source: https://repoforai.com/repo/milvus-io/pymilvus (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/milvus-io/pymilvus
- **Category**: RAG, Data & Memory (知识库 / 爬虫 / 记忆层)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: A+ (96/100 · Maintenance 35/35 · Adoption 21/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v3.0.4 (2026-11-30) — https://github.com/milvus-io/pymilvus/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Docker
- **Momentum**: 1,427 ★ total (+0 24h / +0 7d) · 514 forks
- **Topics**: `anns`, `faiss`, `faiss-vector-database`, `milvus`, `milvus-lite`, `milvus-sdk`, `python`, `python-sdk`, `vector-database`
- **When to Use**: Best for: 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. Skip if: You need a standalone local index, a complete RAG pipeline, or one client that works across multiple vector databases.

## Overview
```text
### Architecture & 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.
```

## Key Capabilities
```text
- Client API: `MilvusClient` and `AsyncMilvusClient` provide synchronous and asynchronous entry points to Milvus.
- Transport: Both clients accept `grpc_compression="gzip"` for outgoing messages and reject `deflate` before connecting.
- Schema evolution: v3.0.3 adds nullable Struct Array subfields; v3.0.4 adds Struct parent `external_field` mappings.
- Access control: v2.6.18 adds RLS policy and principal-tag management, plus `rls_principal` on supported operations.
- Packaging: Python 3.9+ for the current line, with optional `model` and `bulk_writer` extras.
- Container mismatch: The root Dockerfile still installs PyMilvus 2.0.0 on Python 3.6 and starts `python`, not a Milvus server.
```

## Quick Start / Clone
```bash
$ pip3 install pymilvus
$ pip3 install pymilvus[model] # for milvus-model
$ pip3 install pymilvus[bulk_writer] # for bulk_writer
```
