Cassandra and Amazon Keyspaces AI agent: query CQL tables in plain language Connect an AI agent or MCP client to Apache Cassandra or Amazon Keyspaces with DeepORG. CQL-native queries bounded by partition keys, single-table primary-key writes, partition-bound polling subscriptions, TLS for Keyspaces, and access rules enforced by the engine. guides guides guides/cassandra-ai-agent guides/cassandra-ai-agent.md

GuidesCassandra and Keyspaces

An AI agent for Cassandra that stays inside the partition.

Cassandra punishes the query a model would naturally write: a scan across every partition. DeepORG compiles the agent’s questions into CQL that respects your primary keys, and refuses the shapes Cassandra cannot serve well instead of running them slowly.

The short version

What you get on Cassandra.

  • CQL-native queries. A read pins the full partition key and filters clustering columns in key order, so Cassandra serves it from the partitions you named.
  • Writes by primary key. Insert, update and delete one table’s rows by their full primary key.
  • Joins by partition key. A nested selection is fetched by the child table’s full partition key, in bounded batches. Subscriptions poll a partition-bound query and report what changed.
  • Refusals that say why. A query Cassandra cannot serve fails with the reason, such as which partition-key column is not pinned, so the agent can correct it rather than guess.

Connect

Cassandra or Amazon Keyspaces.

Shell
curl -fsSL https://deeporg.io/install.sh | bash
YAML
# config/dev.yml: Apache Cassandra
database:
  type: cassandra
  connection_string: cassandra://10.0.0.1,10.0.0.2
  dbname: shop                 # the keyspace
  user: ${CASSANDRA_USER}
  password: ${CASSANDRA_PASSWORD}
  consistency: LOCAL_QUORUM    # the default

Amazon Keyspaces needs TLS on port 9142 and service-specific credentials. Its certificate authority is already in the system trust store:

YAML
# config/dev.yml: Amazon Keyspaces
database:
  type: cassandra
  host: cassandra.us-east-1.amazonaws.com
  port: 9142
  dbname: shop
  user: ${KEYSPACES_USER}
  password: ${KEYSPACES_PASSWORD}
  enable_tls: true
  consistency: LOCAL_QUORUM
Shell
deeporg serve

Your AI client

Add it to Claude Code or Codex.

Shell
claude mcp add deeporg -- deeporg mcp --path /absolute/path/to/config
codex mcp add deeporg -- deeporg mcp --path /absolute/path/to/config

Your client’s model does the reasoning; DeepORG supplies the catalog, checks each query and runs it.

Limits

What Cassandra does not do, on purpose.

These are outside the query surface because Cassandra cannot serve them without a full scan:

  • No aggregates. Sums, counts and group-by belong in a warehouse or an operational SQL database.
  • No full scans. A read that does not pin the whole partition key is refused, not run across the cluster. A known-small table can opt in with cassandra: { allow_filtering: true }.
  • No or, not or pattern matching. A CQL WHERE is a conjunction of key conditions, so these are refused even on an opted-in table.
  • No full-text or geo search. Use a search index or a database that has one.

The test suite runs against Cassandra 5.

Go deeper

Related pages.