Skip to main content

Cassandra

Distributed NoSQL database with vector search capabilities.

Setup

docker run -d -p 9042:9042 cassandra
pip install cassandra-driver

Quick Start (Agent with Knowledge)

Use Cassandra as a knowledge store with an agent:
from praisonaiagents import Agent

agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant with access to documents.",
    knowledge=["./docs/guide.pdf"]
)

agent.chat("What does the guide say?")

Advanced Usage (Direct Store)

from praisonai.persistence.factory import create_knowledge_store

store = create_knowledge_store(
    "cassandra",
    hosts=["localhost"],
    keyspace="praisonai"
)

store.create_collection("documents", dimension=384)
store.insert("documents", [doc])
results = store.search("documents", query_embedding, limit=5)