Skip to main content

Overview

AgentOS uses PostgreSQL for:
  • Agent memory and sessions
  • Knowledge embeddings (pgvector)
  • Custom application data
RDS is created automatically by ag infra up prd:aws.

Prerequisites

Complete Secrets Setup first. The database credentials must exist before deployment.

Database Credentials

Edit infra/secrets/prd_db_secrets.yml:
Generate a secure password:
Avoid @, #, %, & in passwords. These require URL encoding and cause silent connection failures.Safe characters: alphanumeric, !, -, _

RDS Configuration

Default configuration in prd_resources.py:

Customize RDS

Edit prd_resources.py:
prd_resources.py
After changes:
Some changes (like instance class) require a reboot. Check AWS Console for status.

Connection Settings

The app connects via environment variables set automatically in prd_resources.py:

Migrations

Option 1: Run on Deployment

Add MIGRATE_DB to prd_resources.py:
prd_resources.py
Then update and redeploy:

Option 2: Run Manually via ECS Exec

Verify Connection

After deployment, verify the database is accessible:
Test connection (requires psql):

Troubleshooting