Reconstructing historical communities