Skip to content
Go back

Agentic-Friendly Databases: The Case for Version Control in AI

Published: Jul 24, 2025
Updated: Jul 31, 2025
Toronto, Canada

The last few years have been marked by the explosive growth of generative AI. We’ve moved from simple chatbots to sophisticated AI agents capable of performing complex tasks, from writing code to managing customer service inquiries. As these agents become more integrated into your daily operations, a critical question emerges: How do you let them interact with your most valuable asset—your data—safely and effectively?

The idea of an AI agent autonomously connecting to your production database and running UPDATE or DELETE commands is enough to give you nightmares. If you’ve used generative AI, you know these models are not 100% trustworthy. They can make mistakes. This is where the concept of ‘agentic-friendly’ databases comes into play, and the solution looks remarkably similar to a tool you’ve likely relied on for decades: Git.

From YOLO to FAFO: The Power of Version Control

In software development, you’d never dream of working directly on the main branch. You create feature branches, test your changes in isolation, and then merge them after a review. This workflow, powered by version control systems like Git, provides a critical safety net. It allows you to experiment, make mistakes, and collaborate without breaking production.

Why should your database be any different?

This is the core idea behind the agentic-friendly database. As Tim Sehn from DoltHub eloquently puts it, you need to move from a ‘YOLO’ (You Only Live Once) to a ‘FAFO’ (Fuck Around and Find Out) mindset.

  • YOLO: Letting an AI agent operate on your system without version control is a high-stakes gamble. If it makes a mistake, the consequences can be catastrophic and irreversible.
  • FAFO: When your system is under version control, the agent can ‘fuck around’ on an isolated branch. You can then ‘find out’ exactly what it did by reviewing a clean, structured diff. If the changes are good, you merge them. If not, you simply delete the branch. No harm, no foul.

This paradigm shift is being pioneered by innovative database solutions like Neon, Supabase, and Dolt.

Supabase: Database Branching for Modern Workflows

Supabase, a popular open-source Firebase alternative, has embraced this philosophy by integrating database branching directly into the development workflow. As demonstrated in their recent video, ‘Why you NEED to be using Database Branching!’, they’ve made it seamless for you to treat your database schema and migrations just like your application code.

The workflow is beautifully simple and mirrors the Git-based process you already know and love:

  1. Branch Out: You (or an AI agent) check out a new Git branch to work on a feature.
  2. Isolated Database: A corresponding database branch is automatically created. This is a complete, isolated copy of the production database schema.
  3. Develop & Migrate: The agent can create new tables, add columns, and seed test data in its own sandboxed environment, without affecting your production data.
  4. Pull Request & Preview: When the work is done, you open a pull request. This automatically spins up a preview environment with the new application code and the branched database, allowing for end-to-end testing.
  5. Review & Merge: You can review the code and the database migration. When the pull request is merged, the changes are deployed to the production application and the database schema is updated automatically.

This provides the perfect ‘human-in-the-loop’ checkpoint. The AI agent does the heavy lifting on a branch, and you give the final approval before the changes go live.

Neon: Serverless Postgres with Native Branching

While Supabase adds a branching workflow around Postgres, Neon builds branching directly into its serverless Postgres architecture. Neon’s design, which separates storage and compute, enables instant, copy-on-write branching. This means creating a branch is a lightweight operation that doesn’t duplicate your entire database, making it extremely fast and cost-effective.

Neon’s approach provides the best of both worlds, catering to both of the key agentic-friendly use cases:

  1. Full Data Branches (for Data-Intensive Agents): By default, a Neon branch is a full, writeable copy of your production data at a specific point in time. You can give an AI agent its own branch of a multi-terabyte database in seconds. It can then perform complex data cleanup, enrichment, or analysis tasks in complete isolation without impacting your production workload. This is ideal for agentic workflows that need to ‘fuck around’ with the data itself.

  2. Schema-only Branches (for CI/CD and Safety): Recognizing that you don’t always want to copy production data (especially if it’s sensitive), Neon also offers schema-only branching. This creates a new branch with the complete database structure but none of the data. This is perfect for the CI/CD workflow you need: your agent (or you) can test schema migrations and application code in a clean, sandboxed environment without access to PII.

Like Supabase, Neon provides deep integrations with platforms like Vercel and CI/CD tools like GitHub Actions, allowing you to automate these powerful branching capabilities as part of your modern development pipeline.

Dolt: The World’s First Version-Controlled SQL Database

While Supabase adds branching capabilities to Postgres, Dolt is a SQL database built from the ground up with version control at its core. It’s a drop-in replacement for MySQL that offers the full semantics of Git: clone, branch, diff, merge, push, and pull.

With Dolt, not just the schema, but the data itself is versioned. This unlocks even more powerful agentic workflows:

  • Complex Data Operations: You can task an agent with complex data cleanup or enrichment jobs on a branch. It can add, delete, and update thousands of rows. You can review the final result as a clean data diff before merging into production.
  • Agent Consensus: Imagine you spawn a hundred AI agents, each on their own branch, to tackle the same problem. If 99 of them produce the exact same diff, you can have high confidence in the result and merge it automatically. Dolt enables agentic review by consensus.
  • Ultimate Reversibility: If a bad change makes it to production, you can instantly revert it with a single command, rolling back your data to its previous state.

