Your personal memory, across sessions, agents, and devices.

Neon Serverless Postgres for AI Agents: How Branching Works

memU Team memU Team

Neon is a serverless Postgres service built so that databases can be created and copied in seconds, then thrown away. That property made it a favorite backend for AI app builders and coding agents. In May 2025 Databricks agreed to buy Neon, citing telemetry that over 80 percent of its databases were created by agents. Below you will find how branching works and how to connect a coding agent through the MCP server. The last sections cover pricing and where Neon draws the safety line.

What is Neon branching, in one sentence?

A Neon branch is a copy-on-write clone of a Postgres database that stores only its own changes and leaves the parent untouched.

The branching docs call a branch "a copy-on-write clone of your data." Writes to the branch are saved as a delta against the parent. Creating one puts no load on the parent. You can branch from any point in the history window. By default that is 6 hours on Free and 1 day on paid plans.

How does a Neon branch differ from a database copy or a snapshot?

The usual alternatives are a dump-and-restore copy or a managed Postgres snapshot. A branch is faster and cheaper to create than either, and it can start from any moment in the history window.

Neon branch pg_dump and restore Neon snapshot
What you get A writable clone with its own compute A full independent copy A restorable checkpoint
Time to create Described by Neon as instant Grows with database size One Snapshots API call
Storage used Only the changes on the branch The full database again Not stated on the pages we read
Point in time Any moment in the history window Only when the dump ran When the snapshot was taken
Cleanup Optional expiration date (TTL) Manual Manual or by policy

Sources: Neon's branching docs and its AI agents page.

Why do AI agents use Neon?

Agent platforms create databases at a rate humans never did, often one per project a user starts. Databricks' acquisition announcement of May 14, 2025 says Neon can start a fully isolated Postgres instance in 500 milliseconds or less. The same release cites the 80 percent figure from Neon's internal telemetry.

Idle databases cost little because compute scales to zero and storage is billed separately. On its AI agents page, Neon quotes a Replit infrastructure engineer praising its flexible resource limits and near-instant provisioning. The page also says one developer platform ran over 300,000 Postgres instances on Neon with a single engineer. Neon links that claim to a Retool case study.

Branching makes agents safer to let near real data. An agent can branch production data and run a risky migration there, then apply it to the parent only after it works. A failed experiment is cleaned up by deleting the branch or resetting it to match the parent.

How do you connect a coding agent to Neon?

Neon ships an MCP server so that MCP clients such as Claude Code and Cursor can manage projects. The MCP server docs list tools in three groups:

  • projects: list, create, describe and delete
  • branches: create, reset and delete branches, and manage roles
  • SQL: run queries and transactions, and apply schema changes on a temporary branch

The remote endpoint is mcp.neon.tech, and the docs give a single npx command that installs the server into your coding agents. Neon recommends MCP for development and testing only, never against production databases. It also asks you to review each action the model requests before it runs.

What does Neon cost?

The pricing page lists three self-serve plans:

Free Launch Scale
Monthly minimum $0 None None
Compute 100 CU-hours per project $0.106 per CU-hour $0.222 per CU-hour
Storage 1 GB per project $0.35 per GB-month $0.35 per GB-month
Branches per project 10 10, then $1.50 per branch-month 25, then $1.50 per branch-month

Paid plans allow up to 5,000 branches per project. Neon also offers an Agent Plan for platforms that create databases on behalf of users. Its prices are not published.

Read the fine print

The 80 percent figure is Neon's internal telemetry as quoted by Databricks in May 2025. Neither it nor the 500-millisecond startup figure has an independent audit that we could find. Both come from the same press release, and "instant" branching is Neon's own word.

Branching is cheap at creation, but the history window is not free. The docs warn that a longer window raises storage costs. An agent that tried a bad migration on a branch last week starts this week with no record of why it failed, unless someone wrote that down.

The bottom line

Use Neon when agents or users create many short-lived databases, or when you want every risky migration tested on a branch first. Keep the MCP server on development projects, as Neon itself advises. Set branch expiration dates from the start so test branches clean themselves up.

How do coding agents remember what they learned from a database?

A Neon branch stores rows and schema. It keeps no record of the reasoning in the session that changed them. Which migration broke staging and why a column is nullable are things only the coding session that found them knows. The next Claude Code or Codex session starts without it, even though the database it touches is the same.

memU keeps that knowledge as Markdown the agent writes itself. A scheduled background task slices new session logs into jobs, and the agent distills each one into memory and skill files that memU commits to a backend shared across hosts. A standing instruction in CLAUDE.md or AGENTS.md tells the agent to retrieve before answering. A lesson from a failed migration in one session can then reach the next session in another host. memU's core makes no LLM calls of its own, so the judgment about what to keep stays with the agent.

To try it with an API key from memu.so, send your agent one message:

Read https://memu.pro/SKILL.md, follow its instructions to install and configure memU

The self-hosted option is in the memU GitHub repository. For the design reasoning, see why memU gives memory back to the agent.

FAQ

Is Neon branching really copy-on-write?

Yes. Neon's docs describe a branch as a copy-on-write clone. Writes to the branch are stored as a delta, so creating it does not duplicate the parent's data.

How far back can I branch in Neon?

As far back as the history window allows. The defaults are 6 hours on the Free plan and 1 day on paid plans, and a longer window raises storage costs.

Does Neon have a free plan?

Yes. The Free plan includes 100 CU-hours of compute and 1 GB of storage per project, with up to 100 projects.

Who owns Neon?

Databricks announced an agreement to acquire Neon on May 14, 2025. Neon's service and docs remain at neon.com.

Is the Neon MCP server safe for production?

Neon says no. Its docs recommend the MCP server for development and testing only and say never to connect MCP agents to production databases.