Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions _snippets/db-scylladb-params.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
| Parameter | Type | Default | Description |
| ---------------------------- | --------------- | ------- | -------------------------------------------------------- |
| `id` | `Optional[str]` | - | The ID of the database instance. UUID by default. |
| `db_client` | `Optional[Any]` | - | The DynamoDB-compatible client to use (point at Alternator). |
| `region_name` | `Optional[str]` | - | AWS region name. Ignored by Alternator but required by boto3. |
| `aws_access_key_id` | `Optional[str]` | - | Access key ID. Any non-empty value works with Alternator. |
| `aws_secret_access_key` | `Optional[str]` | - | Secret access key. Any non-empty value works with Alternator. |
| `session_table` | `Optional[str]` | - | The name of the session table. |
| `memory_table` | `Optional[str]` | - | The name of the memory table. |
| `metrics_table` | `Optional[str]` | - | The name of the metrics table. |
| `eval_table` | `Optional[str]` | - | The name of the eval table. |
| `knowledge_table` | `Optional[str]` | - | The name of the knowledge table. |
| `culture_table` | `Optional[str]` | - | The name of the cultural knowledge table. |
| `traces_table` | `Optional[str]` | - | The name of the traces table. |
| `spans_table` | `Optional[str]` | - | The name of the spans table. |
8 changes: 8 additions & 0 deletions database/providers/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ Agno supports the following database providers organized by category:
>
Amazon DynamoDB NoSQL database.
</Card>
<Card
title="ScyllaDB"
icon="database"
iconType="duotone"
href="/database/providers/scylladb/overview"
>
ScyllaDB integration (via DynamoDB API).
</Card>
<Card
title="Firestore"
icon="fire"
Expand Down
66 changes: 66 additions & 0 deletions database/providers/scylladb/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: ScyllaDB
description: Use ScyllaDB for agent session storage and persistence.
sidebarTitle: Overview
---

