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

# Data Stores

> Structured knowledge bases — a real SQL database your agents manage and your apps read and write live

## Overview

A **Data Store** is a type of [knowledge base](/features/knowledge-bases) that holds
*structured data* instead of files. Where a document knowledge base stores files
and lets agents search their text, a data store is a real **Postgres database**:
tables, rows, and columns that your agents design and manage, and that your
[apps](/features/apps) can read and write **live**.

Reach for a data store when your agents need to track **state that changes over
time** rather than cite fixed source material:

| Use a document knowledge base when…                                      | Use a data store when…                                                    |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------- |
| Agents **cite** source material (reports, contracts, research, policies) | Agents **track and update** state (pipelines, trackers, registries, logs) |
| Content is uploaded and searched                                         | Rows are created and edited over time                                     |
| You want semantic search                                                 | You want filtering, sorting, aggregation, and live updates                |

A simple rule of thumb: **cite it → document KB; update it → data store.**

## Isolation and security

Every organization's data stores live in a **dedicated, private database**,
separate from every other organization and from Aster's own platform database.
Access always flows through Aster's API — connection strings are never exposed to
agents, apps, or browsers, and each data store is reachable only by its own
scoped database role. Cross-organization access is impossible at the database
level, not merely disallowed.

## Creating a data store

<Steps>
  <Step title="From Control Hub" icon="table">
    Go to **Control Hub → Knowledge Bases → New**, give it a name, and choose
    the **Data Store** type. The first data store in your organization takes a
    few seconds to provision its database; after that, creation is instant.
  </Step>

  <Step title="Or let an agent create it" icon="robot">
    An agent with the `manage_knowledge_bases` tool can create a data store
    directly (`action: create`, `type: structured`) as part of building a
    solution.
  </Step>
</Steps>

## How agents work with a data store

Agents interact with a data store through three tools. Grant them to an agent and
point them at the data store(s) it should reach.

* **[`manage_data_store`](/tools/manage_data_store)** — evolve the schema:
  create tables, add or alter columns, create indexes, and create **views**
  (saved SQL that apps can read like a table). Destructive changes require
  explicit confirmation.
* **[`query_data_store`](/tools/query_data_store)** — read with full SQL
  `SELECT` (joins, aggregates, `GROUP BY`, window functions, CTEs). Large
  results are returned as an attached CSV.
* **[`write_data_store`](/tools/write_data_store)** — `insert`, `update`,
  `delete`, `upsert`, and atomic multi-statement `batch` writes.

The agent always sees its data stores' current schema in its context, so it knows
what tables and columns exist without having to ask.

## The data explorer

Open a data store in Control Hub and you get a built-in explorer:

* A **table list** on the left and a **live row preview** on the right.
* **Pagination** through large tables.
* **Export** — download any single table, or the entire store, as CSV at any
  time. Your data is always yours to take.

## Live data in apps

This is where data stores shine. An [app](/features/apps#live-data) bound to a
data store can read and write rows **live** — a user checks a box or edits a
value and the change is saved instantly, visible to teammates on their next
refresh. There is no staging step and no need to republish the app. See
[Apps → Live data](/features/apps#live-data) for how app builders use the
`useLiveTable` and `useDataStore` hooks.

## What a data store is not

* **Not a document store.** It holds no files; file upload, semantic search, and
  extraction schemas don't apply. Use a document [knowledge base](/features/knowledge-bases)
  for those.
* **Not a connection to an external database.** A data store is Aster-managed
  infrastructure. To work with a system your organization already runs, use that
  system's integration instead.
