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

# Async SQLite

> Store agent sessions and run history asynchronously in SQLite with AsyncSqliteDb.

`AsyncSqliteDb` stores Agent sessions and run history asynchronously in [SQLite](https://www.sqlite.org/). Use async Agent methods such as `arun()` and `aprint_response()`.

## Usage

Install the `sqlalchemy` asyncio extra, `aiosqlite`, and `openai`:

```shell theme={null}
uv pip install "sqlalchemy[asyncio]" aiosqlite openai
```

`AsyncSqliteDb` uses an async `db_engine`, then `db_url`, then `db_file`. A `db_url` must use an async driver such as `sqlite+aiosqlite`. If none is provided, it creates `agno.db` in the current directory.

```python async_sqlite_for_agent.py theme={null}
from agno.agent import Agent
from agno.db.sqlite import AsyncSqliteDb

db = AsyncSqliteDb(db_file="tmp/data.db")

agent = Agent(db=db)
```

## Parameters

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