caching similarity scores for performance