Add writing of origin metadata to persistence