Menu

Laravel 13 Vector Search: Semantic Queries Without a Search Service
📰

Laravel 13 Vector Search: Semantic Queries Without a Search Service

DEV Community: laravel·Danny Holloran·about 16 hours ago
#dc9MUaQJ
#devtolaravel#devto#dev#embedding#search
Reading 0:00
15s threshold

A user types "cheap places to stay near the beach" into your help center search, and your LIKE '%beach%' query returns an article about beach volleyball rules. Meanwhile, the article titled "Budget Coastal Rentals" sits unfound because none of its words match. Full-text search helps with stemming, but it still matches words, not meaning.

The usual fix has been to bolt on a dedicated vector database or a hosted search service, then write a sync pipeline to keep it in step with your models. Laravel 13 removes most of that work. Vector columns, an Eloquent cast, and a whereVectorSimilarTo query builder method now ship in the framework, so semantic search can live in the database you already run.

What you need before you start

Vector search in Laravel 13 depends on two things. First, a database that can store and compare vectors: PostgreSQL with the pgvector extension or MariaDB 11.7 and later (MongoDB works through the Laravel MongoDB package).…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.