Vectors are the new JSON in PostgreSQL
jkatz05.com
jkatz05.com
(Of course it can’t do a lot of things, but the stuff that’s baked into it already or can be enabled by some extensions is simply amazing)
select infer_class_from_text_using_ml(some_text) from some_doc
compared to building infra with different services orchestrations.
Also, I think there are many cases when smaller models can totally run on CPU.
but then you would need some dataprocessing/warehousing infra integrated to produce dataset for inference and then do something with inference results. Having one db with everything packaged would reduce complexity significantly.
ML training workflow also could be integrated into this DB, so you could have few queries to generate data for training, model training, generate data for inference, produce inference results and do something with inference results.
#3 would limit you to running existing models in a browser.
Only #2 would allow you to actually understand and create new meaningful models.
Honestly I can't see pgvector becoming a mainstream way of running inference. I used pg cube for that on one project a while ago. Yeah it worked, but even ignoring the performance issues, the only reason we considered it was because of our weird use case. We were also doing other funky stuff like large sparse matrix math using just float8 cols, with parallelism (by splitting one query into ~32).