Skip to main content
Every Paige project comes with a dedicated Postgres database provisioned automatically at project creation. There is nothing to configure — your bot code connects to it through the built-in dbServices.js service, and you can view and manage the data directly from the Paige dashboard. The database is isolated per project, so tables and data in one project are never accessible to another.

What the database is used for

Your bot can store and retrieve any data it needs during conversations. Common use cases include:

Contact profiles

Store names, preferences, and other details collected from contacts during conversations.

Conversation state

The system tables contacts, conversations, and messages are maintained automatically to power the conversations dashboard.

Booking and order data

Persist appointment bookings, order details, or service requests submitted via Flows or conversational intake.

Bot configuration

Store dynamic settings like business hours, menu options, or pricing that your bot reads at runtime.

System tables

Paige automatically creates and maintains three system tables in every project database: Useful columns on contacts:
on_whatsapp is worth reading carefully. Empty and false are not the same: empty means nobody has checked yet — normal for freshly imported contacts — while false means WhatsApp has confirmed the number isn’t reachable.
You can’t drop the system tables, and in Production you can’t edit their rows either. Paige uses them to know who it’s talking to and where each conversation got to — changing them by hand is how bots start behaving inexplicably.
Your bot’s execution logs and broadcast delivery records also live in the database, but they’re deliberately kept out of the Database tab — they have their own homes in Logs and the Broadcasts tab, which present them far better than a raw table would.

Creating and managing tables

You can create custom tables by asking the AI agent, or by hand in Tools → Database.

From the dashboard

The dashboard lets you:
  • View all tables and browse their data
  • Create a new table with custom columns
  • Add columns to an existing table
  • Insert, edit, and delete rows
  • Clear all rows from a table
  • Drop a custom table
  • Download a table as CSV, Excel, or JSON
  • Run SQL directly against your data
See the Database tab for how each of those works, and for the difference between your preview data and your live data.

Via the Code Agent

The Code Agent has full access to your database schema and can create and modify tables as part of building your bot. When you describe a feature that requires data storage, the agent will create the necessary tables before writing the bot code that references them. You can ask it to create tables, add columns, query rows, or seed test data — all in plain language, without leaving the chat.

Supported column types

When creating tables, you can use the following column types: text, varchar, integer, bigint, numeric, boolean, date, timestamptz, uuid, jsonb, serial
Use jsonb for flexible, semi-structured data — for example, storing a contact’s form submission as a single column rather than normalising every field into its own column.

Reading and writing from bot code

Your bot code connects to the project database automatically — no connection string or configuration required. The starter template includes a database service with pre-built helper functions for common operations (looking up contacts, recording conversations, inserting rows), and you can also write direct queries when you need more control. Ask the AI agent to write the database access code for you. For example:
“When a user submits the booking flow, save the booking to a bookings table with their name, service, date, and phone number.”
The agent will create the table if it doesn’t exist and write the code to insert the row.
Your bot code always connects to the same database visible in the dashboard. Any rows inserted by the bot appear immediately in the data browser, and any changes you make in the dashboard are visible to the bot on the next query.