Skip to main content

Neon

Serverless PostgreSQL with automatic scaling. Neon is fully compatible with PraisonAI’s PostgreSQL conversation store.

Setup

pip install psycopg2-binary
Get your connection string from Neon Console.

Quick Start (Agent)

Use Neon for conversation persistence with an agent:
from praisonaiagents import Agent, db
import os

agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant.",
    db=db(database_url=os.getenv("NEON_DATABASE_URL")),
    session_id="my-session"
)

agent.chat("Hello!")

Advanced Usage (Direct Store)

from praisonai.persistence.factory import create_conversation_store

# Neon uses PostgreSQL-compatible connection
store = create_conversation_store(
    "postgres",
    url="postgresql://user:[email protected]/neondb?sslmode=require"
)

Environment Variables

export NEON_DATABASE_URL="postgresql://user:[email protected]/neondb?sslmode=require"

CLI

praisonai persistence run \
    --conversation-backend postgres \
    --conversation-url "$NEON_DATABASE_URL" \
    "Hello"

Configuration

OptionDescription
urlNeon connection URL (with ?sslmode=require)
table_prefixTable name prefix (default: praisonai_)

Features

  • Serverless: Auto-scales to zero when idle
  • Branching: Create database branches for dev/test
  • PostgreSQL Compatible: Works with all PostgreSQL features
  • SSL Required: Always use ?sslmode=require

Best For

  • Serverless deployments
  • Development and testing
  • Projects with variable load
  • Teams needing database branching