--- title: "Use Qdrant with LlamaIndex" description: "Use a TIR Vector Database as the vector store for LlamaIndex, to index your documents and query them." content_type: "how-to" product: "vector-database" platform: "TIR" url: "/tir/vector-database/how-to/use-qdrant-with-llamaindex/" topic: ["integrations"] --- # Use Qdrant with LlamaIndex LlamaIndex connects your private data to language models. Use your Qdrant database as its vector store to index documents and query them. ## Before you begin You need a **Running** database with its **Endpoint URL** and **API Key**; see [Connect to a vector database](/tir/vector-database/how-to/connect-to-a-vector-database/). You need Python 3.8 or later and a folder of documents. ```bash pip install llama-index llama-index-vector-stores-qdrant qdrant-client ``` ## Index documents and query `` is the **Endpoint URL** and `` is your API key. `` is the folder of documents. `` is the collection that stores them. `` is the question to ask. ```python import qdrant_client from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, StorageContext, Settings from llama_index.vector_stores.qdrant import QdrantVectorStore from llama_index.embeddings.fastembed import FastEmbedEmbedding # Configure the embedding model Settings.embed_model = FastEmbedEmbedding(model_name="BAAI/bge-base-en-v1.5") Settings.llm = None # Load documents documents = SimpleDirectoryReader("").load_data() # Connect and insert into Qdrant client = qdrant_client.QdrantClient( host="", port=6333, api_key="" ) vector_store = QdrantVectorStore(client=client, collection_name="") storage_context = StorageContext.from_defaults(vector_store=vector_store) index = VectorStoreIndex.from_documents(documents, storage_context=storage_context) # Query query_engine = index.as_query_engine() response = query_engine.query("") ``` ## What to do next For more, see the [Qdrant LlamaIndex documentation](https://qdrant.tech/documentation/frameworks/llamaindex/). To create the embeddings with the TIR GenAI API, see [Generate vector embeddings](/tir/genai-api/how-to/generate-vector-embeddings/). If a connection fails, see [Troubleshooting Vector Database](/tir/vector-database/troubleshooting/vector-database/).