Cassio is a framework-agnostic Python library designed for seamless integration of Apache Cassandra® with ML/LLM/genAI workloads. It provides utilities for interacting with Cassandra as a vector store, managing chat memory, and caching LLM responses, often serving as the core engine for higher-level frameworks like LangChain or LlamaIndex. The library is currently in an alpha release (v0.1.10) and has a moderately active release cadence, with occasional breaking changes expected.
pip install cassioVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize Cassio to connect to DataStax Astra DB using environment variables for the database ID and application token. This is the recommended approach for cloud-based GenAI workloads. It includes error handling for missing credentials during initialization.
Upgrade your Python environment to 3.9 or higher (but less than 4.0).
Always provide all necessary connection parameters to `cassio.init()` based on your connection method (Astra DB credentials or a `cassandra.cluster.Session` object).
Monitor release notes carefully when upgrading versions and be prepared to adapt your code. Pin exact versions in production environments.
Upgrade to v0.1.10 or later. Ensure metadata keys adhere to Cassandra's naming conventions and avoid special characters unless explicitly supported and handled by Cassio.
Ensure `ASTRA_DB_ID` and `ASTRA_DB_APPLICATION_TOKEN` environment variables are set correctly, or pass them directly as keyword arguments to `cassio.init()`.
Verify that your Cassandra cluster or Astra DB instance is running and accessible. Check network connectivity, firewall settings, and ensure the correct `database_id` or contact points are used. If using a direct `cassandra.cluster.Session`, ensure the session is properly initialized and connected.
Double-check the database endpoint and port. Ensure the database service is active and reachable. For Astra DB, verify `database_id` and `token`. If configuring a `session` manually, confirm the `cassandra-driver` connection details are correct.