Overview
PostgreSQL is the most popular open-source relational database, commonly used for:- Customer records and CRM data
- Product catalogs and inventory
- Transaction logs and financial data
- Application state and configuration
Why Connect PostgreSQL?
Traditional AI agents struggle with operational data because:- Data changes constantly - Static exports become outdated quickly
- Manual exports go stale - Syncing requires constant maintenance
- Querying requires SQL knowledge - Non-technical users canβt access data easily
- Sync fresh data whenever context is needed
- Search semantically across tables and collections
- Combine database results with other data sources
- Query in natural language without writing SQL
Getting Started
To connect PostgreSQL to Alchemyst:- Navigate to the Alchemyst Integrations page
- Click Add Integration β PostgreSQL
- Provide your connection credentials
- Configure which data to sync
- Start querying your data with natural language
Connection Requirements
Prerequisites
- PostgreSQL instance (local, cloud-hosted, or managed service)
- Read-only database user (strongly recommended)
- Network access to your PostgreSQL instance
Required Information
- Connection String - Full PostgreSQL URL in format:
- Username (optional if included in URL)
- Password (optional if included in URL)
- Database Name (optional if included in URL)
- Port (default: 5432)
What Gets Indexed
Alchemyst can index and make searchable:- Tables - All rows and columns from specified tables
- Views - Materialized and regular views
- Query Results - Custom SQL query outputs
- Schema Definitions - Table structures and relationships
- Stored Procedures - Procedure outputs and results
How Data is Structured
When you sync PostgreSQL tables, Alchemyst automatically structures your data for optimal retrieval:Example Query Patterns
How to Connect
- Go to Alchemyst Integrations
- Click Add Integration β PostgreSQL
- Enter your connection details:
- Connection string or individual credentials
- Select tables or provide custom queries
- Test the connection
- Configure sync frequency and data filters
- Save and activate the integration
Connection String Examples
Local PostgreSQL
Cloud PostgreSQL (AWS RDS)
Google Cloud SQL
Best Practices
- Use read-only users - Create a dedicated service account with
SELECTpermissions only - Enable SSL/TLS - Always use encrypted connections for production data
- Whitelist IPs - Restrict database access to Alchemyst service IPs
- Index strategically - Start with critical tables, expand as needed
- Monitor performance - Watch for slow queries or high load
Security Best Practices
Access Control
- Use read-only credentials - Prevent accidental data modification
- Create dedicated service accounts - Separate Alchemyst access from application users
- Apply principle of least privilege - Grant access only to required tables/collections
Network Security
- Enable SSL/TLS encryption - Protect data in transit
- Whitelist Alchemyst IPs - Restrict database access by IP address
- Use private networks - Connect via VPN or private peering when possible
- Enable firewall rules - Block unauthorized access attempts
Ready to connect PostgreSQL? Visit the Alchemyst Integrations page to get started.

