service_context = ServiceContext.from_defaults() vector_store = QdrantVectorStore(client=client, collection_name="paul_graham") storage_context = StorageContext.from_defaults(vector_store=vector_store) index = VectorStoreIndex.from_documents( documents, storage_context=storage_context, service_context=service_context ) query_engine = index.as_query_engine() response = query_engine.query("What did the author do growing up?")
from_documents
, which inserts new data. But how do I get an existing index, If I reboot the app for example? I don't want to re-create the index againIngestionPipeline
, which doesn't require an index, but a vector store itself.connect
to that local vector store using this pattern:question = "What are the company's climate change targets?" query_engine = index.as_query_engine(similarity_top_k=3) response = query_engine.query(question) return response