Cassandra
Apache Cassandraยฎ is a NoSQL, row-oriented, highly scalable and highly available database. Starting with version 5.0, the database ships with vector search capabilities.
The integrations outlined in this page can be used with Cassandra
as well as other CQL-compatible databases,
i.e. those using the Cassandra Query Language
protocol.
Installation and Setupโ
Install the following Python package:
pip install "cassio>=0.1.6"
Vector Storeโ
from langchain_community.vectorstores import Cassandra
Learn more in the example notebook.
Chat message historyโ
from langchain_community.chat_message_histories import CassandraChatMessageHistory
Learn more in the example notebook.
LLM Cacheโ
from langchain.globals import set_llm_cache
from langchain_community.cache import CassandraCache
set_llm_cache(CassandraCache())
Learn more in the example notebook (scroll to the Cassandra section).
Semantic LLM Cacheโ
from langchain.globals import set_llm_cache
from langchain_community.cache import CassandraSemanticCache
set_llm_cache(CassandraSemanticCache(
embedding=my_embedding,
table_name="my_store",
))
Learn more in the example notebook (scroll to the appropriate section).
Document loaderโ
from langchain_community.document_loaders import CassandraLoader
Learn more in the example notebook.
Attribution statementโ
Apache Cassandra, Cassandra and Apache are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries.
Toolkitโ
The Cassandra Database toolkit
enables AI engineers to efficiently integrate agents
with Cassandra data.
from langchain_community.agent_toolkits.cassandra_database.toolkit import (
CassandraDatabaseToolkit,
)
Learn more in the example notebook.
Cassandra Database individual tools:
Get Schemaโ
Tool for getting the schema of a keyspace in an Apache Cassandra database.
from langchain_community.tools import GetSchemaCassandraDatabaseTool
Get Table Dataโ
Tool for getting data from a table in an Apache Cassandra database.
from langchain_community.tools import GetTableDataCassandraDatabaseTool
Queryโ
Tool for querying an Apache Cassandra database with provided CQL.
from langchain_community.tools import QueryCassandraDatabaseTool