symfony/ai-weaviate-store
Weaviate vector store integration for Symfony AI Store. Connect to a Weaviate instance to index embeddings and run similarity search using Weaviate’s APIs (REST/GraphQL). Part of the Symfony AI ecosystem.
StoreInterface, enabling plug-and-play integration for semantic search, RAG, or recommendation systems.StoreFactory and ScopingHttpClient patterns allow for custom HTTP configurations, critical for Laravel’s dependency injection and middleware pipelines.StoreInterface allows for future-proofing—new Weaviate features can be added without breaking Laravel integrations.ai service provider).AiClient to align with Laravel’s Http facade or Manager pattern.php artisan weaviate:schema:update).upsert, remove) and similarity search, but advanced Weaviate features (e.g., graph traversals) require direct API calls.http-client may clash with Laravel’s Guzzle. Mitigation: Pin versions in composer.json or use platform.sh for isolation.AiClient may face adoption friction. Mitigation: Provide Laravel-specific documentation or wrappers.weaviate:query:{hash}).Use Case Validation:
pgvector) suffice?Symfony Integration Strategy:
AiClient be exposed to Laravel? Options:
Weaviate::store()->findNearest(...).WeaviateStore to Laravel’s container.HttpClient globally, or isolate it to this module?Weaviate Infrastructure:
Data Pipeline:
spatie/laravel-ai)?Long-Term Maintenance:
Core Stack:
symfony/ai-weaviate-store (v0.8+).symfony/http-client (v6.4+).symfony/ai (v0.8+).guzzlehttp/guzzle (if avoiding Symfony HTTP client).spatie/laravel-ai (for embedding generation).predis/predis (for Redis caching).Architecture:
app/Modules/AI).AiClient via a Laravel facade (e.g., Weaviate::store()).WeaviateStore to Laravel’s container for dependency injection.Phase 1: Proof of Concept (1–2 weeks)
composer require symfony/ai-weaviate-store symfony/ai symfony/http-client
AiClient:
// app/Facades/Weaviate.php
public static function store(): StoreInterface {
return app(WeaviateStore::class);
}
$store = Weaviate::store();
$results = $store->findNearest('query_embedding', limit: 5);
Phase 2: Laravel Integration (2–3 weeks)
WeaviateStore:
// app/Providers/WeaviateServiceProvider.php
public function register() {
$this->app->singleton(WeaviateStore::class, function ($app) {
$httpClient = new ScopingHttpClient();
return new WeaviateStore($httpClient, 'http://weaviate:8080');
});
}
php artisan make:command WeaviateSchemaUpdate
spatie/laravel-ai).Phase 3: Optimization (1–2 weeks)
// app/Jobs/WeaviateBatchInsert.php
public function handle() {
$store = Weaviate::store();
foreach ($this->embeddings as $embedding) {
$store->upsert($embedding);
}
}
$cacheKey = "weaviate:query:{$queryHash}";
if (Redis::has($cacheKey)) {
return Redis::get($cacheKey);
}
$results = $store->findNearest($query);
Redis::setex($cacheKey, 3600, $results);
return $results;
How can I help you explore Laravel packages today?