> For the complete documentation index, see [llms.txt](https://docs.interactive.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.interactive.ai/infrastructure/databases.md).

# Databases

A database is **a managed PostgreSQL instance** running inside your project. You choose the version, the resources, and the extensions, and the platform provisions it, keeps it running, and backs it up if you ask it to.

Agents use them in two ways. A database can hold the session and conversation state an agent needs between turns, which is what the Database toggle on an agent's Connections step points at. With the `vector` extension enabled it can also act as the retrieval store an agent grounds its answers against. Your own services can connect to one as well.

### Configuring a database

Creating a database is one form rather than a wizard, and Create and deploy provisions it immediately with no draft step. The panel on the left flags any section that still needs attention. The same sections make up the configuration afterwards, shown as a form or as YAML.

<div data-with-frame="true"><figure><img src="/files/pze4mgJJ2pB0nfOWzolO" alt=""><figcaption></figcaption></figure></div>

* **Identity.** The database name, set at creation and fixed after.
* **Engine.** The PostgreSQL major version, defaulting to the latest supported release.
* **Resources & Instances.** CPU and memory per instance, and how many instances to run.
* **Storage.** The size of the persistent volume.
* **Extensions.** Which PostgreSQL extensions are enabled.
* **Backups.** Whether backups run on a schedule, and how long they are kept.

### Revisions and deploying

Every deploy creates a revision. The panel on the left lists them, with the live one marked Deployed and everything before it Superseded. Compare Revisions shows what changed between any two, and Go to logs opens this database's output. See [Logs ](/governance/logs.md)under Governance.

Editing a database edits what is running, so Deploy changes takes effect immediately. Deactivate takes the database out of service without deleting it.

<div data-with-frame="true"><figure><img src="/files/7aA51N7elCpkCw9FqkAq" alt=""><figcaption></figcaption></figure></div>

Whether you can deploy depends on your role in the project. Without the permission the configuration is readable but not editable, and project roles are managed from the organization level.

### Backups

Backups are off until you turn them on. A schedule is a six-field cron expression in UTC, and retention is a number of days, weeks, or months. The Backups tab lists everything taken so far, and Back up now takes one immediately without waiting for the schedule.

Databases can also be managed from the command line. See the CLI documentation for `iai databases`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.interactive.ai/infrastructure/databases.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
