QueryQdrant

Description:

Queries Qdrant in order to gather a specified number of documents that are most closely related to the given query.

Tags:

qdrant, vector, vectordb, vectorstore, embeddings, ai, artificial intelligence, ml, machine learning, text, LLM

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueDescription
Embedding ModelEmbedding ModelOpenAI ModelSpecifies which embedding model should be used in order to create embeddings from incoming Documents. Default model is OpenAI.
QueryQueryThe text of the query to send to Qdrant.
Supports Expression Language: true (will be evaluated using flow file attributes and Environment variables)
Number of ResultsNumber of Results10The number of results to return from Qdrant.
Supports Expression Language: true (will be evaluated using flow file attributes and Environment variables)
Metadata FilterMetadata FilterOptional metadata filter to apply with the query. For example: { "author": "john.doe" }
Supports Expression Language: true (will be evaluated using flow file attributes and Environment variables)
Collection NameCollection Nameapache-nifiThe name of the Qdrant collection to use.
Supports Expression Language: true (will be evaluated using flow file attributes and Environment variables)
Qdrant URLQdrant URLhttp://localhost:6333The fully qualified URL to the Qdrant instance.
Qdrant API KeyQdrant API KeyThe API Key to use in order to authentication with Qdrant. Can be empty.
Sensitive Property: true
Prefer gRPCPrefer gRPCFalseSpecifies whether to use gRPC for interfacing with Qdrant.
Use HTTPSUse HTTPSFalseSpecifies whether to TLS(HTTPS) while interfacing with Qdrant.
HuggingFace API KeyHuggingFace API KeyThe API Key for interacting with HuggingFace
Sensitive Property: true
OpenAI API KeyOpenAI API KeyThe API Key for OpenAI in order to create embeddings.
Sensitive Property: true
OpenAI ModelOpenAI Modeltext-embedding-ada-002The name of the OpenAI model to use
HuggingFace ModelHuggingFace Modelsentence-transformers/all-MiniLM-L6-v2The name of the HuggingFace model to use
Output StrategyOutput StrategyRow-OrientedSpecifies whether the output should contain only the text of the documents (each document separated by \n\n), or if it should be formatted as either single column-oriented JSON object, consisting of a keys 'ids', 'embeddings', 'documents', 'distances', and 'metadatas'; or if the results should be row-oriented, a JSON per line, each consisting of a single id, document, metadata, embedding, and distance.
Results FieldResults FieldIf the input FlowFile is JSON Formatted, this represents the name of the field to insert the results. This allows the results to be inserted into "an existing input in order to enrich it. If this property is unset, the results will be written to the FlowFile contents, overwriting any pre-existing content.
Include MetadataInclude MetadatatrueWhether or not to include the Documents' Metadata in the response
Include DistancesInclude DistancestrueWhether or not to include the Documents' Distances (i.e., how far the Document was away from the query) in the response

Example Use Cases:

Use Case:

Semantically search for documents stored in Qdrant - https://qdrant.tech/

Keywords:

qdrant, embedding, vector, text, vectorstore, search

Configuration:

Configure 'Collection Name' to the name of the Qdrant collection to use.

Configure 'Qdrant URL' to the fully qualified URL of the Qdrant instance.

Configure 'Qdrant API Key' to the API Key to use in order to authenticate with Qdrant.

Configure 'Prefer gRPC' to True if you want to use gRPC for interfacing with Qdrant.

Configure 'Use HTTPS' to True if you want to use TLS(HTTPS) while interfacing with Qdrant.

Configure 'Embedding Model' to indicate whether OpenAI embeddings should be used or a HuggingFace embedding model should be used: 'Hugging Face Model' or 'OpenAI Model'

Configure 'HuggingFace API Key' or 'OpenAI API Key', depending on the chosen Embedding Model.

Configure 'HuggingFace Model' or 'OpenAI Model' to the name of the model to use.

Configure 'Query' to the text of the query to send to Qdrant.

Configure 'Number of Results' to the number of results to return from Qdrant.

Configure 'Metadata Filter' to apply an optional metadata filter with the query. For example: { "author": "john.doe" }

Configure 'Output Strategy' to indicate how the output should be formatted: 'Row-Oriented', 'Text', or 'Column-Oriented'.

Configure 'Results Field' to the name of the field to insert the results, if the input FlowFile is JSON Formatted,.

Configure 'Include Metadatas' to True if metadata should be included in the output.

Configure 'Include Distances' to True if distances should be included in the output.