Skip to main content
Connect your agent to a PostgreSQL database to query, insert, and manage data

Capabilities

Once connected, your agent can read and write to your PostgreSQL database.
  • Query tables with filters, joins, and sorting
  • Insert, update, and delete records
  • Inspect database schemas and column types
  • Run aggregations and analytics queries
  • Create tables and indexes
  • Export query results

Setup Guide

Follow these steps to connect PostgreSQL to your instances.

1. Get your connection string

Copy the connection string from your database provider (Neon, Supabase, Railway, etc.). It should look like:
postgresql://user:password@host:5432/dbname

2. Store the connection string in Environment

Go to Environment and create a new variable:
  • Name: DATABASE_URL Value: Your full PostgreSQL connection string
The agent uses DATABASE_URL to connect via Node.js. A single connection string is all you need.

3. Grant access to instances

Choose how instances should access the connection string:
  • Option A: Global Access (All instances) — Toggle “Make globally accessible” when creating the secret.
  • Option B: Instance-Specific (Selective access) — In Environment, open the secret and grant the specific instance access.

Usage Examples

Ask your agent to interact with your database using natural language. Query data
“Show me all users who signed up in the last 7 days”
Insert a record
“Add a new product called ‘Widget Pro’ priced at $29.99 to the products table”
Inspect schema
“What tables exist in the database and what are their columns?”