x-laravel/embedding
Laravel package that auto-generates and stores vector embeddings for Eloquent models via laravel/ai. Supports single or multi-slot embeddings with field-based triggers, queued generation per slot, driver-based similarity search across many databases, and optional reranking.
title, body, full) enables granular control over embedding generation, which is critical for domain-specific search (e.g., prioritizing title for quick results vs. body for deep analysis). This mirrors modern vector database patterns (e.g., Weaviate, Pinecone) but with Laravel’s flexibility.laravel/ai) bridges the gap between cosine similarity (fast but coarse) and cross-encoder models (slower but precise), which is essential for high-quality RAG use cases.use Embeddable and define toEmbeddingText().laravel/ai ^0.6, which is a growing ecosystem (e.g., Cohere, OpenAI, Voyage). If your team already uses laravel/ai, this is a low-risk addition.embeddings) and model relationships (embedding()). Schema migrations must be idempotent in CI/CD pipelines.#[EmbedOn]) and model macros aligns with modern Laravel.laravel/ai, which supports OpenAI, Cohere, Voyage, etc., reducing vendor lock-in.Post) and single-slot embedding (title + body).Product with name, description, specs).embedding queue with higher priority).Post::withoutEmbedding()).laravel/ai.embedding.php) and run migrations.Embeddable trait to pilot models.toEmbeddingText() and $embeddable/#[EmbedOn].similarTo().ai.default_for_reranking in config/ai.php.rerankWithScores() on low-traffic endpoints first.laravel/ai and reranking providers may introduce new costs or deprecations.ModelEmbedding event payloads).embedding:status to diagnose missing embeddings.embedding:clean --orphans-only).-v) for embedding:generate to trace issues.toEmbeddingText() returns consistent slot names.How can I help you explore Laravel packages today?