Skip to content
Browse the docs Databases

Databases

The database integration lets an expert answer from your own business data, for example totals, counts and comparisons across every row of a table, and not only from the documents you upload. You save a query that reads from your database. Aimy runs it on a schedule and turns the result into a document in your Knowledge Base.

Not on the standard plans. Databases is not part of Business or Professional. It holds a login to your own database, so it is switched on account by account. The menu row appears under Integrations only where it is on. If you want it, send a ticket from Submit a ticket in your account menu, or contact sales. If you open the page directly on an account without it, the page says it is not on your plan and offers a Contact us button.

If your account does have it, you will find it as Database under Integrations in the CONNECT section. The page has two lists: Connections and Datasets.

How it works

An expert never talks to your database. Aimy runs your saved query, stores the rows it returns as a spreadsheet style document, and the expert answers from that document like any other. That keeps your database login away from the AI and means a question cannot be turned into a query against your systems.

The trade off is freshness. An answer is only as new as the last refresh. A question about today's orders is answered from the most recent run, not from the live table.

Create a read only account first

Ask your database administrator for a user that can only read. It should have GRANT SELECT and nothing else, and only on the tables or views you want the expert to see. Aimy checks every query to make sure it only reads, but that check is a safety net. The real protection is the permissions on your side, and the database enforces them.

Whatever your query returns is stored and can be quoted in answers. Aimy cannot hide a column for you. If a column must not be exposed, leave it out of the query.

Add a connection

  1. Choose Add connection at the top right.
  2. Fill in Name, Type (MySQL or MariaDB, or PostgreSQL), Host, Port, Database, Username and Password. A type marked as missing a driver cannot be used on this server yet.
  3. Choose Test connection to check the details.
  4. Choose Save.

The password is stored encrypted and is never shown again. When you edit a connection, leave the password as it is to keep the saved one. Untick Active to pause a connection.

Add a dataset

A dataset is one saved query. Add dataset appears once you have a connection.

  1. Choose Add dataset.
  2. Give it a Name, for example Invoices 2026, and choose the Connection it reads from.
  3. Write the Query. It must be a single SELECT or WITH statement. Queries that write, change or read files are refused.
  4. Set the Row cap. It starts at 50000 and can go up to 200000. Rows beyond the cap are left out.
  5. Choose how often to refresh with Refresh every: Manual only, Hour, 6 hours, Day or Week. It starts on Day.
  6. Leave Refresh this dataset automatically ticked, which it is by default, if you want the schedule to run. Untick it to pause the dataset. A paused dataset shows paused under its name and is skipped, even when you choose Refresh now. Tick the box again to resume.
  7. Choose a Folder in the Knowledge Base for the result, or leave Root.
  8. Choose Preview 20 rows to see what the query returns before you save it.
  9. Choose Save.

Each dataset owns exactly one document. Every refresh replaces that document, so the expert never answers from two versions of the same report.

Read the lists

The Connections list shows each connection's name, server, user and whether it is active or paused. The Datasets list shows the name, the connection it comes from, the number of rows from the last run with the row cap under it, the refresh schedule, and the time and status of the last run. A note under the status says what happened.

A connection shows one of two words in its Status column. active means it is in use. paused means you unticked Active, and none of its datasets will refresh. A dataset's last run can show one of these.

  • running. A refresh is in progress right now. Reload the page in a moment to see the result.
  • ok. The last refresh worked. The note under it says how many rows and columns came back.
  • error. The last refresh failed, and the note says why. The document from the last good run stays in the Knowledge Base until a refresh works. See the list further down for common causes.

A dataset that has never run shows Never as its last run time and no status.

  • Refresh now runs the query straight away.
  • Edit changes a connection or dataset.
  • Remove deletes it. For a dataset you can also tick Also delete the document it produced, which removes the file and what Aimy learned from it. Otherwise the last document stays in the Knowledge Base.

Scheduled datasets are picked up by a check that runs every fifteen minutes, so a refresh can start a little after its due time.

If a dataset shows an error

  • Could not connect. Check the host, port, database name and login, and that your database accepts connections from Aimy's server.
  • The query must start with SELECT or WITH, or contains a word that is not allowed. Rewrite it as a plain read.
  • The query returned no rows. Loosen the query, or check the data is there.