pypi / pymilvus
pymilvus
What changed in pymilvus 2 to 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
20 breaking3 security2 deprecations66 new APIs and options4 performance21 behavior and defaults1 tooling67 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpymilvus 353 changes
Breaking changes 5
Rejects out-of-range ports during connection validation.
PyMilvus 3.0.3 requires Python 3.9 or later.
Empty binary-vector lists now raise a parameter error instead of leaking an IndexError.
Rejects oversized or non-positive target_size values.
Adding a function field now requires bound index parameters.
Security 1
Uploads use safer per-upload options, lower default concurrency, byte-level progress, and request-local concurrent-upload state.
New APIs and options 24
Abort a two-phase bulk import job submitted with auto_commit=False.
Bulk import helpers accept custom HTTP headers, including Idempotency-Key.
Commit a two-phase bulk import job submitted with auto_commit=False.
Replace individual Struct Array elements or sub-field values with FieldOp.path_replace().
Both clients support function chains; each ANN request can run its own chain, and a top-level chain can merge and rerank results.
Synchronous and asynchronous clients support nullable scalar and vector sub-fields and nested scalar arrays with nullable elements in Struct Arrays.
MilvusClient and AsyncMilvusClient support principal-tag management for deployments that support row-level security.
Clients can pass an RLS principal with reads, writes, and imports.
MilvusClient and AsyncMilvusClient support row-policy management for deployments that support row-level security.
Both clients can add or drop Struct Array sub-fields on existing collections.
Adds builders for Bloom filters and Roaring bitmaps for membership filtering.
Adds APIs for observing the compaction lifecycle.
Adds scalable upload policies for Volume.
Adds a method for altering collection schemas.
Adds role and user descriptions, including this role-alteration method.
Adds TEXT handling across schema validation, result decoding, and BulkWriter paths.
Adds a method for dropping function fields.
Adds synchronous and asynchronous support for data-salvage workflows.
Adds support for external field mappings and an add-field fallback for external collections.
Adds FunctionChain APIs and forwards every specified stage during search.
Adds this method to MilvusClient and AsyncMilvusClient.
Adds support for MinHash function fields.
Supports dynamically adding struct fields.
Adds an expression helper for XGBoost.
Performance 1
Avoids quadratic decoding for nullable-scalar results.
Behavior and default changes 7
Importing pymilvus keeps application logging handlers open.
Array query results are materialized as standard Python lists.
Null values are allowed in this column during insert.
Role descriptions are now included in the method's output.
Float inputs are now accepted for FP16 and BF16 vectors.
Exposes error classification; only connection-setup RPC failures are mapped to CONNECT_FAILED.
Query and Search Iterator V1 and V2 implementations move to the client layer, with ORM compatibility preserved and ORM deprecation warnings aligned.
Fixes and other changes 15
Implement the missing RPC handler so AsyncMilvusClient.flush_all() works.
Implement the missing RPC handler so AsyncMilvusClient.get_compaction_plans() works.
Implement the missing RPC handler so AsyncMilvusClient.get_flush_all_state() works.
Implement the missing RPC handler so AsyncMilvusClient.update_replicate_configuration() works.
Writing bulk import files preserves null Struct Array values in CSV and null sparse-vector values in Parquet.
Results preserve Struct Array parameters such as mmap_enabled and warmup.
Importing pymilvus.bulk_writer no longer configures the root logger.
The cursor's str_pk is None before the first page is read.
Configured connection timeouts are preserved during recovery.
Sync and async reconnects swap channels atomically, protect active RPCs, and cover retired-channel reclamation.
Adds search aggregation and correctly forwards the group_by_fields parameter.
External filtering is preserved when creating search iterators.
Booleans are rejected as sparse-vector values or indices, with improved validation errors.
Supports partial updates and preserves struct-array fields reconstructed from schema dictionaries.
BulkWriter supports struct-vector fields and skips payloads for null struct rows and null struct-vector subfields.
pymilvus 2131 changes
Breaking changes 15
Empty binary-vector lists in batch writes now raise ParamError.
PyMilvus 2.6.18 requires Python 3.8 or later.
Upload skips an existing object by default when its key and byte size match; set upload_policy=UploadPolicy.OVERWRITE to replace matching objects.
Rejects boolean values in sparse vector validation and improves the related error message.
Rejects oversized compaction target sizes.
The consistency_level returned by describe_collection is now a name string.
infer_dtype_bydata now returns UNKNOWN for a list of strings instead of ARRAY.
Returns an error when a database does not exist.
The highlight query keyword was changed.
Stage was renamed to Volume, so developers using the renamed API must update their code.
Migrated to MilvusClient.
Migrated to MilvusClient.
String values for JSON fields must now be JSON-serialized bytes; serialize strings with json.dumps before inserting.
An error is now raised when a ranker has an unknown type.
Flush refers to a different method in Milvus 2.0.0; flushing is not needed to make entities searchable by query nodes.
Security 2
MilvusClient and AsyncMilvusClient add RLS policy and principal-tag management; supported read and write operations accept rls_principal for server-side enforcement.
Corrects parameter name typos that could bypass partition filters.
Deprecations 2
ORM APIs now emit deprecation warnings.
The 1.x Milvus class is deprecated and emits a warning when used with Milvus 2.0.0; it is separated from the orm-styled APIs.
New APIs and options 42
An async RPC handler is implemented for flush_all(); handlers are also implemented for get_compaction_plans() and update_replicate_configuration().
Accepts custom HTTP headers; get_import_progress() and list_import_jobs() also accept them.
The SDK exports this header for use with servers that support idempotent bulk imports.
Use UploadPolicy.OVERWRITE to replace matching objects during Volume uploads.
Supports an inclusive start option when dumping messages.
Adds role and user description support in auth APIs.
Adds dump_messages support for data salvage.
Adds element-level search support.
Adds helpers for array partial update operators.
AnnSearchRequest accepts filter= as an alias for expr=.
The compact API adds target_size to control compaction size.
The compact API adds target_size_unit to specify the unit for target_size.
A describe_volume API is added as part of external volume support.
A client API is added to get replicate configuration.
Cloud import interfaces add support for projectId.
Cloud import interfaces add support for regionId.
Adds ConnectionManager to replace the connections singleton for MilvusClient.
Adds global cluster client support for working with global clusters.
Adds virtual_style_endpoint support to the remote bulk writer.
Field schema definitions support warmup type parameters.
Users can configure gRPC channel options, alongside improved gRPC keepalive defaults.
gRPC error diagnostics now include channel_state.
gRPC error diagnostics now include debug_error_string.
Float scalar fields support floating-point numbers.
Adds async client support for list_persistent_segments.
Adds support for semantic-highlighter.
Function SDK support was added.
Search with a highlighter is now supported in pymilvus.
The bulk writer now supports timestamptz.
BulkWriter supports the Geometry data type.
PyMilvus supports TIMESTAMPTZ fields for storing and querying timestamps with time zone information.
Added the db_name parameter so import jobs can be listed for a specific database.
RemoteBulkWriter can use a specified local temporary path.
STRUCT fields support TypeParams definition.
Enable this collection property to insert custom primary keys when auto_id is enabled.
Set is_l0 to trigger L0 compaction manually to optimize storage and query performance.
Geographic data is supported in insert, query, and search operations.
Struct fields and arrays of structs are supported for storing and querying nested data structures.
A function scorer can be used as a ranker.
An API is available to update replicate configuration.
GCP supports using stage.
Delete support is introduced.
Performance 3
Improves performance across the MilvusClient path.
Search result performance was optimized for the Hit class.
Search result performance was optimized for HybridHits initialization.
Behavior and default changes 14
BulkWriter logging is scoped to the pymilvus.bulk_writer logger tree.
Improves volume upload interaction, including concurrency and progress behavior.
MilvusClient now defaults to port 443 for https:// URIs, avoiding the need to specify the HTTPS port explicitly.
Displays human-readable state and level in its repr.
The database name is now parsed from the URI.
Error messages are enhanced when AsyncMilvusClient fails to connect.
MilvusClient accepts numpy ndarray input for ARRAY fields.
BulkWriter supports the STRUCT field data type.
Error handling includes a detailed traceback for better debugging.
The async client now includes a retry mechanism and schema cache.
Remote storage usage result information is enhanced.
Users can insert a primary key when autoid is enabled.
Insert supports serialized JSON.
Consistency level is highlighted as the setting to consider instead of flushing to make entities searchable by query nodes.
Tooling 1
A comprehensive benchmarking framework was added for benchmarking pymilvus.
Fixes and other changes 52
Importing PyMilvus preserves existing application log handlers.
Returns None before the first page when the primary key is VARCHAR.
Supports struct vector fields; remote upload path prefixes are preserved on Windows.
Async schema results are unpacked before collection optimization runs.
Primary-key, partition-key, and clustering-key metadata stays synchronized when fields are added to a schema.
Boolean values used as sparse-vector indices are rejected.
Hardens sync and async connection recovery by protecting reconnect channel swaps and validating channel reclamation.
The collection_name type is validated in search, hybrid_search, and flush.
CollectionSchema.dict() returns consistency_level as an integer again and adds a name alias.
IndexParam validates the params type, handling None and rejecting invalid types.
MilvusClient no longer hangs on an unreachable URI when timeout=None.
SearchIteratorV2 pins GUARANTEE_TIMESTAMP from the probe call.
Removed the duplicate timeout keyword argument from Collection.__init__.
page_retain_order is now passed to search params, so the setting is applied during search.
Query deserialization now handles an empty result set when an ARRAY field is present.
Prevents “Cannot invoke RPC on closed channel” errors after connection recovery.
Handles None credentials.
Passing the address to GrpcHandler fixes the Milvus Lite local path, which had been broken since 2.6.10.
Guards against a None handler.
Adds support for Python 3.14.
Handles None responses to prevent AttributeError.
Correctly identifies bytes vector types in the search path.
Uses an explicit length check for NumPy array compatibility.
Clarifies guidance for wrong-port errors.
Enforces timeouts for async operations when the server is unreachable.
Retries on REPLICATE_VIOLATION during a global cluster region switch.
Accepts negative int64 primary keys.
Avoids calling len() on a scipy sparse matrix in entity_to_field_data.
Supports non-float vectors in struct array search.
Adds debounce to prevent concurrent topology refresh in the global client.
Fix tuple unpacking of the _get_schema return value in _list_vector_indexes.
SearchIteratorV2 forwards context, including db_name, to describe_collection so it uses the selected database instead of always querying the default database.
Fixes BulkWriter to support struct lists that are entirely empty.
Boolean serialization now remains uppercase for end-to-end compatibility.
The standard json parser is used to parse deeply recursive JSON when orjson fails.
Fixed negative index access when preloading float vectors.
Iterator checkpoints now save the timestamp.
Search parameters in the ORM search iterator were fixed.
False boolean values are preserved in SCANN index parameters.
Using deepcopy for struct_schema in add_field prevents reuse issues.
Fixed support for nested fields when creating an index with AsyncMilvusClient.
AsyncMilvusClient.search now supports EmbeddingList.
Fixed errors when function or function_score fetches empty params.
Async connections are distinguished by event loop ID to fix connection reuse.
Fixed connection caching when retrieving collection schema.
Fixed a bug related to connection reset handling.
Async flush() waits for segments to be flushed.
Migrated to MilvusClient.
MilvusClient insert() passes keyword arguments, such as timeout, to the underlying implementation.
Fixed key names in segment info retrieval.
Querying STRUCT fields no longer incorrectly returns an empty array.
hybrid_search now supports EmbeddingList in request data.