devilsberg/laravel-mariadb-vector
MariaDB 11.7+ native vector storage and similarity search for Laravel. Adds a VECTOR column type, binary-safe Eloquent casts, and nearestNeighbors() query macros powered by VEC_DISTANCE functions — essentially pgvector, but for MariaDB.
VEC_DISTANCE_* SQL. That means the underlying capability is portable knowledge, not lock-in, which de-risks the buy side of the decision.nearestNeighbors() plus a limit. Explicitly out of scope and therefore separate product decisions: embedding generation (the package is storage-and-search only, "bring your own embeddings"), reranking, hybrid keyword+vector search, and relevance tuning. Budget those as their own line items — the vendor choice for embeddings is a distinct, and probably larger, decision than this package.VECTOR INDEX per table and requires the column to be NOT NULL. Those are hard product constraints: one primary embedding per entity, one searchable vector per table. Multi-vector or per-tenant-isolated search needs a different design, and a PM should know that before committing to a feature spec.Consider it when all of the following hold:
Look elsewhere when:
pgvector is the mature, maintained equivalent. If a database migration is on the table anyway, that's the more durable bet.To executives: "We can offer semantic search — meaning-based, not keyword-based — without buying a vector database, signing a new vendor, or letting our content leave our infrastructure. The cost is roughly one sprint, plus it depends on a database upgrade we should be planning anyway. The catch: the open-source project is archived, so we'd adopt it as internal code we maintain rather than a supported product — which for a thin adapter is a small, bounded commitment, and it keeps our options open to move to a managed vector store later if scale demands it."
To engineering: "It's a narrow adapter, not a search engine. It gives us a vector column and index in migrations, a binary-safe cast that turns MariaDB's VECTOR into a PHP float array, and four query macros that compile to native VEC_DISTANCE_COSINE / VEC_DISTANCE_EUCLIDEAN over VEC_FromText(?). No new moving parts — blast radius is query construction and casting. Integration is composer require, a migration, a cast, under a day's work once we're on MariaDB 11.7+. What I want from you: fork it, run the test suite, decide whether we vendor or reimplement the ~three pieces we actually use. Also note a real bug shipped and was fixed in 1.2.1 — binary format misdetection on ~1 in 256 vectors — which tells us the binary boundary is the fragile part and deserves our own test coverage. Treat the SQL semantics as the durable asset; the wrapper is replaceable."
How can I help you explore Laravel packages today?