symfony/ai-supabase-store
Supabase vector store integration for Symfony AI Store using PostgreSQL pgvector. Connect your Symfony AI apps to Supabase vector columns and the match_documents RPC for similarity search, with links to Supabase docs and Symfony AI contribution/resources.
symfony/http-client for Supabase API calls). The StoreInterface abstraction allows for modular swapping if Laravel’s ecosystem (e.g., spatie/laravel-ai) evolves to support similar patterns.symfonycasts/laravel-ai) and stored/retrieved. Avoids reinventing vector storage for Laravel apps using Supabase.query() method with filter support aligns with Laravel’s Eloquent query builder patterns, easing adoption for Laravel devs familiar with where() clauses.supabase-js PHP port), though this reduces pgvector-specific optimizations.symfony/service-contracts wrappers) or manual instantiation.match_documents RPC; custom schemas would need manual RPC adjustments.StoreInterface for Laravel’s service container?spatie/laravel-ai + custom pgvector driver) be more maintainable?symfonycasts/laravel-ai, tighten/laravel-ai) for RAG or embeddings.illuminate/database); MySQL/SQLite users would need a proxy layer.match_documents) if using Supabase.// app/Providers/SupabaseStoreServiceProvider.php
use Symfony\AI\Store\SupabaseStore;
use Illuminate\Support\ServiceProvider;
class SupabaseStoreServiceProvider extends ServiceProvider {
public function register() {
$this->app->singleton('supabase.store', function ($app) {
return new SupabaseStore(
new \Symfony\AI\Store\SupabaseClient(
config('supabase.url'),
config('supabase.key')
),
config('supabase.store.table'),
config('supabase.store.embedding_column')
);
});
}
}
config/supabase.php:
'store' => [
'table' => 'documents',
'embedding_column' => 'embedding_vector',
'id_column' => 'id',
],
SupabaseStore::add() in a Laravel command to bulk-import:
use Illuminate\Support\Facades\Artisan;
Artisan::call('supabase:import', [
'file' => 'path/to/vectors.csv',
'table' => 'documents',
]);
symfony/http-client for Supabase API).supabase/supabase-php or a custom client wrapper.composer require with --update-with-dependencies cautiously.DATABASE_MIGRATIONS.md.// Log vector queries
\Log::debug('Vector query', [
'query' => $query->getEmbedding(),
'filters' => $query->getFilters(),
'response' => $response->getResults(),
]);
use Symfony\Component\HttpClient\RetryableHttpClient;
$client = new RetryableHttpClient(
new \Symfony\Contracts\HttpClient\HttpClientInterface(),
[
'max_retries' => 3,
'delay' => 100,
]
);
hnsw indexes). Consider:
match_documents with ef/ivf parameters.| Failure Point | Impact | Mitigation |
|---|---|---|
| Supabase API downtime | Vector queries fail | Implement circuit breakers with Laravel’s Illuminate\Cache\Repository. |
| pgvector index corruption | Slow queries | Regular backups; monitor query plans via EXPLAIN ANALYZE. |
| Schema mismatches | Runtime errors | Use Laravel migrations to validate schema before queries. |
| High RPC latency | Poor user experience | Cache frequent queries in Redis with a TTL. |
| Laravel-Symfony DI conflicts | Service registration failures | Use symfony/service-contracts adapters or manual instantiation. |
StoreInterface.How can I help you explore Laravel packages today?