The community member is asking if there is a way to use Euclidean distance for similarity rather than cosine similarity when using the LlamaIndex library. In the comments, another community member suggests that the choice of distance metric depends on the embeddings model being used, and provides an example of using Euclidean distance with the Pinecone vector store. Another community member adds that if using a local embeddings model, the embedding class can be subclassed to change the similarity mode.
But there are ways to use euclidean if you want to, for example with Pinecone:
Plain Text
if "quickstart-index" not in indexes:
# dimensions are for text-embedding-ada-002
pinecone.create_index(
"quickstart-index", dimension=1536, metric="euclidean", pod_type="p1"
)