Skip to main content
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

Setup

To use Qdrant vector stores, set up a Qdrant instance and install @langchain/qdrant and @langchain/core. The @langchain/qdrant package bundles the Qdrant REST client (@qdrant/js-client-rest). This guide uses OpenAI embeddings as an example. You can use other supported embeddings models instead.
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

Set a QDRANT_URL environment variable:
If you are using OpenAI embeddings for this guide, 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.