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

# Valkey

> Use Valkey for agent session storage and persistence.

Agno supports using [Valkey](https://valkey.io/) as a database with the `ValkeyDb` class.

## Usage

### Run Valkey

Install [docker desktop](https://docs.docker.com/desktop/install/mac-install/) and run **Valkey** on port **6379** using:

```bash theme={null}
docker run -d \
  --name my-valkey \
  -p 6379:6379 \
  valkey/valkey
```

```python valkey_for_agent.py theme={null}
from agno.agent import Agent
from agno.db.valkey import ValkeyDb

# Initialize Valkey db
db = ValkeyDb(
    host="localhost",
    port=6379,
)

# Create agent with Valkey db
agent = Agent(db=db)
```

## Params

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