Weaviate is a multi-purpose vector DB that can store both embeddings and data objects, making it a good choice for multi-modality.
The `WeaviateDocumentStore` can connect to any Weaviate instance, whether it's running on Weaviate Cloud Services, Kubernetes, or a local Docker container.
## Installation
You can simply install the Weaviate Haystack integration with:
```shell
pip install weaviate-haystack
```
## Initialization
### Weaviate Embedded
To use `WeaviateDocumentStore` as a temporary instance, initialize it as ["Embedded"](https://weaviate.io/developers/weaviate/installation/embedded):
```python
from haystack_integrations.document_stores.weaviate import WeaviateDocumentStore
With this example, we explicitly enable access without authentication, so you don't need to set any username, password, or API key to connect to our local instance. That is strongly discouraged for production use. See the [authorization](#authorization) section for detailed information.
We provide some utility classes in the `auth` package to handle authorization using different credentials. Every class stores distinct [secrets](../concepts/secret-management.mdx) and retrieves them from the environment variables when required.
The default environment variables for the classes are:
- **`AuthApiKey`**
- `WEAVIATE_API_KEY`
- **`AuthBearerToken`**
- `WEAVIATE_ACCESS_TOKEN`
- `WEAVIATE_REFRESH_TOKEN`
- **`AuthClientCredentials`**
- `WEAVIATE_CLIENT_SECRET`
- `WEAVIATE_SCOPE`
- **`AuthClientPassword`**
- `WEAVIATE_USERNAME`
- `WEAVIATE_PASSWORD`
- `WEAVIATE_SCOPE`
You can easily change environment variables if needed. In the following snippet, we instruct `AuthApiKey` to look for `MY_ENV_VAR`.
```python
from haystack_integrations.document_stores.weaviate.auth import AuthApiKey
[`WeaviateBM25Retriever`](../pipeline-components/retrievers/weaviatebm25retriever.mdx): A keyword-based Retriever that fetches documents matching a query from the Document Store.
[`WeaviateEmbeddingRetriever`](../pipeline-components/retrievers/weaviateembeddingretriever.mdx): Compares the query and document embeddings and fetches the documents most relevant to the query.