{"id":7379,"library":"llama-index-vector-stores-qdrant","title":"Qdrant Vector Store for LlamaIndex","description":"The `llama-index-vector-stores-qdrant` library provides an integration for using Qdrant as a vector store within the LlamaIndex framework. It enables users to store and retrieve vector embeddings efficiently for building Retrieval-Augmented Generation (RAG) applications. This integration supports various Qdrant features, including hybrid search capabilities, and is part of the LlamaIndex v0.10.0 ecosystem which adopted a modular architecture with separate integration packages.","status":"active","version":"0.10.0","language":"en","source_language":"en","source_url":"https://github.com/run-llama/llama_index/tree/main/llama-index-integrations/vector_stores/llama-index-vector-stores-qdrant","tags":["LlamaIndex","Qdrant","Vector Store","RAG","LLM","Embeddings","Hybrid Search","AI"],"install":[{"cmd":"pip install llama-index-vector-stores-qdrant qdrant-client","lang":"bash","label":"Base Installation"},{"cmd":"pip install llama-index-vector-stores-qdrant qdrant-client fastembed","lang":"bash","label":"For Hybrid Search / Local Embeddings"}],"dependencies":[{"reason":"Required for interacting with the Qdrant vector database.","package":"qdrant-client","optional":false},{"reason":"Optional, but recommended for local sparse vector generation and efficient local embeddings, especially with hybrid search enabled.","package":"fastembed","optional":true},{"reason":"The core LlamaIndex library, which defines the `VectorStore` interface and other fundamental abstractions.","package":"llama-index-core","optional":false}],"imports":[{"symbol":"QdrantVectorStore","correct":"from llama_index.vector_stores.qdrant import QdrantVectorStore"},{"symbol":"QdrantClient","correct":"from qdrant_client import QdrantClient"},{"symbol":"AsyncQdrantClient","correct":"from qdrant_client import AsyncQdrantClient"},{"note":"As of LlamaIndex v0.10.0, ServiceContext is deprecated and its components should be configured via `Settings` or passed directly. If used, it's now in `llama_index.core`.","wrong":"from llama_index.service_context import ServiceContext","symbol":"ServiceContext","correct":"from llama_index.core import ServiceContext"}],"quickstart":{"code":"import os\nfrom llama_index.core import VectorStoreIndex, Document\nfrom llama_index.vector_stores.qdrant import QdrantVectorStore\nfrom qdrant_client import QdrantClient\nfrom llama_index.embeddings.openai import OpenAIEmbedding\nfrom llama_index.core import Settings\n\n# Ensure you have your OpenAI API key set as an environment variable\n# os.environ[\"OPENAI_API_KEY\"] = \"sk-...\"\n\n# Fallback for API key or local Qdrant for quick demo without remote setup\nif os.environ.get(\"OPENAI_API_KEY\") is None or os.environ.get(\"OPENAI_API_KEY\") == \"\":\n    print(\"Warning: OPENAI_API_KEY not set. Using a dummy key for example purposes. This will fail if you try to use OpenAI models.\")\n    os.environ[\"OPENAI_API_KEY\"] = os.environ.get(\"OPENAI_API_KEY\", \"sk-dummy-key\")\n\n# Initialize Qdrant client (local in-memory for quick start, or connect to a server)\n# For persistent storage, use QdrantClient(path=\"./qdrant_data\") or connect to a running Qdrant instance\nclient = QdrantClient(location=\":memory:\") # In-memory Qdrant instance\n\n# Create a QdrantVectorStore instance\nvector_store = QdrantVectorStore(client=client, collection_name=\"my_documents\")\n\n# Configure LlamaIndex settings (important for v0.10+)\nSettings.embed_model = OpenAIEmbedding()\n\n# Create a dummy document\ndocuments = [\n    Document(text=\"LlamaIndex is a data framework for LLM applications.\"),\n    Document(text=\"Qdrant is a vector similarity search engine.\"),\n    Document(text=\"Combining LlamaIndex with Qdrant enables powerful RAG systems.\"),\n]\n\n# Build the VectorStoreIndex\nindex = VectorStoreIndex.from_documents(documents, vector_store=vector_store)\n\n# Query the index\nquery_engine = index.as_query_engine()\nresponse = query_engine.query(\"What is LlamaIndex?\")\nprint(f\"Response: {response}\")\n\nresponse = query_engine.query(\"What is Qdrant used for?\")\nprint(f\"Response: {response}\")","lang":"python","description":"This quickstart demonstrates how to initialize a Qdrant in-memory client, create a `QdrantVectorStore`, configure LlamaIndex settings with an embedding model (defaults to OpenAI), index a few dummy documents, and then query the index. It highlights the modular setup in LlamaIndex v0.10+."},"warnings":[{"fix":"Migrate `ServiceContext` usage to direct configuration via `Settings` or by passing components directly to index/query engine constructors. Update imports from `llama_index.<component>` to `from llama_index.core import <Component>` or `from llama_index.<integration_type>.<integration_name> import <Component>`.","message":"LlamaIndex v0.10.0 introduced a major refactor, splitting core components and integrations into separate packages. The `ServiceContext` abstraction was deprecated. This means imports and configuration patterns have changed significantly.","severity":"breaking","affected_versions":">=0.10.0 of llama-index core, and all associated integration packages like this one."},{"fix":"If encountering errors, try constraining your `qdrant-client` version to one known to be compatible (e.g., `qdrant-client<1.16.0` if using an older `llama-index` setup) or upgrade `llama-index-vector-stores-qdrant` to a version that explicitly supports the newer `qdrant-client` API.","message":"Future versions of `qdrant-client` (e.g., 1.16.0 as of a past issue) introduced breaking API changes (e.g., removal of `AsyncQdrantClient.search` method, Pydantic validation issues for local clients) that can cause `AttributeError` or validation failures.","severity":"breaking","affected_versions":"May affect `llama-index-vector-stores-qdrant` 0.10.0 when used with `qdrant-client` versions that introduced these breaking changes (e.g., `qdrant-client>=1.16.0`). Compatibility updates have been made in later `llama-index` versions."},{"fix":"To 'warm up' the system and avoid a slow first user-facing query, perform a dummy query shortly after the `VectorStoreIndex` is initialized but before serving user requests.","message":"The very first retrieval query from a LlamaIndex index backed by Qdrant can be significantly slower (e.g., >10 seconds) than subsequent queries. This is due to Qdrant's internal index initialization and connection setup overhead.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Install necessary packages: `pip install fastembed` (for CPU-friendly local embeddings) or `pip install \"transformers[torch]\"` if using HuggingFace models for sparse embeddings.","message":"For hybrid search functionality (combining sparse and dense vectors) with Qdrant, additional dependencies like `fastembed` (for local sparse embedding generation) or `transformers` might be required.","severity":"gotcha","affected_versions":"All versions using hybrid search"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Downgrade `qdrant-client` to a compatible version (e.g., `pip install qdrant-client<1.16.0`) or upgrade `llama-index-vector-stores-qdrant` to a version that supports the newer `qdrant-client` APIs.","cause":"This typically occurs when using an incompatible version of `qdrant-client` with `llama-index-vector-stores-qdrant`. Newer `qdrant-client` versions refactored the `search` method's location or API.","error":"AttributeError: 'AsyncQdrantClient' object has no attribute 'search'"},{"fix":"Install the package: `pip install llama-index-vector-stores-qdrant`.","cause":"The `llama-index-vector-stores-qdrant` package is not installed or not correctly installed in the current environment.","error":"ModuleNotFoundError: No module named 'llama_index.vector_stores.qdrant'"},{"fix":"Install the `qdrant-client`: `pip install qdrant-client`.","cause":"The `qdrant-client` library, which is a peer dependency, is not installed.","error":"ModuleNotFoundError: No module named 'qdrant_client'"},{"fix":"Constrain your `qdrant-client` version to an earlier, compatible one (e.g., `pip install qdrant-client<1.16.0`) or ensure your `llama-index-vector-stores-qdrant` version is updated to support the latest `qdrant-client` schemas.","cause":"This can happen with newer `qdrant-client` versions (e.g., >=1.16.0) that introduced breaking changes to the internal data model for creating collections, leading to schema validation failures.","error":"PydanticValidationError (or similar validation error) when initializing QdrantClient with local data path."}]}