If you’re a frequent user of ChatGPT, you know the tendency it has to wander off into what is known as hallucinations. A great collection of statistically correct words that have no basis in reality. A few months ago, a prompt about using Apache Cassandra for large language models (LLMs) and LangChain resulted in a curious response. ChatGPT reported that not only was Cassandra a good tool choice when creating LLMs, OpenAI used Cassandra with an MIT-licensed Python library they called CassIO.
Into the rabbit hole we went, and through more prompting, ChatGPT described many details about how CassIO was used. It even included some sample code and a website. Subsequent research found no evidence of CassIO outside of ChatGPT responses, but the seed was sown. If this library didn’t exist, it needed to, and we started work on it shortly after.
Best hallucination ever.
What was this great idea that ChatGPT (and, by association, OpenAI) inspired? A great Python library enables developers to do more with less. DataStax and Anant combined forces in developing
CassIO's strength lies in its agnosticism toward specific AI frameworks. It doesn't concern itself with the specific implementation details of interfaces like
A memory module for LLMs that uses Cassandra for storage, which can remember recent exchanges in a chat interaction, or even keep a summary of the entire past conversation.
A feature to cache LLM responses on Cassandra, thereby saving on latency and tokens where possible.Automatic injection of data from Cassandra into a prompt or within a longer LLM conversation.
Support for "partialing" of prompts, leaving some input unspecified for future supply.
Automatic injection of data from a
These components work together to streamline the process of incorporating data into prompts and ensure smooth interaction between the LLM and the database.
The inclusion of
The combination of CassIO and LangChain continues to expand and refine these capabilities over time to meet the ever-evolving needs of LLM management. The current state-of-the-art is in chaining prompts to get more accurate responses from LLMs. In a recent paper describing a technique called
As an evolving tool, CassIO is growing rapidly, with new developments and updates frequently added. At the time of writing, CassIO supports LangChain, with LlamaIndex coming soon. The long-term goal of this project is to support high-scale memory for autonomous AI agents such as the
An upcoming boot camp, “
Who knows how history will judge this moment? Was it a leak of internal information from OpenAI? Or, thinking a bit more darkly, is this the first step of AI to get humans to do its bidding? Either way, developers now have a simple-to-use library to tap into the near-infinite scale of Cassandra when striking off into the world of generative AI.
ChatGPT has given us a gift, so what are you going to build with this? I’m going to be diving into vector search in an upcoming webinar (register
By Patrick McFadin, DataStax
Patrick McFadin is the co-author of the O’Reilly book 'Managing Cloud Native Data on Kubernetes.' He currently works at DataStax in developer relations and as a contributor to the Apache Cassandra project. Patrick has worked as chief evangelist for Apache Cassandra (he’s also a newly minted Cassandra committer!) and as a consultant for DataStax, where he had a great time building some of the largest deployments in production.