The Hidden Ops Layer of Agent Platforms
Anything's Max coding agent gets a dedicated Neon database branch for every session, created in about 200 ms. The agent runs its migrations there and merges back into development atomically through Neon's restore API. Failed migrations go to a separate LLM "Migration Fixer" for up to three retries before rollback, and merges fail if the development schema changed in the meantime. After crashed sessions left 2,847 orphaned branches, the team added a 6-hourly cleanup job plus 24-hour expires_at timestamps on branches. Connection pooling and 0.25–1 CU autoscaling handle bursty workloads of about 30 peak connections.
Related posts
- Inside a Kylon room, where people and agents build apps on Neon
Neon easyNovice
Kylon, a shared workspace where teams and AI agents build internal apps like CRMs and invoice trackers, maps its product directly onto Neon resources: one Neon project per workspace, one database per app, and one branch per draft. Agents apply schema migrations and changes to a branch copy of real data, a person reviews the preview, and production changes only on publish. Scale-to-zero makes many mostly idle agent-built databases affordable. The Neon API, point-in-time restore and MCP let agents provision, manage and undo changes without anyone opening a console.
- Behind Modem.dev’s Product Velocity
Neon mediumAdept
Modem, a startup building an AI agent that centralizes user feedback from Slack, Discord and GitHub, uses Neon Postgres branching as its development workflow. Every PR with a migration gets its own database branch, where the migration is applied and a schema diff is posted to the PR. The process is repeated against a fresh branch at merge time to catch conflicting migrations, and each Vercel preview runs on an ephemeral branch with automatic cleanup. Two practical tips: script branching through the Neon CLI so coding agents can drive it, and tag OAuth refresh tokens with the originating branch so preview environments can't invalidate production tokens.
- Build Checkpoints For Your Agent Using Neon Snapshots
Neon mediumAdept
Neon's new snapshots API, built on copy-on-write branching, can implement checkpoints for agentic app builders so that rolling back an app version restores the matching Postgres schema and data along with the code. The demo pairs an app database with a meta database that maps each checkpoint to a snapshot ID. A snapshot is taken after every prompt, and rollback calls the restore API with finalize_restore and the current production branch ID, then polls operations until they reach a terminal state. Resolve the production branch ID by name before each restore rather than caching it, because it can change across restores.
- How to Build a Full-Stack AI Agent
Neon mediumAdept
Aileen is an open-source codegen agent that generates full-stack web apps, combining Next.js on Vercel, Mastra for the agent loop, Assistant UI for persisted chat, Freestyle.sh for Git repos and dev sandboxes, and Neon for both the control-plane database and per-app Postgres with Neon Auth. A control plane provisions an isolated database, repo, auth config and dev server per project. The agent then iterates for up to 50 steps using custom filesystem and exec tools, Neon and Context7 MCP servers, and Drizzle migrations. Each version pairs a Git commit hash with a Neon snapshot ID plus versioned secrets, so code and data can be rolled back together, and long-running setup runs through Vercel Workflows.
- Adopting Neon branching in CI/CD pipelines: a practical story by Shepherd
Neon mediumAdept
Shepherd, an insurtech startup that moved its Alchemist pricing engine from SQLite to Postgres, uses Neon's copy-on-write database branches to give every pull request an ephemeral test database. GitHub Actions call the Neon API to create a branch when a PR opens and delete it on merge. Changes then flow from per-developer and per-PR branches to staging and production, with Render pre-deploy commands applying migrations tracked in a dedicated timestamped table. The team credits branching with removing the cost and effort of keeping test instances synced with production, and notes that scale-to-zero means it no longer pays for idle databases.