> ## 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.

# SQLite for Agent

> Store agent sessions and run history in a local SQLite database with SqliteDb.

`SqliteDb` stores an Agent's sessions and run history in SQLite.

## Usage

Provide `db_url`, `db_file` or `db_engine`. If none is provided, a database file named `agno.db` is created in the current directory. The following example uses `db_file`.

Install dependencies:

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

```python sqlite_for_agent.py theme={null}
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.tools.websearch import WebSearchTools

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

agent = Agent(
    db=db,
    tools=[WebSearchTools()],
    add_history_to_context=True,
    add_datetime_to_context=True,
)

agent.print_response("How many people live in Canada?")
agent.print_response("What is their national anthem?")
agent.print_response("List my messages one by one")
```

## Parameters

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