1. Use cases that justify embeddings
- Internal knowledge and support: long articles, runbooks, and tickets where users phrase problems differently from the documentation.
- RAG for assistants: retrieving chunks to ground an LLM answer—vector similarity is the default retrieval primitive.
- Catalogs with messy text: products described in natural language when SKUs and attributes alone miss intent.
- Deduping and clustering: finding near-duplicate UGC or imports before they hit moderators.
2. Where to store vectors in a Laravel stack
Common patterns: PostgreSQL with pgvector (vectors beside relational rows—great for tenant-scoped queries), a managed vector index (Pinecone, OpenSearch k-NN, etc.) when scale or ops favor separation, or search engines that expose hybrid retrieval. Laravel’s job is to keep models, policies, and Eloquent lifecycle aligned: embed on create/update via queued jobs, delete stale vectors when records go away, and version the embedding model when you reindex.
3. Authorization before similarity
A vector index does not understand organization_id. Either filter candidates in SQL after fetching IDs from the index (with sane limits), or partition indexes per tenant where the product allows it. Never return top‑k globally and “hope” the app filters later—that is how leaks happen under load.
4. Hybrid search usually wins
Pure vectors miss exact matches (order numbers, legal phrases). Pair BM25 or database full-text with vector scores: reciprocal rank fusion or weighted blends are enough for many apps. Laravel can orchestrate both calls and merge in PHP—or push the blend down to the engine if it supports hybrid queries.
5. When I skip vectors
- Small corpora where
LIKE/ full-text and good synonyms suffice. - Strict identifier lookup (invoices, barcodes)—vectors add cost, not recall.
- No budget for reindexing when content or embedding models change.
Vector and semantic search in Laravel are production-ready when tied to clear retrieval goals, tenant-safe filters, and boring maintenance (jobs, migrations, and model pins). Ship the pipeline, not the buzzword.