pgvector has you covered: https://github.com/pgvector/pgvector
Cosine similarity measures the angle between two vectors instead, and doesn't suffer from the curse of dimensionality.
I guess it's important to have this in your DB, so you make "nearby" queries (give me text that's similar to this other text) in an efficient way.