An abstract Torelli theorem