nevakrien
VectorDB in gigalixir - how to do KNN?
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.
Most Liked
gigatim
If you are using Gigalixir’s STANDARD tier database, you can enable the pgvector extension.
gigalixir pg:psql
postgres=> CREATE EXTENSION IF NOT EXISTS vector;
FelisOrion
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.
Popular in Questions
Other popular topics
Latest Phoenix Threads
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security









