WeaviateStore features and configurations head to the API reference.
Overview
Integration details
| Class | Package | PY support | Downloads | Version |
|---|---|---|---|---|
WeaviateStore | @langchain/weaviate | ✅ |
Setup
To use Weaviate vector stores, set up a Weaviate instance and install@langchain/weaviate, @langchain/core, and weaviate-client to connect to your deployment.
This guide uses OpenAI embeddings as an example. You can use other supported embeddings models instead.
Credentials
Set the following environment variables:Instantiation
Connect a weaviate client
In most cases, you should use one of the connection helper functions to connect to your Weaviate instance:- connectToWeaviateCloud
- connectToLocal
- connectToCustom
Initiate the vectorStore
To create a collection, specify at least the collection name. If you don’t specify any properties,auto-schema creates them.
schema property when enabling the vector store. The collection name and other properties in schema will take precedence when creating the vector store.
Manage vector store
Add items to vector store
Note: If you want to associate ids with your indexed documents, they must be UUIDs.Delete items from vector store
You can delete by ID or by passing afilter parameter:
Query vector store
Once your vector store has been created and the relevant documents have been added you will most likely wish to query it during the running of your chain or agent. In weaviate’s v3, the client interacts withcollections as the primary way to work with objects in the database. The collection object can be reused throughout the codebase
Query directly
Performing a simple similarity search can be done as follows. TheFilter helper class makes it easier to use filters with conditions. The v3 client streamlines how you use Filter so your code is cleaner and more concise.
See this page for more on Weaviate filter syntax.
Hybrid search
In Weaviate,Hybrid search combines the results of a vector search and a keyword (BM25F) search by fusing the two result sets. To change the relative weights of the keyword and vector components, set the alpha value in your query.
Check docs for the full list of hybrid search options.
Retrieval augmented generation (RAG)
Retrieval Augmented Generation (RAG) combines information retrieval with generative AI models. In Weaviate, a RAG query consists of two parts: a search query, and a prompt for the model. Weaviate first performs the search, then passes both the search results and your prompt to a generative AI model before returning the generated response.- @param query The query to search for.
- @param options available options for performing the hybrid search
- @param generate available options for the generation. Check docs for complete list
Query by turning into retriever
You can also transform the vector store into a retriever for easier usage in your chains.Usage for retrieval-augmented generation
For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:API reference
For detailed documentation of allWeaviateStore features and configurations head to the API reference.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

