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

# Database

> Every agent has a database of its own. Ask your agent to keep what matters, then open, search, and export the tables yourself.

Every agent has a database of its own. When your agent saves something there, it is still there on the next run — hours or weeks later — so an agent can add up totals over time, remember what it has already handled, and build on its own earlier work.

You don't switch this on and there is nothing to set up. Ask your agent to keep track of something, and it saves it.

<Frame caption="One database per agent, carried from one run to the next.">
  <img className="block dark:hidden" src="https://mintcdn.com/dataleap-469bb19d/qWc0WiCdZjjcZYiX/images/agent-database-light.svg?fit=max&auto=format&n=qWc0WiCdZjjcZYiX&q=85&s=fa854829b6398f97664e8c1c589a36c8" alt="Diagram: three runs of the same agent all write into one database that belongs to that agent, and a person opens that database in a read-only viewer" width="760" height="300" data-path="images/agent-database-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/dataleap-469bb19d/qWc0WiCdZjjcZYiX/images/agent-database-dark.svg?fit=max&auto=format&n=qWc0WiCdZjjcZYiX&q=85&s=36b04cff02e09eda22fab17d9302445a" alt="Diagram: three runs of the same agent all write into one database that belongs to that agent, and a person opens that database in a read-only viewer" width="760" height="300" data-path="images/agent-database-dark.svg" />
</Frame>

## Knowledge and the database are different things

| | What it holds | Who puts it there |
| - | - | - |
| **Knowledge** | Reference files you upload for your agent to read | You |
| **Database** | Rows your agent writes down as it works | Your agent |

[Knowledge](/build/add-knowledge) is what you give your agent to read. The database is what your agent writes down for itself.

## Ask your agent to keep something

Say what should be remembered and why. Your agent works out the tables it needs. Use these prompts as a starting point:

| You want to | Ask your agent |
| - | - |
| Never handle the same item twice | "Keep a record of every invoice you process, so you never process the same one twice." |
| Follow a number over time | "Save the weekly totals you report, so you can show me the trend later." |
| Remember who you've already reached | "Remember which candidates you've already contacted, and when." |
| Compare against earlier runs | "Compare this week's totals with the last four weeks you saved." |
| See what's stored | "What have you saved so far? List your tables and what each one holds." |
| Fix a wrong entry | "Remove the duplicate entry for invoice 1042 from your records." |
| Start fresh | "Clear the weekly totals and start tracking again from today." |

Your agent reads that data back on later runs, so a comparison like the one above draws on real history instead of starting from zero.

## Open the data yourself

<Steps>
  <Step title="Open the Database tab">
    Click **Workflow** in the top right and open the **Database** tab. It lists the tables your agent has saved under **Tables saved by this agent**, each with a row count.

    If you see **No database yet**, your agent hasn't stored anything — it creates its database the first time it saves data.

    <Frame caption="The Database tab on an agent.">
      <img src="https://mintcdn.com/dataleap-469bb19d/qWc0WiCdZjjcZYiX/images/agent-database-tab.png?fit=max&auto=format&n=qWc0WiCdZjjcZYiX&q=85&s=2fe9308b3199904c46616721756e8d8c" alt="The Database tab on an agent's page" width="2976" height="1854" data-path="images/agent-database-tab.png" />
    </Frame>
  </Step>

  <Step title="Click View data">
    **View data** opens the database on its own page in a new browser tab.
  </Step>

  <Step title="Pick a table and read it">
    Choose a table from **Tables** on the left. Click any column heading to sort by it, and use **Previous** and **Next** to move through the rows.

    <Frame caption="A table open in the read-only viewer.">
      <img src="https://mintcdn.com/dataleap-469bb19d/qWc0WiCdZjjcZYiX/images/agent-database-view.png?fit=max&auto=format&n=qWc0WiCdZjjcZYiX&q=85&s=85093bd80269bb4e1065a393fe783d37" alt="The read-only database viewer with a table open" width="2978" height="1850" data-path="images/agent-database-view.png" />
    </Frame>
  </Step>
</Steps>

## Search every row

The search box above the table searches the whole table, not just the page you are looking at. It matches your text against every column, so you can find a row by an order number, a name, or anything else it contains.

## Export a table

Click **Export**, then choose **Export as CSV** or **Export as Excel**.

The file matches what you are looking at. If a search is active you get only the matching rows, sorted the way you sorted them on screen. A single export is capped at 32 MiB — for a very large table, choose CSV, which is the smaller format.

## What you can't do in the viewer

The page is marked **Read only**, and that is the whole story: you can read, sort, search, and download, but you can't add, edit, or delete a row there. To correct or clear out what's stored, ask your agent to do it.

## Who can see it

Access follows the agent. Anyone who can view the agent can open its database, and nobody else can — the page asks them to sign in first. [Use-only](/share/use-only) access to an agent is not enough to open its database.

## Before you rely on it

| If you | What happens to the data |
| - | - |
| Restore an earlier version of the agent | Nothing. Restoring covers your agent's setup and files; its database is not rolled back with them. |
| Copy the agent, or use it as a template | The new agent starts with an empty database of its own. Nothing is copied across. |
| Archive the agent | The database closes straight away and nobody can open it. |

<Warning>
  An archived agent's database is deleted 10 days after you archive it, and un-archiving after that does not bring the data back. Export anything you want to keep before you archive an agent.
</Warning>

## Related

<CardGroup cols={2}>
  <Card title="Triggers" icon="bolt" href="/build/triggers">
    Next: make the agent run automatically.
  </Card>

  <Card title="Add knowledge" icon="book-open" href="/build/add-knowledge">
    Upload the reference files you want your agent to read.
  </Card>

  <Card title="Versioning" icon="clock-rotate-left" href="/build/versioning">
    Restore your agent's setup without touching what it has stored.
  </Card>
</CardGroup>
