Registry / vector-search / weaviate-client

weaviate-client

JSON →
library4.23.0pypypi✓ verified 26d ago

Official Python client for the Weaviate vector database. v4 is a complete rewrite from v3 — uses gRPC for data operations (significantly faster), strong typing, collection-centric API, and context manager connection lifecycle. v3 API (weaviate.Client class) removed from the v4 package as of late 2024. Compatible with Weaviate server >= 1.23.7. Supports local, cloud (Weaviate Cloud), and custom deployments.

pip install weaviate-client
INSTALL
IMPORT
SIG · WEAVIATE-CLIENT
W
weaviate-client
vector-searchpythonv4.23.0
Install
7.0s avg
Import
3553ms
Disk
92MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.23.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.915 runs
installs and imports cleanly · install 0.0s · import 4.015s · 96.2MB
glibc
py 3.103.915 runs
installs and imports cleanly · install 7.0s · import 3.092s · 93MB
92MB installed
● package 92MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WeaviateClient
from weaviate import WeaviateClient
import weaviate
connect_to_local
from weaviate import connect_to_local
weaviate.connect_to_local
connect_to_weaviate_cloud
from weaviate import connect_to_weaviate_cloud
weaviate.connect_to_weaviate_cloud

v4 uses context manager (with ... as client) to manage connection lifecycle. collections.use() is the preferred method (collections.get() deprecated in 4.18).

import weaviate from weaviate.classes.init import Auth # Local Weaviate instance with weaviate.connect_to_local() as client: # Create or get collection if not client.collections.exists('Documents'): client.collections.create('Documents') collection = client.collections.use('Documents') # Insert object uuid = collection.data.insert({'text': 'Hello world', 'source': 'test'}) # Query results = collection.query.near_text(query='hello', limit=5) for obj in results.objects: print(obj.properties)
Debug
Known issues
breakingweaviate.Client() (v3 API) removed from weaviate-client >= 4.0.0 as of late 2024. Raises AttributeError. Enormous volume of tutorials, LangChain/LlamaIndex integration docs, and LLM-generated code uses v3 patterns.
fix
Migrate to v4 API: replace weaviate.Client() with weaviate.connect_to_local() / connect_to_weaviate_cloud() / connect_to_custom(). Full migration guide: docs.weaviate.io/weaviate/client-libraries/python/v3_v4_migration. Or pin: pip install 'weaviate-client>=3.26.7,<4.0.0' — but v3 receives no new features.
affects: >= 4.0.0
breakingv4 client requires Weaviate server >= 1.23.7. v4.9+ aligns with Weaviate >= 1.27. Connecting v4 client to older servers raises gRPC errors or returns unexpected API responses.
fix
Upgrade Weaviate server first. Check compatibility matrix in the release notes. Client minor versions track server minor versions (e.g., client 4.9.x pairs with server 1.27.x).
affects: >= 4.0.0
breakinggRPC port 50051 must be open to Weaviate server. v4 client uses gRPC for all data operations. Docker deployments that only expose port 8080 (HTTP) fail with WeaviateGRPCUnavailableError on any query/insert.
fix
Add port mapping 50051:50051 to docker-compose.yml. For connect_to_custom(), specify both http_host/http_port and grpc_host/grpc_port explicitly.
affects: >= 4.0.0
breakingConfigure.NamedVectors renamed to Configure.Vectors in v4.16.0. Configure.Vectorizer.none() renamed to Configure.Vectors.self_provided(). Code written against 4.15.x and earlier breaks on upgrade.
fix
Replace Configure.NamedVectors.* with Configure.Vectors.* and Configure.MultiVectors.* for multi-vector configurations. Replace Configure.Vectorizer.none() with Configure.Vectors.self_provided().
affects: >= 4.16.0
breakingOIDC authentication for Weaviate Cloud deprecated in v4.16+, removed in early August 2025. Raises deprecation warning then AuthenticationFailedError.
fix
Switch to API key authentication: Auth.api_key('your-api-key') passed to auth_credentials in connect_to_weaviate_cloud().
affects: >= 4.16.0
gotchav4 client must be used as a context manager (with weaviate.connect_to_local() as client:) or client.close() must be called explicitly. Failing to close leaks gRPC connections and eventually causes channel exhaustion.
fix
Always use context manager pattern or call client.close() in a finally block. Do not instantiate WeaviateClient at module level without explicit lifecycle management.
affects: >= 4.0.0
gotchacollections.get() is deprecated in 4.18.0 and will be removed. New code should use collections.use() which is an exact functional equivalent introduced as the preferred alias.
fix
Replace client.collections.get('Name') with client.collections.use('Name') in all new code.
affects: >= 4.18.0
Upgrade
Version history
4.23.0latest on PyPI · released Aug 13, 2026
Audit
Dependencies
grpciorequiredRequired. gRPC is the default transport for data operations in v4. Port 50051 must be open to the Weaviate server.
httpxrequiredRequired. REST API calls for control-plane operations. Must be >= 0.26.0 due to httpx 0.28 API change.
Agent activity
67 hits · last 30 days
node
60
Perplexity
1
OpenAI (training)
1
Resources
weaviate-client — pip install weaviate-client · libregistry