QueryChroma

Description:

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

Tags:

chroma, vector, vectordb, embeddings, enrich, enrichment, 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
QueryQueryThe query to issue to the Chroma VectorDB. The query is always converted into embeddings using the configured embedding function, and the embedding is then sent to Chroma. The text itself is not sent to Chroma.
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 Chroma
Supports Expression Language: true (will be evaluated using flow file attributes and Environment variables)
Metadata FilterMetadata FilterA JSON representation of a Metadata Filter that can be applied against the Chroma documents in order to narrow down the documents that can be returned. For example: { "metadata_field": "some_value" }
Supports Expression Language: true (will be evaluated using flow file attributes and Environment variables)
Document FilterDocument FilterA JSON representation of a Document Filter that can be applied against the Chroma documents' text in order to narrow down the documents that can be returned. For example: { "$contains": "search_string" }
Supports Expression Language: true (will be evaluated using flow file attributes and Environment variables)
Connection StrategyConnection StrategyRemote Chroma ServerSpecifies how to connect to the Chroma server
DirectoryDirectory./chromaThe Directory that Chroma should use to persist data
HostnameHostnamelocalhostThe hostname to connect to in order to communicate with Chroma
PortPort8000The port that the Chroma server is listening on
Transport ProtocolTransport ProtocolhttpsSpecifies whether connections should be made over http or https
Authentication StrategyAuthentication StrategyToken AuthenticationSpecifies how to authenticate to Chroma server
Authentication TokenAuthentication TokenThe token to use for authenticating to Chroma server
Sensitive Property: true
UsernameUsernameThe username to use for authenticating to Chroma server
PasswordPasswordThe password to use for authenticating to Chroma server
Sensitive Property: true
Collection NameCollection NamenifiThe name of the Chroma Collection
Supports Expression Language: true (will be evaluated using flow file attributes and Environment variables)
Embedding FunctionEmbedding FunctionONNX all-MiniLM-L6-v2 ModelSpecifies which embedding function should be used in order to create embeddings from incoming Documents
HuggingFace Model NameHuggingFace Model Namesentence-transformers/all-MiniLM-L6-v2The name of the HuggingFace model to use
HuggingFace API KeyHuggingFace API KeyThe API Key for interacting with HuggingFace
Sensitive Property: true
OpenAI API KeyOpenAI API KeyThe API Key for interacting with OpenAI
Sensitive Property: true
OpenAI Model NameOpenAI Model Nametext-embedding-ada-002The name of the OpenAI model to use
OpenAI Organization IDOpenAI Organization IDThe OpenAI Organization ID
OpenAI API Base PathOpenAI API Base PathThe API Base to use for interacting with OpenAI. This is used for interacting with different deployments, such as an Azure deployment.
OpenAI API Deployment TypeOpenAI API Deployment TypeThe type of the OpenAI API Deployment. This is used for interacting with different deployments, such as an Azure deployment.
OpenAI API VersionOpenAI API VersionThe OpenAI API Version. This is used for interacting with different deployments, such as an Azure deployment.
Sentence Transformer Model NameSentence Transformer Model Nameall-MiniLM-L6-v2The name of the Sentence Transformer model to use
Sentence Transformer Device TypeSentence Transformer Device TypeThe type of device to use for performing the embeddings using the Sentence Transformer, such as 'cpu', 'cuda', 'mps', 'cuda:0', etc. If not specified, a GPU will be used if possible, otherwise a CPU.
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 Document IDsInclude Document IDstrueWhether or not to include the Documents' IDs in the response
Include MetadataInclude MetadatatrueWhether or not to include the Documents' Metadata in the response
Include DocumentInclude DocumenttrueWhether or not to include the Documents' Text 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
Include EmbeddingsInclude EmbeddingsfalseWhether or not to include the Documents' Embeddings in the response