> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-docs-scavio-google-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SingleStore

> Persist Agno sessions and other data in SingleStore.

`SingleStoreDb` stores Agent, Team, and Workflow sessions, memories, knowledge, evaluations, and traces in [SingleStore](https://www.singlestore.com/).

See the [SingleStore documentation](https://docs.singlestore.com/db/v9.0/introduction/) for cluster and connection setup.

## Usage

Install the `sqlalchemy`, `pymysql`, and `openai` packages:

```shell theme={null}
uv pip install sqlalchemy pymysql openai
```

```python singlestore_for_agent.py theme={null}
from os import getenv

from agno.agent import Agent
from agno.db.singlestore import SingleStoreDb

USERNAME = getenv("SINGLESTORE_USERNAME")
PASSWORD = getenv("SINGLESTORE_PASSWORD")
HOST = getenv("SINGLESTORE_HOST")
PORT = getenv("SINGLESTORE_PORT")
DATABASE = getenv("SINGLESTORE_DATABASE")
db_url = (
    f"mysql+pymysql://{USERNAME}:{PASSWORD}@{HOST}:{PORT}/{DATABASE}?charset=utf8mb4"
)

db = SingleStoreDb(db_url=db_url)
agent = Agent(db=db)
```

## Parameters

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