In this article
A smaller stored annotation is useful only when its media and reviewed content remain recoverable after the transformation.
Identify the persistence transformation
A media annotation task can carry a large embedded image or audio payload into the database. The Prodigy custom recipe guide provides before_db as a callback that can transform examples before persistence, including replacing embedded media with a reference. Treat that callback as a data transformation with a defined output contract. It changes what future exports retain, rather than merely changing how efficiently the current browser displays the task.
Preserve a recoverable media reference
Before removing embedded bytes, establish which external object will reproduce the reviewed example. A local path meaningful on the annotation server may not resolve on the machine used for training or audit. Preserve the source identity, expected revision and required access route separately from credentials. The reference must continue to identify the same media, not whatever file happens to occupy a reused path when someone later reloads the annotation.
Keep reviewed values intact
Avoid mixing media compaction with text cleanup, label remapping or other semantic edits. The component reference places the callback in the controller’s persistence lifecycle. A transformed example can be accepted by storage even though it no longer represents what the reviewer judged. Use a separate, versioned postprocessing step for changes that alter training meaning so the original annotation and its derived representation can be compared independently.
Read the persisted result back
The database API provides retrieval of stored examples. Test a representative transformation by reading the saved object and loading its media from the destination environment. Check the annotations against that reconstructed input, including a moved source file and an unavailable reference. An operation that makes the database smaller but leaves only an inaccessible path has shifted the storage problem rather than solved recoverability of the dataset.
Record the boundary in the release
Retain the callback revision and the media-preservation policy with the annotation export. The guides on content identity and removal lineage explain related dependencies. Separate size reduction from any claim about data retention or privacy: an external media object may remain stored elsewhere. A useful release can explain both where the reviewed input lives and which transformation produced the compact annotation consumed by the next training step.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.