Compatibility: Only available on Node.js.
Qdrant is a vector similarity search engine. It provides a production-ready service with a convenient API to store, search, and manage points - vectors with an additional payload.
This guide provides a quick overview for getting started with Qdrant vector stores. For detailed documentation of all QdrantVectorStore features and configurations head to the API reference.
Overview
Integration details
To use Qdrant vector stores, you’ll need to set up a Qdrant instance and install the @langchain/qdrant integration package.
This guide will also use OpenAI embeddings, which require you to install the @langchain/openai integration package. You can also use other supported embeddings models if you wish.
After installing the required dependencies, run a Qdrant instance with Docker on your computer by following the Qdrant setup instructions. Note the URL your container runs on.
Credentials
Once you’ve done this set a QDRANT_URL environment variable:
If you are using OpenAI embeddings for this guide, you’ll need to set your OpenAI key as well:
If you want to get automated tracing of your model calls you can also set your LangSmith API key by uncommenting below:
Instantiation
Manage vector store
Add items to vector store
Top-level document ids and deletion are currently not supported.
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.
Query directly
Performing a simple similarity search can be done as follows:
See this page for more on Qdrant filter syntax. Note that all values must be prefixed with metadata.
If you want to execute a similarity search and receive the corresponding scores you can run:
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 all QdrantVectorStore features and configurations head to the API reference.