⚠️ This post links to an external website. ⚠️
Finding related content in a Laravel application often means building custom queries or relying on keyword matching, which misses semantic connections. Laravel Related Content, created by Vladislav Stoitsov, uses vector embeddings and PostgreSQL's pgvector extension to automatically discover and link related content across different model types based on meaning rather than keywords. The package is currently in beta at the time of this writing.
The package pre-computes relationships at save time and stores them as database records, so retrieving related content is a standard database query (~5ms) instead of a real-time similarity search on every page load.
Main Features
- Pre-computed Related Links: Related content is calculated on save, not on every page load
- Fast Lookups: O(1) relationship queries instead of real-time similarity search
- Cross-Model Relationships: Find related content across different model types (e.g. an Article can surface related Events or Community Links)
- Multiple Embedding Providers: Support for OpenAI and Ollama
- Queue Support: Process embeddings in the background
- Semantic Search: Search content by meaning, not just keywords
continue reading on laravel-news.com
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.