Package com.google.genkit.plugins.qdrant
Class QdrantVectorStore
java.lang.Object
com.google.genkit.plugins.qdrant.QdrantVectorStore
Qdrant vector store backed by the Qdrant REST API.
Indexes documents (embedding + payload holding the text and metadata) into a Qdrant collection and retrieves the nearest neighbors of a query embedding.
-
Constructor Summary
ConstructorsConstructorDescriptionQdrantVectorStore(String baseUrl, String apiKey, QdrantCollectionConfig config, Embedder embedder) Creates a new store. -
Method Summary
Modifier and TypeMethodDescriptionindex(ActionContext context, IndexerRequest request) Indexes documents into the collection, generating an embedding for each.retrieve(ActionContext context, RetrieverRequest request) Retrieves documents similar to the query.
-
Constructor Details
-
QdrantVectorStore
public QdrantVectorStore(String baseUrl, String apiKey, QdrantCollectionConfig config, Embedder embedder) Creates a new store.- Parameters:
baseUrl- the Qdrant server base URL (e.g.http://localhost:6333)apiKey- the Qdrant API key, ornullwhen the server requires noneconfig- the collection configurationembedder- the embedder used to vectorize documents and queries
-
-
Method Details
-
retrieve
Retrieves documents similar to the query.- Parameters:
context- the action contextrequest- the retriever request- Returns:
- the retriever response with matching documents
-
index
Indexes documents into the collection, generating an embedding for each.- Parameters:
context- the action contextrequest- the indexer request- Returns:
- the indexer response
-