News

Laravel 13 natively supports MariaDB Vector, no external packages needed

From Laravel 13.28, vector columns and similarity queries work on MariaDB 11.7+ without external packages or pgvector.

UptimeMag editorial team · 7 October 2026 · 2 min read

Laravel 13 supporta nativamente MariaDB Vector, senza package esterni

As of Laravel 13.28, applications running on MariaDB can perform semantic (vector) search without a second database, an external vector service, or additional packages. This is reported by the official MariaDB blog. For anyone managing hosting or VPS environments with a Laravel stack, this means one less component to install and maintain, and embeddings remain in the same tables as the data they describe: same backups, same consistency, same Eloquent queries.

Until last summer, Laravel's "built-in" vector support was a PostgreSQL-only feature, based on pgvector. Laravel's AI SDK documentation now states: "Vector queries are currently supported on PostgreSQL connections using the pgvector extension, or on MariaDB 11.7 or later using its native vector support."

Requirements and configuration

You need Laravel 13 and MariaDB 11.7 or later; the source recommends the LTS versions 11.8 or 12.3. In the .env file, you need to set the dedicated driver:

DB_CONNECTION=mariadb

Two practical warnings flagged by Mohamed Touhami Rhaima, the developer who led much of the integration work:

  • use the mariadb driver, not mysql: when pointed at a MariaDB server, the mysql driver appears to work, but vector queries and indexes throw exceptions;
  • don't call Schema::ensureVectorExtensionExists(): it appears in the AI SDK documentation but is a pgvector-specific helper, and on MariaDB it throws exceptions, since VECTOR is already a native type.

A migration, a cast on the model and a query are all you need to get a working vector column ($table->vector('embedding', dimensions: 1536)->index();), queryable with whereVectorSimilarTo().

Who did what

The work, concentrated between mid-August and the end of September, involved several contributors: alongside Mohamed Touhami Rhaima (vector queries, testing on MariaDB 11.8 LTS and 12.3 LTS, documentation), contributions came from michielvaneerd (vector indexes), eas4ai (vector binding and the AsVector cast), and xurshudyan (dropVectorIndex()). The pull requests were reviewed and merged by Taylor Otwell, Laravel's creator and maintainer.

What's left out of core

Laravel core currently supports only cosine distance. Euclidean distance and the M parameter for index tuning remain in a separate package, laravel-vector-metrics. Anyone switching metric needs to rebuild the index using the same metric employed in the queries: MariaDB only uses the vector index if the distance function matches.

For those staying on Laravel 12, Erik Ros's laravel-mariadb-vector package (over 2,000 installs) remains the available option.

Written with the help of artificial intelligence and checked by the editors (EU AI Act, art. 50). Source: MariaDB – rilasci.