Mammoth

Reviewed, recoverable data changes for ordinary Postgres

Postgres · Database Branching · MCP

Code gets a branch, a diff and a reviewer before it reaches production. A correction to production data usually gets a SQL console. When a script deletes twelve customer contacts, someone has to work out who changed what, pull rows out of a restore and write the repair by hand, and a second person cannot check that work without redoing it.

Mammoth is my design for doing that work on ordinary Postgres. A team inspects retained history, works in an isolated branch, reviews the exact row changes and applies only what was approved. One record ties together the starting state, the proposal, the review, the result and the way back. AI agents get the same branches to work in, and a person approves what they submit.

It is a design with a local implementation in progress, started in October 2026. A first local spike passed for branches and failed on the write overhead of trigger-based history, and the architecture has since moved to compact history and narrower write protection. None of the capabilities below has passed its qualification tests yet, and applying a reviewed change is not built.

Decisions

Applications keep connecting to the same Postgres, with no SQL proxy in the path and no replacement storage engine. Before anything changes, a compatibility report says which history, branch and recovery features that deployment can use.

An approval belongs to one exact revision. The reviewer sees the target, the row diff, the dependencies and the validation results, and any change to the proposal needs a new approval. Stale data or a changed schema can still stop it at apply time.

Undo and restoring selected rows produce reviewable changes like any other, and they refuse to overwrite newer values.

Each applied change writes a receipt in the same transaction as the data. After a crash or a retry, the system checks for the receipt before it tries again.

Agents reach their branches through an MCP server, where they can investigate, run SQL experiments and submit a proposal. A separate person approves. When history is missing, an operation is unsupported or a conflict appears, Mammoth stops and says why.

Use

For platform and data teams that review production corrections, rehearse data changes, or want to give AI agents a database to work on without giving them the last word on production.

All projects