So I have been stuck for a alot of time tryi g to figure out how to get a vector db for parge vectors that can do KNN. Its suprisingly complicated to make something like ecto do it.
The reason i am asking specifcly here is that i sont really know how i would go about installing packages with ecto or if thats even a good idea.
Ideally i want somerhing like pgvector which is just made for this sort of quries but i dont mind writing it in pure sql of it can work.
I’ve been there, doing KNN inside Ecto/SQL gets painful fast. My advice: let your DB handle persistence, and do the vector math in-memory. I built Vettore, a Rust-backed Elixir lib that does fast cosine/dot KNN (plus HNSW) without wrestling with SQL. You can store vectors + metadata in Postgres (or pgvector if you like), then load them into Vettore on boot, run KNN, and fetch details by IDs from the DB. Simple, fast, and no database gymnastics.