Skip to main content
Weaviate Docs (migrated from docs.weaviate.io) Docs

Search documentation

Type to search this documentation.

On this pageOverview

Python client

The Python client allows you to easily interact with the Query Agent API from your Python applications.

It relies on the Weaviate Client package, and handles authentication and connection to your Weaviate instance from there.

The Query Agent Python client is distributed as the weaviate-agents package on PyPI, and depends on the weaviate-client package. You can install it in one of two equivalent ways.

Recommended: Install via the weaviate-client extra

Shell
pip install -U "weaviate-client[agents]"

This installs weaviate-client together with its agents extra, which pulls in a compatible version of weaviate-agents. This is the recommended form because it makes the relationship explicit — weaviate-agents is a sub-package designed to be used alongside weaviate-client.

Alternative: Install weaviate-agents directly

Shell
pip install -U weaviate-agents

weaviate-agents declares weaviate-client as a hard dependency, so this command also installs both packages. The end result is the same set of installed packages as the recommended form.

Both install commands install the same two packages (weaviate-client and weaviate-agents), so the following two import styles both work and are equivalent in practice — pick whichever you prefer:

Python
# Style A — import directly from the agents package
from weaviate_agents.query import QueryAgent
Python
# Style B — import via the weaviate.agents namespace
from weaviate.agents.query import QueryAgent

Troubleshooting: Force pip to install the latest version

Section titled “Troubleshooting: Force pip to install the latest version”

For existing installations, even pip install -U "weaviate-client[agents]" may not upgrade weaviate-agents to the latest version. If this occurs, additionally try to explicitly upgrade the weaviate-agents package:

Shell
pip install -U weaviate-agents

Or install a specific version:

Shell
pip install -U weaviate-agents==1.6.0

Have a question or feedback? Here's how to reach us.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu