One database per agent.
Zero marginal cost.

Every AI agent needs its own isolated database to read, write, and mutate without affecting other agents or production data. Copy-on-write branching makes this economical at any scale.

Add this to your agent's context

Give your AI agent the context it needs to use Xata branches.

Autonomous agents interact with databases differently than humans do. They run concurrently, operate on untrusted inputs, and produce side effects that can be difficult to predict. A database architecture designed for human workflows (shared connections, environment-level isolation) breaks quickly under agent load. Xata's copy-on-write branching gives every agent its own full Postgres instance, provisioned in under a second and torn down when the run is complete.

The problem

When multiple agents write to the same database, they overwrite each other's mutations. Results become non-deterministicand debugging becomes nearly impossible. The natural solution is to give each agent its own database copy, but full copies don't scale. A hundred concurrent agents means a hundred full database copies, and at any non-trivial data size the storage and provisioning costs make this untenable. There is also a compliance dimension. Giving autonomous agents direct access to production data (PII, PHI, or any sensitive records) creates a liability with every execution. A single misbehaving agent is a potential data exposure event.

How it works

Xata branches use copy-on-write semantics: a new branch shares the source database's storage until it writes something new. Provisioning is near-instant regardless of how large the source is: no cloning, no restore queue, no wait.

productionstaging/anon
 

Branch from production

Your orchestrator creates a branch at the start of each agent run. The branch can be created from production directly, or from an anonymized replica if compliance requires it. Either way, the agent sees a complete, consistent snapshot of the data at the moment the branch was created.

Agent gets a full Postgres instance

Each branch is a real Postgres database with its own connection string. The agent can read, write, run DDL, create indexes, and mutate data freely. Nothing leaks between branches, and nothing propagates back to the source unless you explicitly merge.

Branch scales to zero between runs

When the agent finishes its work, the branch suspends automatically. There is no idle compute cost. When the next run starts, the branch reactivates on the first connection, typically within a few hundred milliseconds.

Tear down or keep for debugging

Branches are disposable by design. Delete them after each run and the cost is marginal: you only ever paid for the writes that diverged from the source. If something goes wrong, keep the branch around. You can connect directly and inspect exactly what the agent did, query by query.

We went from zero to a hundred concurrent agents in a week. Xata branching was the only thing that made the database side of that tractable. Every agent got its own isolated instance without us managing a single connection pool.

Desmobit Ray, Founder & CEO @ DevZero

Key capabilities

Instant provisioning

Branch creation completes in under a second. Your agent orchestrator can create a branch inline as part of every execution without introducing meaningful latency. There are no provisioning queues, no snapshot restores, and no pre-warming required.

Full isolation

Each branch is a fully independent Postgres instance. Agents can run arbitrary DDL, create and drop tables, install extensions. None of it affects other branches or the source database. Isolation is enforced at the storage layer, not just at the connection level.

Scale-to-zero

Agent workloads are bursty by nature. Branches suspend to zero compute between runs and reactivate on demand. You pay only for the queries that actually execute. Idle branches cost nothing, which makes the one-database-per-agent model economical even at high concurrency.

Anonymized by default

Branches can inherit anonymization rules from the source database. When an agent branches from an anonymized replica, it never sees raw PII or PHI. The compliance boundary is built into the branching layer itself, not added as an afterthought by the agent author.

Advanced privacy treatment

Xata supports column-level redaction, synthetic data generation, and k-member microaggregation while maintaining data formats and referential integrity with primary and foreign key relationships. Learn more about data privacy on Xata.

Data privacy & anonymization
Xata supports column-level redaction, synthetic data generation, and k-member microaggregation out of the box. Learn more about data privacy on Xata.

Framework compatibility

Any tool that can connect to Postgres works with Xata branches. Claude Code, Cursor, Devin, and custom agents built with LangChain or CrewAI all connect using a standard Postgres connection string. No SDK to install, no plugin to configure, no vendor-specific adapter to maintain. The integration pattern is simple: your orchestrator calls the Xata API to create a branch, passes the connection string to the agent as an environment variable or tool argument, and calls the API again to tear the branch down when the run completes. The agent itself needs no knowledge of Xata.

Postgres for agent scale.

Use your existing Postgres. Run it better with Xata.