Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Embedding Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • AI/ML Integration Roadmap: Enables seamless vector embeddings for Laravel applications, accelerating development of AI-driven features like semantic search, recommendation systems, or RAG pipelines without building infrastructure from scratch.
  • Build vs. Buy: Eliminates the need to design and maintain custom embedding logic, reducing technical debt while leveraging Laravel’s ecosystem (e.g., laravel/ai for reranking).
  • Use Cases:
    • Search: Semantic search for content-heavy models (e.g., blog posts, support tickets) with optional reranking for precision.
    • Recommendations: Personalized suggestions based on vector similarity (e.g., product recommendations, content curation).
    • RAG Pipelines: Efficient retrieval of relevant documents for AI-generated responses (e.g., chatbots, Q&A systems).
    • Analytics: Track embedding generation performance via Laravel Pulse (e.g., latency, failure rates).
    • Multi-Tenancy: Slot-based embeddings allow per-field customization (e.g., embed title separately from body).
  • Database Agnosticism: Supports both PHP-side similarity (any DB) and native vector search (PostgreSQL, MySQL HeatWave, etc.), reducing vendor lock-in.
  • Scalability: Async job-based generation prevents blocking requests, and chunked Artisan commands enable batch processing for large datasets.

When to Consider This Package

  • Adopt if:

    • Your Laravel app requires semantic search, recommendations, or RAG but lacks dedicated vector infrastructure.
    • You need fine-grained control over embedding slots (e.g., embed title and body separately for different use cases).
    • Your team prefers Laravel-native solutions over standalone vector DBs (e.g., Pinecone, Weaviate) for simplicity.
    • You want observability (e.g., Pulse integration for monitoring embedding performance).
    • Your database supports native vector search (PostgreSQL, MySQL HeatWave) or you’re okay with PHP-side similarity for smaller datasets.
  • Look elsewhere if:

    • You need sub-millisecond latency for production-scale similarity search (PHP-side cosine similarity may not suffice).
    • Your stack is non-Laravel (e.g., Django, Node.js) or requires multi-model embeddings (e.g., images/videos alongside text).
    • You’re already using a dedicated vector DB (e.g., Milvus, Qdrant) and want to offload storage/management to it.
    • Your use case demands hybrid search (keyword + semantic) with advanced features like filters/aggregations (consider PostgreSQL + pgvector or Elasticsearch).
    • You lack Laravel 12/13 + PHP 8.3+ compatibility or need multi-tenancy isolation at the embedding level (this package uses a shared table by default).

How to Pitch It (Stakeholders)

For Executives: "This package lets us ship AI-powered features—like smarter search, recommendations, or chatbot responses—without building or managing custom vector infrastructure. It integrates natively with Laravel, so our team can focus on business logic while handling embeddings automatically in the background. For example, we could add semantic search to our support tickets or product catalogs in weeks, not months. It also supports advanced databases like PostgreSQL for high-performance use cases, and we can monitor embedding health through Laravel Pulse. The cost? Zero upfront infrastructure; we pay only for the AI reranking services we choose to use."

For Engineers: *"This solves the ‘how do I store and query embeddings in Laravel?’ problem elegantly. Key benefits:

  • Zero boilerplate: Add a trait to any Eloquent model, define slots, and embeddings auto-generate on save.
  • Flexible slots: Embed title and body separately, or combine them. Only re-embed changed fields.
  • Async by default: No blocking requests; uses Laravel queues for generation.
  • Multi-driver support: Works with any database (PHP-side) or native vector search (PostgreSQL, MySQL HeatWave, etc.).
  • Reranking: Plug into Cohere/Voyage/Jina for better top-K results in RAG pipelines.
  • Observability: Pulse plugin tracks latency, failures, and throughput per slot.
  • Artisan tools: Generate/clean embeddings at scale with --chunk and --dry-run safety checks.

Tradeoffs: PHP-side similarity isn’t as fast as native DB search, but the package makes it easy to switch drivers later. For now, it’s a low-risk way to experiment with embeddings without over-engineering."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky