Quick Start
Get Neon Credentials
- Create account at neon.tech
- Create a new project
- Copy connection string from dashboard
Installation
- pip
- Environment Variables
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
database_url | str | None | Full PostgreSQL connection URL |
max_retries | int | 3 | Retries for cold-start recovery |
retry_delay | float | 0.5 | Base delay between retries (seconds) |
pool_size | int | 5 | Connection pool size |
auto_create_tables | bool | True | Create conversation tables automatically |
Usage Patterns
Using Convenience Class
Manual Configuration
Full Lifecycle Example
Neon-Specific Features
Database Branching
Create development branches of your agent’s data:Point-in-Time Recovery
Restore agent conversations to any point in time:Connection Pooling
Neon automatically pools connections, but you can tune for your workload:Best Practices
Optimize for Cold Starts
Optimize for Cold Starts
Neon databases auto-suspend after 5 minutes of inactivity. The first connection takes ~500ms-2s:
Use SSL Connections
Use SSL Connections
Neon requires SSL for all connections. PraisonAI auto-adds
sslmode=require:Monitor Usage
Monitor Usage
Track your database usage in the Neon dashboard:
- Compute time: Billed per second of activity
- Storage: Grows with conversation history
- Data transfer: Minimal for typical agent workloads
Handle Network Issues
Handle Network Issues
PraisonAI automatically handles transient connection failures:
Environment Variables
| Variable | Required | Format | Example |
|---|---|---|---|
NEON_DATABASE_URL | ✅ | postgresql://user:pass@host/db | postgresql://user:pass@ep-xxx.neon.tech/neondb?sslmode=require |
OPENAI_API_KEY | ✅ | sk-... | sk-1234567890abcdef... |
Troubleshooting
Cold Start Timeouts
If you see connection timeouts on first request:SSL Certificate Issues
Ensure your Neon URL includes SSL mode:Connection Pool Exhaustion
For high-concurrency agents, increase pool size:Related
Cloud Databases Overview
Compare all cloud database providers
Local PostgreSQL
Development setup with local PostgreSQL

