A metric cache for similarity search.