Skip to main content

Cassandra

Bundles contain custom components that support specific third-party integrations with Langflow.

This page describes the components that are available in the Cassandra bundle, including components that read and write to Apache Cassandra clusters, such as OSS Cassandra and Astra DB databases.

Cassandra vector store

Use the Cassandra component to read or write to a Cassandra-based vector store using a CassandraVectorStore instance.

About vector store instances

Because Langflow is based on LangChain, vector store components use an instance of LangChain vector store to drive the underlying read and write functions. These instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema.

In component code, this is often instantiated as vector_store, but some vector store components use a different name, such as the provider name.

Some LangChain classes don't expose all possible options as component parameters. Depending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow. For information about specific options, see the LangChain API reference and vector store provider's documentation.

If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of Data objects or a tabular DataFrame. If both types are supported, you can set the format near the vector store component's output port in the visual editor.

tip

For a tutorial using a vector database in a flow, see Create a vector RAG chatbot.

Cassandra 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.

Some parameters are hidden by default in the visual editor. You can modify all parameters through the Controls in the component's header menu.

Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters. Conditional parameters may not be visible on the Controls pane until you set the required dependencies.

For information about accepted values and functionality, see Vector search in Cassandra or inspect component code.

NameTypeDescription
database_refStringInput parameter. Contact points for the database or an Astra database ID.
usernameStringInput parameter. Username for the database. Leave empty for Astra DB.
tokenSecretStringInput parameter. User password for the database or an Astra application token.
keyspaceStringInput parameter. The name of the keyspace containing the vector store specified in Table Name (table_name).
table_nameStringInput parameter. The name of the table or collection that is the vector store.
ttl_secondsIntegerInput parameter. Time-to-live for added texts, if supported by the cluster. Only relevant for writes.
batch_sizeIntegerInput parameter. Amount of records to process in a single batch.
setup_modeStringInput parameter. Configuration mode for setting up a Cassandra table.
cluster_kwargsDictInput parameter. Additional keyword arguments for a Cassandra cluster.
search_queryStringInput parameter. Query string for similarity search. Only relevant for reads.
ingest_dataDataInput parameter. Data to be loaded into the vector store as raw chunks and embeddings. Only relevant for writes.
embeddingEmbeddingsInput parameter. Embedding function to use.
number_of_resultsIntegerInput parameter. Number of results to return in search. Only relevant for reads.
search_typeStringInput parameter. Type of search to perform. Only relevant for reads.
search_score_thresholdFloatInput parameter. Minimum similarity score for search results. Only relevant for reads.
search_filterDictInput parameter. An optional dictionary of metadata search filters to apply in addition to vector search. Only relevant for reads.
body_searchStringInput parameter. Document textual search terms. Only relevant for reads.
enable_body_searchBooleanInput parameter. Flag to enable body search. Only relevant for reads.

Cassandra Chat Memory

The Cassandra Chat Memory component retrieves and stores chat messages using an Apache Cassandra-based database.

Chat memories are passed between memory storage components as the Memory data type. Specifically, the component creates an instance of CassandraChatMessageHistory, which is a LangChain chat message history class that uses a Cassandra database for storage.

For more information about using external chat memory in flows, see the Message History component.

Cassandra Chat Memory parameters

Some parameters are hidden by default in the visual editor. You can modify all parameters through the Controls in the component's header menu.

NameTypeDescription
database_refMessageTextInput parameter. The contact points for the Cassandra database or Astra DB database ID. Required.
usernameMessageTextInput parameter. The username for Cassandra. Leave empty for Astra DB.
tokenSecretStringInput parameter. The password for Cassandra or the token for Astra DB. Required.
keyspaceMessageTextInput parameter. The keyspace in Cassandra or namespace in Astra DB. Required.
table_nameMessageTextInput parameter. The name of the table or collection for storing messages. Required.
session_idMessageTextInput parameter. The unique identifier for the chat session. Optional.
cluster_kwargsDictionaryInput parameter. Additional keyword arguments for the Cassandra cluster configuration. Optional.

Cassandra Graph

The Cassandra Graph component uses CassandraGraphVectorStore, an instance of LangChain graph vector store, for graph traversal and graph-based document retrieval in a compatible Cassandra-based cluster. It also supports writing to the vector store.

If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of Data objects or a tabular DataFrame. If both types are supported, you can set the format near the vector store component's output port in the visual editor.

Cassandra Graph parameters

Some parameters are hidden by default in the visual editor. You can modify all parameters through the Controls in the component's header menu.

NameDisplay NameInfo
database_refContact Points / Astra Database IDInput parameter. The contact points for the database or an Astra database ID. Required.
usernameUsernameInput parameter. The username for the database. Leave empty for Astra DB.
tokenPassword / Astra DB TokenInput parameter. The user password for the database or an Astra application token. Required.
keyspaceKeyspaceInput parameter. The name of the keyspace containing the vector store specified in Table Name (table_name). Required.
table_nameTable NameInput parameter. The name of the table or collection that is the vector store. Required.
setup_modeSetup ModeInput parameter. The configuration mode for setting up the Cassandra table. The options are Sync (default) or Off.
cluster_kwargsCluster argumentsInput parameter. An optional dictionary of additional keyword arguments for the Cassandra cluster.
search_querySearch QueryInput parameter. The query string for similarity search. Only relevant for reads.
ingest_dataIngest DataInput parameter. Data to be loaded into the vector store as raw chunks and embeddings. Only relevant for writes.
embeddingEmbeddingInput parameter. The embedding model to use.
number_of_resultsNumber of ResultsInput parameter. The number of results to return in similarity search. Only relevant for reads. Default: 4.
search_typeSearch TypeInput parameter. The search type to use. The options are Traversal (default), MMR Traversal, Similarity, Similarity with score threshold, or MMR (Max Marginal Relevance).
depthDepth of traversalInput parameter. The maximum depth of edges to traverse. Only relevant if Search Type (search_type) is Traversal or MMR Traversal. Default: 1.
search_score_thresholdSearch Score ThresholdInput parameter. The minimum similarity score threshold for search results. Only relevant for reads using the Similarity with score threshold search type.
search_filterSearch Metadata FilterInput parameter. An optional dictionary of metadata search filters to apply in addition to graph traversal and similarity search.

See also

Search