pymilvus

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

SDK
PyPI
v3.0.2
1,411 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
93 /100 Excellent
Development Activity 92
Maintenance 100
Community 80
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
79 /100 Good
Architecture 80
Code Quality 82
Innovation 68
Learning Curve 85

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

AI Development · Automation · Devops

42,358

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
Python 100%
Updated 5 days ago
Python
47%
Other

Airbyte

Data Engineering · Developer Tools

22,143

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
67
Dependency
Built with
Python 47%
Kotlin 43%
Updated 5 days ago
Python
97%
MIT

auto-news

AI Assistants · Productivity

908

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
Python 97%
Updated 1 years ago
TypeScript
50%
Other

Dify

AI Development · Design Tools · Developer Tools

157,364

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

View details
92
Repo Health
85
Technical
66
Dependency
Built with
TypeScript 50%
Python 47%
Updated 5 days ago
Python
56%
MIT

Foxel

File Storage

1,063

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

View details
62
Repo Health
68
Technical
77
Dependency
Built with
Python 56%
TypeScript 41%
Updated 2 weeks ago
TypeScript
51%
AGPL 3.0

Glean

Bookmarks Archiving · Knowledge Management

868

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

View details
73
Repo Health
75
Technical
70
Dependency
Built with
TypeScript 51%
Python 45%
Updated 1 weeks ago
Python
94%
MIT

MemPalace

AI Agents · AI Development · AI Memory

59,323

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
72
Dependency
Built with
Python 94%
Updated 1 weeks ago
Python
37%
Other

Open WebUI

AI Agents · AI Assistants

153,390

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
Python 37%
Svelte 34%
JavaScript 21%
Updated 5 days ago
C++
75%
Apache 2.0

Timeplus Proton

Analytics · Data Engineering

2,262

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%
Python 11%
Updated 1 weeks 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