Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 4 min read Case study easyNovice

Building Versioning for AI-Generated Apps

Dyad, an open-source local AI app builder, pairs each Git commit with a Neon database timestamp so that undoing a version rolls back both code and data together. A separate Neon preview branch lets users view older versions without touching the main development branch. The current timestamp-based restore discards later database history, so the team plans to move to Neon snapshots for bi-directional versioning and to Neon Auth to simplify its Payload CMS-based setup.

Assumes: Git commitsdatabase branching

Related posts

  • 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.

  • A database for every preview environment using Neon, GitHub Actions, and Vercel

    Neon mediumAdept

    Neon's copy-on-write branching can give every pull request its own production-like Postgres database, avoiding the bottlenecks of shared staging or shared preview databases. Branches are isolated, are created in about a second regardless of database size, and bill only for unique data. A GitHub Actions pipeline creates a Neon branch per PR, runs Prisma migrations against it, deploys a Vercel preview wired to that branch, and comments the URLs on the PR. Merging applies migrations to the primary branch, deploys to production and deletes the preview branch.

  • An API to Track Database Schema Changes

    Neon mediumAdept

    Neon's Schema Diff feature now has a `compare_schema` API endpoint, available on all plans, that takes two Neon branch IDs and returns a unified diff of their Postgres schemas. The goal is to let AI agents such as Replit Agent and CI/CD pipelines check schema differences programmatically. Optional LSN or timestamp parameters pin a branch to a point in time, but the two are mutually exclusive. The suggested workflow is to apply schema changes on a branch holding a copy of production data, use the API to track discrepancies, then run the migration in production once it has been tested.

  • 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.

The quest for software engineering knowledge.

Look:
Layout: