Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAgents and toolkitsMemoryAWS DynamoDBCassandramemoryMomento CacheMongodDBMot√∂rheadPostgresRedisRemembrallRocksetSingleStoreDBSQL (SQLAlchemy)SQLiteStreamlitUpstash Redis Chat Message HistoryXataZepCallbacksChat loadersComponentsMemoryCassandraOn this pageCassandraApache Cassandra¬Æ is a NoSQL, row-oriented, highly scalable and highly available database, well suited for storing large amounts of data.Cassandra is a good choice for storing chat message history because it is easy to scale and can handle a large number of writes.This notebook goes over how to use Cassandra to store chat message history.Setting up‚ÄãTo run this notebook you need either a running Cassandra cluster or a DataStax Astra DB instance running in the cloud (you can get one for free at datastax.com). Check cassio.org for more information.pip install "cassio>=0.1.0"Set up the database connection parameters and secrets‚Äãimport osimport getpassdatabase_mode = (input("\n(C)assandra or (A)stra DB? ")).upper()keyspace_name = input("\nKeyspace name? ")if database_mode == "A":    ASTRA_DB_APPLICATION_TOKEN = getpass.getpass('\nAstra DB Token ("AstraCS:...") ')    #    ASTRA_DB_SECURE_BUNDLE_PATH = input("Full path to your Secure Connect Bundle? ")elif database_mode == "C":    CASSANDRA_CONTACT_POINTS = input(        "Contact points? (comma-separated, empty for localhost) "    ).strip()Depending on whether local or cloud-based Astra DB, create the corresponding database connection "Session" object.from cassandra.cluster import Clusterfrom cassandra.auth import PlainTextAuthProviderif database_mode == "C":    if CASSANDRA_CONTACT_POINTS:        cluster = Cluster(            [cp.strip() for cp in CASSANDRA_CONTACT_POINTS.split(",")
Apache Cassandra¬Æ is a NoSQL, row-oriented, highly scalable and highly available database, well suited for storing large amounts of data.
Apache Cassandra¬Æ is a NoSQL, row-oriented, highly scalable and highly available database, well suited for storing large amounts of data. ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAgents and toolkitsMemoryAWS DynamoDBCassandramemoryMomento CacheMongodDBMot√∂rheadPostgresRedisRemembrallRocksetSingleStoreDBSQL (SQLAlchemy)SQLiteStreamlitUpstash Redis Chat Message HistoryXataZepCallbacksChat loadersComponentsMemoryCassandraOn this pageCassandraApache Cassandra¬Æ is a NoSQL, row-oriented, highly scalable and highly available database, well suited for storing large amounts of data.Cassandra is a good choice for storing chat message history because it is easy to scale and can handle a large number of writes.This notebook goes over how to use Cassandra to store chat message history.Setting up‚ÄãTo run this notebook you need either a running Cassandra cluster or a DataStax Astra DB instance running in the cloud (you can get one for free at datastax.com). Check cassio.org for more information.pip install "cassio>=0.1.0"Set up the database connection parameters and secrets‚Äãimport osimport getpassdatabase_mode = (input("\n(C)assandra or (A)stra DB? ")).upper()keyspace_name = input("\nKeyspace name? ")if database_mode == "A":    ASTRA_DB_APPLICATION_TOKEN = getpass.getpass('\nAstra DB Token ("AstraCS:...") ')    #    ASTRA_DB_SECURE_BUNDLE_PATH = input("Full path to your Secure Connect Bundle? ")elif database_mode == "C":    CASSANDRA_CONTACT_POINTS = input(        "Contact points? (comma-separated, empty for localhost) "    ).strip()Depending on whether local or cloud-based Astra DB, create the corresponding database connection "Session" object.from cassandra.cluster import Clusterfrom cassandra.auth import PlainTextAuthProviderif database_mode == "C":    if CASSANDRA_CONTACT_POINTS:        cluster = Cluster(            [cp.strip() for cp in CASSANDRA_CONTACT_POINTS.split(",")