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.
Installation
Section titled “Installation”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
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
pip install -U weaviate-agentsweaviate-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.
Imports
Section titled “Imports”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:
# Style A — import directly from the agents package
from weaviate_agents.query import QueryAgent# Style B — import via the weaviate.agents namespace
from weaviate.agents.query import QueryAgentTroubleshooting: 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:
pip install -U weaviate-agentsOr install a specific version:
pip install -U weaviate-agents==1.6.0Questions and feedback
Section titled “Questions and feedback”Have a question or feedback? Here's how to reach us.