symfony/ai-maria-db-store
MariaDB vector store integration for Symfony AI Store. Requires MariaDB 11.7+ for VECTOR columns, vector indexing, and distance search. Useful for building RAG and similarity search apps backed by MariaDB.
VECTOR columns, indexes). This contrasts with dedicated vector databases, potentially increasing operational overhead for schema evolution.symfony/dependency-injection) or custom wrappers.AiStoreInterface, potentially requiring custom bootstrapping.config/ai.php, adding maintenance overhead.ALTER TABLE).pgvector, Milvus).ALTER TABLE) fit into deployments?VectorStoreInterface) to allow future swaps (e.g., to pgvector)?symfony/dependency-injection and symfony/console-bridge via Composer to resolve Symfony’s AiStoreInterface in Laravel’s container.AppServiceProvider:
public function register()
{
$this->app->singleton(\Symfony\Component\AI\Store\AiStoreInterface::class, function ($app) {
return new \Symfony\AI\MariaDbStore\MariaDbStore(
$app['db']->connection('mariadb')->getPdo(),
config('ai.maria_db_store')
);
});
}
config/ai.php:
'maria_db_store' => [
'dsn' => env('DATABASE_MARIADB_URL'),
'table' => 'ai_embeddings',
'vector_column' => 'embedding',
'distance' => 'cosine',
'dimensions' => 1536,
],
use Symfony\AI\MariaDbStore\MariaDbStore;
$store = new MariaDbStore(
DB::connection('mariadb')->getPdo(),
config('ai.maria_db_store')
);
config/ai.php supports different environments (e.g., staging/production).ai_embeddings) with VECTOR column and index.config/ai.php.SELECT * FROM ai_embeddings ORDER BY VECTOR_DISTANCE(...) LIMIT 10).WHERE category = 'tech').ALTER TABLE impact on production).composer why symfony/dependency-injection to resolve conflicts; consider alias packages if needed.CREATE TABLE ai_embeddings (
id INT AUTO_INCREMENT PRIMARY KEY,
embedding VECTOR(1536),
metadata JSON,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB;
CREATE INDEX idx_embedding ON ai_embeddings ((embedding)) USING HNSW;
How can I help you explore Laravel packages today?