symfony/ai-voyage-platform
Symfony AI bridge for Voyage AI: integrate Voyage text and multimodal embeddings into Symfony apps. Provides a platform connector to call Voyage APIs and use embedding models for semantic search, RAG, and vector workflows.
symfony/ai; standalone Laravel projects may face higher integration friction.symfony/ai, symfony/http-client) may limit Laravel-native teams. Risk: Tight coupling to Symfony’s ecosystem if not properly abstracted.symfony/ai (v2.0+) and symfony/http-client. Laravel apps without these will need polyfills (e.g., php-http/guzzle9-adapter).dependency-injection can be replaced with Laravel’s container or PHP-DI (minimal overhead).messenger or cache components (if using advanced features like async processing).composer.json.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Symfony-Laravel DI Conflict | High | Use Laravel Service Providers to bind Symfony services or adopt PHP-DI as a neutral container. Avoid direct Symfony DI in Laravel. |
| Performance Overhead | Medium | Benchmark cold-start latency vs. direct Voyage API calls; cache responses with Redis or Laravel’s cache. |
| Vendor Lock-in | Low | Leverage the Provider abstraction to swap Voyage for alternatives (e.g., OpenAI, local models). Document fallback logic. |
| Limited Laravel Ecosystem | Medium | Create Laravel-specific wrappers (e.g., Facades, Collections) to abstract Symfony types (e.g., Message → Collection). |
| API Costs | High | Monitor Voyage’s pricing for high-volume use cases; implement rate limiting at the Laravel level (e.g., throttle middleware). |
| Early-Stage Package | Medium | Treat as beta: Plan for Symfony AI updates and contribute to the repo if critical changes are needed. |
symfony/ai already in the stack?
spatie/laravel-ai) is critical. Example: Use spatie/laravel-ai for vector similarity search.symfony/ai for multi-model AI workflows (e.g., hybrid embeddings + LLM generation).guzzlehttp/guzzle).Assessment Phase:
Proof of Concept (PoC):
composer require symfony/ai symfony/ai-voyage-platform symfony/http-client
// app/Providers/VoyageServiceProvider.php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\Config\FileLocator;
class VoyageServiceProvider extends ServiceProvider {
public function register() {
$container = new ContainerBuilder();
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/config'));
$loader->load('voyage.yaml'); // Define Symfony services
$this->app->singleton('symfony.container', fn() => $container);
}
}
voyage.yaml:
# config/voyage.yaml
services:
_defaults:
autowire: true
autoconfigure: true
Symfony\AI\Voyage\VoyageEmbeddingModel:
arguments:
$client: '@Symfony\AI\Voyage\VoyageClient'
use Symfony\AI\Voyage\VoyageEmbeddingModel;
$model = app('symfony.container')->get(VoyageEmbeddingModel::class);
$embeddings = $model->generate(['Your text here']);
composer require voyageai/voyage-php
// app/Facades/Voyage.php
namespace App\Facades;
use Illuminate\Support\Facades\Facade;
class Voyage extends Facade {
protected static function getFacadeAccessor() { return 'voyage'; }
}
// app/Providers/VoyageServiceProvider.php
use VoyageAI\Client;
$this->app->bind('voyage', function () {
return new Client(config
How can I help you explore Laravel packages today?