Back to Langflow

Chroma

docs/versioned_docs/version-1.9.0/Components/bundles-chroma.mdx

1.10.0.dev205.5 KB
Original Source

import Icon from "@site/src/components/icon"; import PartialParams from '@site/docs/_partial-hidden-params.mdx'; import PartialConditionalParams from '@site/docs/_partial-conditional-params.mdx'; import PartialVectorSearchResults from '@site/docs/_partial-vector-search-results.mdx'; import PartialVectorStoreInstance from '@site/docs/_partial-vector-store-instance.mdx';

<Icon name="Blocks" aria-hidden="true" /> Bundles contain custom components that support specific third-party integrations with Langflow.

This page describes the components that are available in the Chroma bundle.

Chroma DB

You can use the Chroma DB component to read and write to a Chroma database using an instance of Chroma vector store. Includes support for remote or in-memory instances with or without persistence.

<details> <summary>About vector store instances</summary> <PartialVectorStoreInstance /> </details>

When writing, the component can create a new database or collection at the specified location.

:::tip An ephemeral (non-persistent) local Chroma vector store is helpful for testing vector search flows where you don't need to retain the database. :::

<PartialVectorSearchResults />

Use the Chroma DB component in a flow

The following example flow uses one Chroma DB component for both reads and writes:

  • When writing, it splits JSON from a URL component into chunks, computes embeddings with attached Embedding Model component, and then loads the chunks and embeddings into the Chroma vector store. To trigger writes, click <Icon name="Play" aria-hidden="true"/> Run component on the Chroma DB component.

  • When reading, it uses chat input to perform a similarity search on the vector store, and then print the search results to the chat. To trigger reads, open the Playground and enter a chat message.

After running the flow once, you can click <Icon name="TextSearch" aria-hidden="true"/> Inspect Output on each component to understand how the data transformed as it passed from component to component.

Chroma DB parameters

You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it.

<PartialParams /> <PartialConditionalParams />

For information about accepted values and functionality, see the provider's documentation or inspect component code.

NameTypeDescription
Collection Name (collection_name)StringInput parameter. The name of your Chroma vector store collection. Default: langflow.
Persist Directory (persist_directory)StringInput parameter. To persist the Chroma database, enter a relative or absolute path to a directory to store the chroma.sqlite3 file. Leave empty for an ephemeral database. When reading or writing to an existing persistent database, specify the path to the persistent directory.
Ingest Data (ingest_data)JSON or TableInput parameter. JSON or Table input containing the records to write to the vector store. Only relevant for writes.
Search Query (search_query)StringInput parameter. The query to use for vector search. Only relevant for reads.
Cache Vector Store (cache_vector_store)BooleanInput parameter. If true, the component caches the vector store in memory for faster reads. Default: Enabled (true).
Embedding (embedding)EmbeddingsInput parameter. The embedding function to use for the vector store. By default, Chroma DB uses its built-in embeddings model, or you can attach an Embedding Model component to use a different provider or model.
CORS Allow Origins (chroma_server_cors_allow_origins)StringInput parameter. The allowed CORS origins for the Chroma server.
Chroma Server Host (chroma_server_host)StringInput parameter. The host for the Chroma server.
Chroma Server HTTP Port (chroma_server_http_port)IntegerInput parameter. The HTTP port for the Chroma server.
Chroma Server gRPC Port (chroma_server_grpc_port)IntegerInput parameter. The gRPC port for the Chroma server.
Chroma Server SSL Enabled (chroma_server_ssl_enabled)BooleanInput parameter. Enable SSL for the Chroma server.
Allow Duplicates (allow_duplicates)BooleanInput parameter. If true (default), writes don't check for existing duplicates in the collection, allowing you to store multiple copies of the same content. If false, writes won't add documents that match existing documents already present in the collection. If false, it can strictly enforce deduplication by searching the entire collection or only search the number of records, specified in limit. Only relevant for writes.
Search Type (search_type)StringInput parameter. The type of search to perform, either Similarity or MMR. Only relevant for reads.
Number of Results (number_of_results)IntegerInput parameter. The number of search results to return. Default: 10. Only relevant for reads.
Limit (limit)IntegerInput parameter. Limit the number of records to compare when Allow Duplicates is false. This can help improve performance when writing to large collections, but it can result in some duplicate records. Only relevant for writes.

See also