Ash.Vector clashing with Pgvector
Hey, I need help with the following error. Is there a setup step that I'm missing with Ash.Vector?
I've setup the Pgvector types according to their documentation. So I have a
lib/postgrex_types.ex
file
And my database config which extends the default postgrex types
Solution:Jump to solution
Ah, I think I found it. Maybe there should be a link to the setup instructions in AshPostgres.Extensions.Vector documentation from the Ash.Vector docs.
Ash Vector: https://hexdocs.pm/ash/Ash.Vector.html
AshPostgres.Extensions.Vector: https://hexdocs.pm/ash_postgres/AshPostgres.Extensions.Vector.html...
9 Replies
Do you have some other pgvector package installed?
Yeah, I'm using pgvector
{:pgvector, "~> 0.3.0"}
🤔 Might be a problem
I think that the pgvector extension might compete with ours.
Thanks for you help Zach. I've removed the pgvector package and it results in another error when I load records that have vectors. Is there an additional setup step that I'm missing?
Solution
Ah, I think I found it. Maybe there should be a link to the setup instructions in AshPostgres.Extensions.Vector documentation from the Ash.Vector docs.
Ash Vector: https://hexdocs.pm/ash/Ash.Vector.html
AshPostgres.Extensions.Vector: https://hexdocs.pm/ash_postgres/AshPostgres.Extensions.Vector.html
I am thinking about using vectors to prevent duplicate entries of people in our database. Are the queries suffuciently fast for 'real time' feedback - like 300ms debouncing a web form? I'm thinking that vectorizing the user input would be the slowest part.
You'd need a local model doing the vectorizing likely
A very small local model would probably do well on such a contained task
I used nomic-embed-text with ollama for embeddings recently