Branching Architectures: A Side-by-Side Comparison

Supabase, Neon, and Dolt all offer ‘branching,’ but their underlying architectures lead to different strengths and use cases. Supabase offers a workflow around a standard database, while Neon and Dolt have branching built into the database engine itself.

FeatureSupabase Branching (Workflow Orchestration)Neon (Serverless Postgres Engine)Dolt (Version-Controlled Database Engine)
What is Branched?The entire database infrastructure. A new, separate PostgreSQL instance is provisioned.The data and schema state. A branch is a lightweight, copy-on-write clone within the same storage backend.The data and schema state. A branch is a lightweight pointer to a commit within the same database instance.
Primary GoalSafe Schema Evolution & App Testing. To ensure new application code works with new database schema changes before deploying to production.High-velocity development and data safety. Combines CI/CD workflows with safe, large-scale data operations.Data Auditing, Collaboration, and Safety. To enable branching, merging, diffing, and reverting of the data itself.
Branch ContentSchema-only with Seed Data. The new database branch is empty by default and populated via migration and seed files. It does not contain production data.Flexible: Full production data (via copy-on-write) OR schema-only. Provides both options in one platform.A Full, Live Copy of Data. A branch is a copy-on-write snapshot of its parent. It contains the full dataset from the moment it was created.
How to BranchVia Git. Pushing a new branch to GitHub and opening a Pull Request automatically triggers the creation of a database branch.Via Console, API, CLI, or Git (e.g., GitHub Actions). More flexible and direct control.Via SQL or CLI. A branch is created with a simple command like CALL dolt_checkout('-b', 'new-feature');.
Resource CostHeavyweight. Spinning up an entire new database instance is resource-intensive and takes time.Lightweight. Creating a branch is nearly instantaneous, as it’s a copy-on-write operation.Lightweight. Creating a branch is nearly instantaneous, as it’s just creating a new pointer.
Data MergingNot Applicable. You don’t merge data directly. When you merge the PR in Git, the schema migrations are applied to your production database, and the temporary branch DB is destroyed.Not Applicable. Similar to Supabase, you don’t ‘merge’ data branches. You would typically promote a branch to be the new primary or apply schema changes from dev to prod.Core Feature. Dolt supports 3-way data merges with conflict detection and resolution. You can merge the data changes from one branch into another using CALL dolt_merge('my-branch');.

Scaling to Millions of Records: Choosing the Right Branching Model

The architectural differences become critical when you consider different workflows at scale.

Use Case 1: Testing Application Code & Schema Migrations

This is the classic CI/CD use case: Imagine you need to test a new feature that includes a schema change (e.g., adding a column).

  • Supabase excels here. Its process is independent of production data size because it spins up a fresh, empty database and applies migrations.
  • Neon’s schema-only branches are designed for precisely this scenario. It provides a structurally identical but empty database, making it just as fast and efficient as the Supabase approach.
  • Dolt can do this, but it requires branching the full dataset first and then clearing it, which is less direct.

Winner for CI/CD: Supabase and Neon (via schema-only branches).

Use Case 2: Agentic Workflows on Production Data

This is the more advanced agentic use case: You need an AI agent to perform a task on your actual production data (e.g., ‘Standardize all phone numbers in the users table’).

  • Supabase cannot do this. Its branches are isolated and do not contain production data. You cannot safely give an agent a sandbox with live data.
  • Neon’s default (full data) branches are the ideal solution here. Your agent can instantly create a lightweight, copy-on-write branch of the entire production dataset, no matter how large. It can work in isolation, and you can review its changes before the branch is promoted or its changes are manually applied to production.
  • Dolt is also a perfect fit for this. The ability to see a clean dolt diff of all data changes and even dolt merge them gives you incredible power for review and auditability.

Winner for Data Operations: Neon and Dolt.

The Future is Collaborative: Humans + AI + Versioned Databases

The future of work is collaborative, involving teams of both human and AI agents. To make this collaboration safe and productive, you need systems that are designed for it. Just as Git became the indispensable foundation for modern software development, version-controlled databases are poised to become the bedrock of the agentic era.

Databases that embrace branching are no longer a novelty. They are a fundamental requirement for your organization if you’re looking to leverage AI agents to operate on critical data. The landscape offers a range of powerful options: Supabase provides a seamless CI/CD workflow for schema changes, Dolt offers the ultimate in data versioning with Git-like semantics, and Neon emerges as a powerful hybrid, offering both schema-only branches for development and instant, full-data branches for complex agentic tasks on production data. Choosing the right tool depends on your specific workflow, but one thing is clear: the safety, auditability, and control these platforms provide are essential to unleashing the full potential of agentic AI.

  Let an Agentic AI Expert Review Your Code

I hope you found this article helpful. If you want to take your agentic AI to the next level, consider booking a consultation or subscribing to premium content.