pymilvus

The official Python SDK for Milvus, the open-source vector database for embedding-based similarity search.

SDK
PyPI
v3.0.1
1,409stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
94/100Excellent
Development Activity96
Maintenance100
Community80
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture80
Code Quality82
Innovation68
Learning Curve85

PyMilvus is the official Python client for Milvus, the open-source vector database used to store, index, and search dense and sparse embeddings at scale. It wraps Milvus’s gRPC API behind both a high-level MilvusClient (collections, indexes, inserts, hybrid search, and RBAC in a handful of method calls) and a lower-level ORM layer (Collection, Schema, Partition, connections) for teams that need finer control over schema design and connection lifecycle.

Beyond core CRUD and ANN search, PyMilvus ships optional extras for common production needs: a bulk_writer for high-throughput remote imports into object storage, a model extra for embedding generation, async client variants built on grpc.aio, search iterators for paging through large result sets, and support for Milvus Lite (an embedded, file-based mode for local development without a server). It is the reference client used across Milvus’s own documentation and by RAG frameworks that need a stable vector-store backend.

What You Get

  • MilvusClient — a simplified, single-object API for connecting, creating collections, inserting data, and running vector/hybrid search without manually managing schemas or connections
  • A full ORM layer (Collection, CollectionSchema, FieldSchema, Partition, connections) for applications that need explicit schema and index control
  • Async support via AsyncMilvusClient built on grpc.aio, plus search/query iterators for paging through large result sets without loading everything into memory
  • A bulk_writer extra for writing large datasets to remote object storage (S3/MinIO/Azure Blob) for high-throughput bulk import into Milvus
  • Milvus Lite support — an embedded, file-backed mode for local development and testing without running a Milvus server
  • Built-in retry, error classification, and reconnection handling around gRPC calls (decorators.py), plus a typed MilvusException hierarchy with retriable/non-retriable classification

Common Use Cases

  • Building retrieval-augmented generation (RAG) pipelines that need a vector store for document/chunk embeddings
  • Semantic search and recommendation systems over large embedding collections (text, image, or multimodal)
  • Bulk-importing millions of pre-computed vectors into Milvus for offline-indexed similarity search
  • Local prototyping with Milvus Lite before deploying against a full Milvus cluster or Zilliz Cloud
  • Hybrid search combining dense vector similarity with sparse/keyword signals and metadata filtering in one query

Under The Hood

Architecture PyMilvus is layered around a gRPC transport: pymilvus/grpc_gen/ holds generated protobuf/gRPC stubs (milvus_pb2_grpc.py), client/grpc_handler.py (and its async twin async_grpc_handler.py) wrap those stubs with connection management, retry, and response parsing, and client/connection_manager.py pools and reuses channels. Two public surfaces sit on top: milvus_client/milvus_client.py (MilvusClient/AsyncMilvusClient, ~3,600 lines) offers a flattened, single-object API for the common case, while orm/ (Collection, Schema, Partition, connections, Index) exposes a more explicit, stateful model closer to Milvus’s own schema/index/partition concepts. A change to the core abstract.py/types.py request-response shapes ripples into both surfaces, since MilvusClient internally composes ORM/client primitives rather than duplicating them. decorators.py centralizes cross-cutting concerns — retry-on-RPC-failure, retry-on-schema-mismatch, deprecation warnings — as function decorators applied across both handler layers. Tech Stack The library targets Python 3.9–3.14, built with hatchling and versioned via setuptools_scm/vcs-versioning. Core runtime dependencies are grpcio (pinned away from several known-bad point releases), protobuf, orjson for fast JSON handling, pandas for DataFrame-based insert/query results, cachetools, and python-dotenv. Optional extras add pymilvus.model for embeddings, minio/pyarrow/ml_dtypes/azure-storage-blob for the bulk_writer path, milvus-lite for the embedded mode, and xxhash for an optional native bloom-filter implementation. Protobuf/gRPC code is generated from a milvus-proto git submodule via a make gen_proto target rather than hand-written. Code Quality The repo carries a substantial test suite (114+ files under tests/unit, tests/integration, and tests/benchmark) covering error classification, async client behavior, bulk-writer buffering, search iterators, and gRPC diagnostics, run via pytest with coverage and timeout plugins. Linting is enforced with ruff (configured in pyproject.toml) plus a pre-commit hook running make format/make lint before each commit, and CI workflows (code_checker.yml, pull_request.yml) gate merges. Exceptions are modeled as a typed hierarchy (MilvusException with an ErrorCode IntEnum and explicit is_input_error/retriable flags) rather than bare exceptions, and gRPC failures are enriched with channel connectivity state and debug strings for diagnosability. What Makes It Unique PyMilvus’s distinguishing choice is offering two coexisting API surfaces — a minimal MilvusClient and a full ORM — over the same underlying gRPC transport, letting teams start simple and drop into explicit schema/index control without switching libraries. Its retry/error-classification layer (distinguishing retriable gRPC failures, schema-mismatch retries, and rate-limit/force-deny server codes) and Milvus Lite’s embedded-mode support for local iteration without a server are less common in comparable vector-database clients, which more often ship a single thin wrapper with limited retry semantics.

Used by 9 apps in this directory

Python
100%
Apache 2.0

Agno

Devops · AI Development · Automation

42,074

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
66
Dependency
Built with
Python100%
Updated yesterday
Python
50%
Other

Airbyte

Developer Tools · Data Engineering

21,998

Open-source ELT platform with 600+ connectors for moving data from any source to warehouses, lakes, and AI agents.

View details
95
Repo Health
80
Technical
66
Dependency
Built with
Python50%
Kotlin41%
Updated today
Python
97%
MIT

auto-news

AI Assistants · Productivity

905

An AI-powered personal news aggregator that filters multi-source feeds through LLMs and delivers curated, noise-free summaries to your Notion workspace.

View details
43
Repo Health
53
Technical
66
Dependency
Built with
Python97%
Updated 1 years ago
TypeScript
50%
Other

Dify

No Code Platforms · AI Development · Developer Tools

154,649

Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.

View details
92
Repo Health
85
Technical
67
Dependency
Built with
TypeScript50%
Python46%
Updated yesterday
Python
56%
MIT

Foxel

File Storage

1,055

Self-hosted private cloud storage with AI semantic search and a pluggable multi-backend file management system.

View details
65
Repo Health
68
Technical
76
Dependency
Built with
Python56%
TypeScript41%
Updated 1 weeks ago
TypeScript
51%
AGPL 3.0

Glean

Knowledge Management · Bookmarks Archiving

857

Self-hosted RSS reader and personal knowledge management tool with MCP server integration for AI assistant connectivity.

View details
78
Repo Health
75
Technical
69
Dependency
Built with
TypeScript51%
Python45%
Updated 4 days ago
Python
95%
MIT

MemPalace

AI Agents · AI Development

58,887

Local-first AI memory with verbatim storage, pluggable backends, and 96.6% retrieval recall on LongMemEval — no API key required.

View details
84
Repo Health
84
Technical
71
Dependency
Built with
Python95%
Updated 2 days ago
Python
37%
Other

Open WebUI

AI Assistants · AI Agents

151,143

The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.

View details
91
Repo Health
75
Technical
66
Dependency
Built with
Python37%
Svelte34%
JavaScript21%
Updated yesterday
C++
75%
Apache 2.0

Timeplus Proton

Data Engineering · Analytics

2,252

Single C++ binary SQL engine for real-time stream processing, ETL, and analytics on Kafka, Redpanda, and ClickHouse with sub-millisecond latency.

View details
88
Repo Health
82
Technical
68
Dependency
Built with
C++75%
Python11%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search