TL;DR
Neon's branching model, serverless driver, and scale-to-zero autoscaling make it one of the most practical Postgres hosts for teams building AI agents and preview-heavy apps. Here is what you need to know before committing.
Read next
Four mature, production-ready TypeScript frameworks have made building agents genuinely enjoyable. Here is how to pick the right one - and how they fit together.
10 min readEvery major AI coding tool just went through a pricing shift. Here are the exact numbers for Cursor, GitHub Copilot, Claude Code, Windsurf/Devin, and the Anthropic API - verified from live pricing pages on June 10, 2026.
9 min readPgDog raised $5.5M to bring transparent Postgres sharding and connection pooling to any stack. Here is what it actually does, how it compares to PgBouncer and Citus, and the honest answer to whether you need it.
8 min readPostgres has become the default database for AI-native apps. It handles vectors via pgvector, JSON blobs for agent memory, relational data for user records, and structured outputs from language models. The question in 2026 is not whether to use Postgres. It is which host gives you the operational model that fits how AI apps actually behave.
Neon positions itself as "the backend for apps and agents," and after digging through the live documentation and pricing pages, that framing holds up better than most marketing claims do.
Last updated: June 10, 2026
Neon is a serverless Postgres platform built around two ideas that most managed Postgres services ignore: storage and compute are separated, and every database is a tree of copy-on-write branches.
The storage separation enables autoscaling and scale-to-zero. When no queries arrive, the compute pauses completely and you stop paying for it. When traffic resumes, it wakes in seconds. The branching architecture means you can clone your entire database, with all its data, in the time it takes to run a CLI command.
Both of these features have obvious uses for traditional web apps. For AI builders specifically, they unlock a set of patterns that would otherwise require significant infrastructure work: per-agent isolated databases, throwaway sandboxes for code-interpreting agents, and preview environments that carry real production data into every pull request.
Neon branches are copy-on-write clones of a parent database. Creating a branch does not duplicate the underlying storage immediately. Writes to the branch are saved as deltas, so a fresh branch costs almost nothing until it diverges significantly from its parent.
The practical consequence is that you can treat branches the way you treat git branches. Some patterns that follow from this:
Neon supports branch creation via the console, the neonctl CLI, the Neon API, and a first-party GitHub Actions integration. The Vercel integration creates a branch automatically for every preview deployment.
Branches support instant restore. If a migration goes wrong, you can roll the branch back to any point within the project's history window: 6 hours on the Free plan, 7 days on Launch, and 30 days on Scale.
Every Neon compute can scale to zero. When no connections arrive, the compute pauses. Cold start latency is in the low seconds, which is acceptable for most workloads and irrelevant for agent jobs that batch their work.
Autoscaling adjusts compute size up and down between a minimum and maximum CU (compute unit) threshold you configure. A 1 CU maps to 1 vCPU and 4 GB of RAM. The Free plan goes up to 2 CU, Launch up to 16 CU, and Scale up to 56 CU (224 GB RAM).
For AI workloads, scale-to-zero is particularly valuable during development. If you are running 50 per-agent branches for a prototype, the branches that see no traffic cost nothing. You only pay for the branches that are actively processing.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
From the archive
Jun 10, 2026 • 7 min read
Jun 10, 2026 • 9 min read
Jun 10, 2026 • 8 min read
Jun 10, 2026 • 8 min read
Neon publishes an official JavaScript/TypeScript package called @neondatabase/serverless. It is a low-latency Postgres driver that routes queries over HTTP or WebSockets instead of TCP. The HTTP path is optimized for single one-shot queries in edge and serverless environments where establishing a persistent TCP connection is impractical or expensive.
Install it:
npm install @neondatabase/serverlessThe driver is also available as a JSR package at jsr:@neon/serverless for Deno and other runtimes.
Basic HTTP query pattern:
import { neon } from '@neondatabase/serverless';
const sql = neon(process.env.DATABASE_URL!);
// Template literal usage - parameterized automatically
const userId = 42;
const rows = await sql`SELECT * FROM users WHERE id = ${userId}`;
// Explicit parameterized form
const rows2 = await sql.query('SELECT * FROM users WHERE id = $1', [userId]);
Use HTTP for stateless, single-transaction queries in Vercel Edge Functions, Cloudflare Workers, or AWS Lambda. Use WebSockets when you need session state or interactive transactions with the familiar pg API.
The driver requires Node.js 19 or higher (v1.0.0 and above). TypeScript types are bundled; no @types package needed.
# Install the CLI
npm install -g neonctl
# Authenticate
neonctl auth
# Create a project (creates a main branch automatically)
neonctl projects create --name my-ai-app
# Get your connection string
neonctl connection-string
# Or use the guided one-command setup
npx neonctl@latest init
The npx neonctl@latest init command is AI-guided: it creates a project, applies your schema, and writes a .env file in a single step.
To create a branch for a feature or agent session:
# Create a branch from main
neonctl branches create --name agent-session-abc123
# Create a branch with a TTL (auto-deletes after 24 hours)
neonctl branches create --name pr-preview-456 --ttl 86400
# Get the connection string for a specific branch
neonctl connection-string --branch agent-session-abc123
To connect from your application:
import { neon } from '@neondatabase/serverless';
import { drizzle } from 'drizzle-orm/neon-http';
const sql = neon(process.env.DATABASE_URL!);
const db = drizzle(sql);
Neon works with Drizzle ORM, Prisma, Kysely, and any standard Postgres client.
All pricing sourced from the live Neon pricing page at neon.tech/pricing.
Free plan - $0/month
Launch plan - usage-based
Scale plan - usage-based
Neon also runs an Agent Plan for app generation platforms (custom rates for thousands of databases) and a Startup Program that offers up to $100,000 in credits for early-stage companies.
All paid plans as of this writing include 500 GB of free data transfer per month (increased from 100 GB).
Neon is a strong fit for most greenfield AI app development. It is worth pausing if:
For anything early-stage, prototype-heavy, or genuinely agent-driven with bursty traffic patterns, the economics and developer experience favor Neon clearly.
Branch creation is nearly instantaneous because branches are copy-on-write clones, not full data copies. The Neon docs describe it as instant. Large databases do not slow this down because no data is copied at creation time.
Yes to both. Drizzle has a first-class drizzle-orm/neon-http adapter that uses the serverless driver over HTTP, and a drizzle-orm/neon-serverless adapter for WebSocket connections. Prisma works via the standard Postgres URL with no special adapter required, though it uses TCP and does not benefit from the HTTP optimization.
The branch data persists on Neon's storage layer. Compute pausing only stops the process handling queries. On the next connection, the compute restarts automatically. The connection itself triggers the wake, so your application code does not need to handle this explicitly, though you may see higher latency on the first query after a long idle period.
Yes, with the right plan. The Free plan's 6-hour history window and 0.5 GB per-project storage limit make it appropriate for prototyping. For production agents with real user data, the Launch or Scale plans provide longer history windows, higher storage limits, and the observability features (metrics export, log retention) needed to operate reliably. The Agent Plan is specifically designed for platforms running thousands of per-tenant databases.
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Serverless Postgres with branching. Free tier, instant database branches per PR, autoscaling compute, and scale-to-zero....
View ToolOpen-source Firebase alternative built on Postgres. Auth, real-time subscriptions, storage, edge functions, and pgvector...
View ToolType-safe SQL builder and ORM for TypeScript. Zero runtime overhead, honest schema migrations, bring-your-own-DB.
View ToolTypeScript ORM with a schema-first workflow. Prisma Client gives full type safety; Prisma Migrate handles migrations. Wo...
View ToolSet up Codex Chronicle on macOS, manage permissions, and understand privacy, security, and troubleshooting.
Getting StartedConfigure Claude Code for maximum productivity -- CLAUDE.md, sub-agents, MCP servers, and autonomous workflows.
AI AgentsA complete, citation-backed Claude Code course with setup, prompting systems, MCP, CI, security, cost controls, and capstone workflows.
ai-developmentFour mature, production-ready TypeScript frameworks have made building agents genuinely enjoyable. Here is how to pick t...
Every major AI coding tool just went through a pricing shift. Here are the exact numbers for Cursor, GitHub Copilot, Cla...
PgDog raised $5.5M to bring transparent Postgres sharding and connection pooling to any stack. Here is what it actually...

InsForge is trending because coding agents can scaffold UI faster than they can safely operate databases, auth, storage,...

We ran the same Convex to Neon migration on four apps in a week. Here is what stayed identical, what differed per app, a...

agentfs is filesystem-shaped storage for AI agents. Postgres-backed on Neon, no cold starts, no exec by design. Pay-only...

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.