symfony/ai-vektor-store
Symfony AI Store integration for the Vektor vector database. Use Vektor as a vector store backend in Symfony AI apps to store, index, and query embeddings for retrieval and semantic search. Links to Vektor docs and Symfony AI contribution resources.
symfony/ai). Laravel’s modularity allows wrapping Symfony’s Store interface in a Laravel service provider, enabling seamless adoption. The package’s adherence to Symfony’s conventions (e.g., dependency injection) aligns well with Laravel’s service container.http-client, process), this expands the footprint and potential for conflicts.pgvector, which may not be natively supported in all Laravel hosting environments (e.g., shared hosting, Heroku). This could limit deployment flexibility.Store interface with a custom provider, but this requires additional boilerplate code.http-client)?Vektor::search())?encrypt()) for sensitive embeddings?composer require symfony/ai centamiv/vektor
pgvector as the backend for Vektor. For Redis:
# Ensure Laravel's Redis extension is installed
pecl install redis
Store interface with Laravel’s container:
// app/Providers/VektorServiceProvider.php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Symfony\Component\AI\Store\VectorStoreInterface;
use Centamiv\Vektor\VektorStore;
class VektorServiceProvider extends ServiceProvider
{
public function register()
{
$this->app->singleton(VectorStoreInterface::class, function ($app) {
return new VektorStore(
$app['config']['ai.vektor.redis'] ?? 'redis',
$app['config']['ai.vektor.options'] ?? []
);
});
}
}
config/app.php:
'providers' => [
// ...
App\Providers\VektorServiceProvider::class,
],
Store methods. Example:
// Before: Custom Elasticsearch client
$results = $elasticsearch->search($query);
// After: Vektor via Symfony Store
$embedding = $vectorStore->embed($query);
$results = $vectorStore->search($embedding, ['limit' => 5]);
Engine to delegate vector queries to Vektor. Example:
// app/Scout/Engines/VektorEngine.php
namespace App\Scout\Engines
How can I help you explore Laravel packages today?