Skip to main content
Tables provide typed, structured storage for your agent. You define a schema using z from @botpress/runtime, and the ADK syncs it with Botpress on deploy. Tables are accessible from conversations, workflows, actions, tools, and triggers.

Creating a table

Create a file in src/tables/:
The description field is optional but useful when the table gets surfaced to the LLM (via Zai or knowledge). keyColumn is optional too; it sets the default key used when calling .upsertRows() so you don’t have to pass it on every call.
Tables page in dev console

Naming rules

Table names:
  • Must start with a letter, underscore, or $
  • Must be 35 characters or less
  • Must contain only letters, numbers, and underscores
  • Must end with Table
  • Cannot be a UUID

Searchable columns

You can mark columns as searchable to enable semantic search:

Computed columns

A computed column is derived from other columns. Set computed: true, pass the columns it depends on into dependencies, and return its value from value:
Computed columns recalculate whenever their dependencies change. When you write to the table, you can pass waitComputed: true to block any further modifications to the table until the recalculation finishes:

Managing table data

You can manage your table data in the dev console under Data > Tables. Here, you can:
  • View the sync state between your code and Botpress’ servers
  • Add/update/delete rows
  • Filter and sort
  • Export to CSV
  • Copy data between development and production environments

CRUD operations

To perform operations on your table within your agent’s code, import the table and use the typed instance methods.

Create rows

Find rows

Get a single row

Update rows

Upsert rows

Insert or update based on a key column:
If you set keyColumn on the table, you can omit it here.
If keyColumn is omitted on both the table defintion and the upsertRows call, it defaults to id.

Delete rows

Filtering

When calling findRows(), you can pass in filters for specific rows. These can use MongoDB-style operators for advanced queries:

Operators

Logical operators

You can combine filters with $and, $or, and $not:
You can search across searchable columns using natural language:
Combine with filters for hybrid queries:

Aggregation

Aggregation groups rows by one or more columns and computes summary statistics for other columns. This transforms your table data into summary reports. Pass a group object to findRows() where each key is a column name and the value is either a single operation or an array of operations:
The returned rows have different fields based on your group configuration. The field names combine the column name (in camelCase) with the operation:
Operations vary by column type:
Last modified on April 27, 2026