Vectorstore Qdrant Backend
The Qdrant backend: self-hosted on Kubernetes, or Qdrant Cloud.
See https://qdrant.tech/. A vectorstore is one Qdrant collection, with one dense vector per
chunk. Its text is in the payload’s page_content, and its metadata in metadata,
as LangChain’s QdrantVectorStore stores them.
- class smarter.apps.vectorstore.backends.qdrant.QdrantBackend(vectorstore, embeddings=None, client=None, kubernetes=None)[source]
Bases:
SmarterVectorstoreBackendThe Qdrant backend.
- Parameters:
client (
QdrantClient|None) – A QdrantClient, e.g. an in-memory one in tests. By default it connects to the self-hosted server, or to the managed service of the vectorstore’s ApiConnection.kubernetes (
QdrantKubernetes|None) – The QdrantKubernetes of a self-hosted server. Created if needed.
- property client: QdrantClient
- delete_document(document_id)[source]
Delete every chunk of a document, whatever their number.
- Return type:
- destroy()[source]
Delete the index or collection, and any infrastructure that Smarter runs.
- Return type:
- infrastructure_ready()[source]
Whether the infrastructure that Smarter runs is ready, and why not.
A managed service always is.
- property kubernetes: QdrantKubernetes
- provision()[source]
Create the database’s infrastructure, if Smarter runs it.
It returns without waiting for it.
- Return type:
- restore_snapshot(name)[source]
Replace the index or collection’s data with a snapshot’s.
- Return type:
- search(query, k=4, search_type='similarity', score_threshold=None, fetch_k=None, lambda_mult=None, metadata_filter=None)[source]
Find the chunks that are closest in meaning to a query.