[ScyllaDB](https://www.scylladb.com/) exposes a DynamoDB-compatible API called
[Alternator](https://docs.scylladb.com/manual/stable/alternator/alternator.html).
Because of this, Agno's `DynamoDb` class works with ScyllaDB out of the box.

## Setup

Install the `boto3` and `openai` packages:

```shell
uv pip install boto3 openai
```

Run ScyllaDB with Alternator enabled:

```shell
docker run -d --name scylla \
-p 9042:9042 -p 8000:8000 \
scylladb/scylla:latest \
--alternator-port 8000 \
--alternator-write-isolation=only_rmw_uses_lwt \
--smp 1
```

<Warning>
Run Alternator with a safe write-isolation mode. Use
`--alternator-write-isolation=only_rmw_uses_lwt` (used throughout these docs) or
`always`.
</Warning>

## Usage

Build a `boto3` client whose `endpoint_url` points at the Alternator port, then pass it to
`DynamoDb`. Alternator ignores credentials by default, but `boto3` requires some non-empty
values, so any region and keys work.

```python scylladb_for_agent.py
import boto3

from agno.agent import Agent
from agno.db.dynamo import DynamoDb

# boto3 client pointed at ScyllaDB Alternator (instead of AWS DynamoDB)
client = boto3.client(
"dynamodb",
endpoint_url="http://localhost:8000",
region_name="us-east-1",
aws_access_key_id="alternator",
aws_secret_access_key="alternator",
)

# Setup your Database using the ScyllaDB Alternator client
db = DynamoDb(db_client=client)

# Setup your Agent with the Database
agent = Agent(db=db)
```

## Params

<Snippet file="db-scylladb-params.mdx" />
51 changes: 51 additions & 0 deletions database/providers/scylladb/usage/scylladb-for-agent.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: ScyllaDB for Agent
sidebarTitle: Agent
---

Agno supports using ScyllaDB as a storage backend for Agents using the `DynamoDb` class
through ScyllaDB's DynamoDB-compatible [Alternator](https://docs.scylladb.com/manual/stable/alternator/alternator.html)
API.

## Usage

Install dependencies:

```shell
uv pip install agno boto3 openai
```

Run ScyllaDB with Alternator enabled (`--alternator-port 8000 --alternator-write-isolation=only_rmw_uses_lwt`),
then build a `boto3` client pointed at the Alternator endpoint and pass it to `DynamoDb` via
`db_client`.

<Warning>
Run Alternator with a safe write-isolation mode. Use
`--alternator-write-isolation=only_rmw_uses_lwt` (used throughout these docs) or
`always`.
</Warning>

```python scylladb_for_agent.py
import boto3

from agno.agent import Agent
from agno.db.dynamo import DynamoDb

# boto3 client pointed at ScyllaDB Alternator
client = boto3.client(
"dynamodb",
endpoint_url="http://localhost:8000",
region_name="us-east-1",
aws_access_key_id="alternator",
aws_secret_access_key="alternator",
)

db = DynamoDb(db_client=client)

# Add storage to the Agent
agent = Agent(db=db)
```

## Params

<Snippet file="db-scylladb-params.mdx" />
93 changes: 93 additions & 0 deletions database/providers/scylladb/usage/scylladb-for-team.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
title: ScyllaDB for Team
sidebarTitle: Team
---

Agno supports using ScyllaDB as a storage backend for Teams using the `DynamoDb` class
through ScyllaDB's DynamoDB-compatible [Alternator](https://docs.scylladb.com/manual/stable/alternator/alternator.html)
API.

## Usage

Run ScyllaDB with Alternator enabled (`--alternator-port 8000 --alternator-write-isolation=only_rmw_uses_lwt`),
then build a `boto3` client pointed at the Alternator endpoint and pass it to `DynamoDb` via
`db_client`.

<Warning>
Run Alternator with a safe write-isolation mode. Use
`--alternator-write-isolation=only_rmw_uses_lwt` (used throughout these docs) or
`always`.
</Warning>

Install dependencies:

```shell
uv pip install agno boto3 openai ddgs
```

```python scylladb_for_team.py
from typing import List

import boto3

from agno.agent import Agent
from agno.db.dynamo import DynamoDb
from agno.models.openai import OpenAIResponses
from agno.team import Team
from agno.tools.hackernews import HackerNewsTools
from agno.tools.websearch import WebSearchTools
from pydantic import BaseModel

# boto3 client pointed at ScyllaDB Alternator
client = boto3.client(
"dynamodb",
endpoint_url="http://localhost:8000",
region_name="us-east-1",
aws_access_key_id="alternator",
aws_secret_access_key="alternator",
)

# Setup the ScyllaDB database
db = DynamoDb(db_client=client)

class Article(BaseModel):
title: str
summary: str
reference_links: List[str]

hn_researcher = Agent(
name="HackerNews Researcher",
model=OpenAIResponses(id="gpt-5.2"),
role="Gets top stories from hackernews.",
tools=[HackerNewsTools()],
)

web_searcher = Agent(
name="Web Searcher",
model=OpenAIResponses(id="gpt-5.2"),
role="Searches the web for information on a topic",
tools=[WebSearchTools()],
add_datetime_to_context=True,
)

hn_team = Team(
name="HackerNews Team",
model=OpenAIResponses(id="gpt-5.2"),
members=[hn_researcher, web_searcher],
db=db,
instructions=[
"First, search hackernews for what the user is asking about.",
"Then, ask the web searcher to search for each story to get more information.",
"Finally, provide a thoughtful and engaging summary.",
],
output_schema=Article,
markdown=True,
show_members_responses=True,
)

hn_team.print_response("Write an article about the top 2 stories on hackernews")
```

## Params

<Snippet file="db-scylladb-params.mdx" />
108 changes: 108 additions & 0 deletions database/providers/scylladb/usage/scylladb-for-workflow.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
title: ScyllaDB for Workflow
sidebarTitle: Workflow
---

Agno supports using ScyllaDB as a storage backend for Workflows using the `DynamoDb` class
through ScyllaDB's DynamoDB-compatible [Alternator](https://docs.scylladb.com/manual/stable/alternator/alternator.html)
API.

## Usage

Run ScyllaDB with Alternator enabled (`--alternator-port 8000 --alternator-write-isolation=only_rmw_uses_lwt`),
then build a `boto3` client pointed at the Alternator endpoint and pass it to `DynamoDb` via
`db_client`.

<Warning>
Run Alternator with a safe write-isolation mode. Use
`--alternator-write-isolation=only_rmw_uses_lwt` (used throughout these docs) or
`always`.
</Warning>

Install dependencies:

```shell
uv pip install agno boto3 openai ddgs
```

```python scylladb_for_workflow.py
import boto3

from agno.agent import Agent
from agno.db.dynamo import DynamoDb
from agno.models.openai import OpenAIResponses
from agno.team import Team
from agno.tools.hackernews import HackerNewsTools
from agno.tools.websearch import WebSearchTools
from agno.workflow.step import Step
from agno.workflow.workflow import Workflow

# boto3 client pointed at ScyllaDB Alternator
client = boto3.client(
"dynamodb",
endpoint_url="http://localhost:8000",
region_name="us-east-1",
aws_access_key_id="alternator",
aws_secret_access_key="alternator",
)

db = DynamoDb(db_client=client)

# Define agents
hackernews_agent = Agent(
name="HackerNews Agent",
model=OpenAIResponses(id="gpt-5.2"),
tools=[HackerNewsTools()],
role="Extract key insights and content from HackerNews posts",
)
web_agent = Agent(
name="Web Agent",
model=OpenAIResponses(id="gpt-5.2"),
tools=[WebSearchTools()],
role="Search the web for the latest news and trends",
)

# Define research team for complex analysis
research_team = Team(
name="Research Team",
members=[hackernews_agent, web_agent],
instructions="Research tech topics from HackerNews and the web",
)

content_planner = Agent(
name="Content Planner",
model=OpenAIResponses(id="gpt-5.2"),
instructions=[
"Plan a content schedule over 4 weeks for the provided topic and research content",
"Ensure there are 3 posts per week",
],
)

# Define steps
research_step = Step(
name="Research Step",
team=research_team,
)

content_planning_step = Step(
name="Content Planning Step",
agent=content_planner,
)

# Create and use workflow
if __name__ == "__main__":
content_creation_workflow = Workflow(
name="Content Creation Workflow",
description="Automated content creation from blog posts to social media",
db=db,
steps=[research_step, content_planning_step],
)
content_creation_workflow.print_response(
input="AI trends in 2024",
markdown=True,
)
```

## Params

<Snippet file="db-scylladb-params.mdx" />
Loading