Skip to main content
Neon provides serverless PostgreSQL with automatic scaling, branching, and point-in-time recovery for your AI agents.
The user chats with an agent; Neon wakes on demand, stores session state, and scales to zero when idle.

How It Works

Quick Start

1

Get Neon Credentials

  1. Create account at neon.tech
  2. Create a new project
  3. Copy connection string from dashboard
2

Create Agent with Neon

3

Test Persistence


Installation


Configuration Options


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

Neon databases auto-suspend after 5 minutes of inactivity. The first connection takes ~500ms-2s:
Neon requires SSL for all connections. PraisonAI auto-adds sslmode=require:
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
Set up alerts before hitting free tier limits (0.5GB storage, 100 hours compute/month).
PraisonAI automatically handles transient connection failures:

Environment Variables


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:

Cloud Databases Overview

Compare all cloud database providers

Local PostgreSQL

Development setup with local PostgreSQL