Embeddings & Vector Search in Rails — Semantic Search with pgvector
ruby
dev.to
Streaming AI responses looks cool. But here's the problem: the AI doesn't know anything about your business. Ask it about your users, orders, or documents and it hallucinates. Embeddings fix this. They turn text into vectors — mathematical fingerprints that capture meaning. Similar ideas cluster together in vector space. Search stops being keyword matching and starts being concept matching. This post adds semantic search to your Rails app using pgvector and the neighbor gem. By the end, you'll