Skip to main content

Documentation Index

Fetch the complete documentation index at: https://howto.paigeme.dev/llms.txt

Use this file to discover all available pages before exploring further.

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:
TableDescription
contactsOne row per unique phone number that has messaged the bot
conversationsOne row per conversation, linked to a contact; stores the current state
messagesEvery inbound and outbound message, linked to a conversation
You cannot drop or modify the system tables (contacts, conversations, messages). They are managed by Paige and power the conversations dashboard.

Creating and managing tables

You can create custom tables from the Database section of the dashboard or by asking the AI agent.

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

Via the AI agent

The AI agent in the bot code chat 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. The agent has access to the following database tools:
ToolWhat it does
create_tableCreate a table with specified columns and types
list_tablesList all tables and their schemas
describe_tableGet detailed column info for a single table
add_columnAdd a column to an existing table
drop_tableDrop a custom table
query_tableRead rows from a table (useful for debugging)
insert_rowsInsert seed data or test records

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.