- Can I use symfony/ai-typesense-store in a Laravel app without Symfony AI?
- No, this package requires Symfony AI as a dependency. If you’re not already using Symfony AI, consider alternatives like the standalone Typesense PHP client or Laravel-specific vector store packages. The tight coupling to Symfony AI’s StoreInterface makes it unsuitable for standalone Laravel projects.
- What Laravel versions are officially supported?
- The package doesn’t enforce Laravel version constraints directly, but it depends on Symfony AI (v0.8.0+), which is compatible with Laravel 10+. Test thoroughly with your Laravel version, as Symfony AI’s Laravel integration may introduce subtle dependencies.
- How do I configure the Typesense client in Laravel’s service container?
- Bind the store in `config/services.php` using Laravel’s container. Example: `'ai.typesense_store' => fn($container) => new TypesenseStore(new TypesenseClient(['nodes' => ['http://typesense.example.com:8108']]), 'collection_name')`. Ensure the Typesense client is properly instantiated with your API key and node URLs.
- Does this package support hybrid search (vector + keyword) out of the box?
- Yes, the package leverages Typesense’s native hybrid search capabilities. You can combine vector similarity with keyword filters (e.g., `find(['vector' => $embedding, 'filter_by' => 'category:electronics'])`). Refer to Typesense’s [vector search docs](https://typesense.org/docs/29.0/api/vector-search.html) for advanced query syntax.
- What happens if Typesense goes down? Can I implement a fallback?
- The package doesn’t include built-in fallback logic, but you can wrap the store in a custom service that retries or switches to a secondary store (e.g., Redis). Use Symfony AI’s `StoreInterface` to abstract the backend and implement a decorator pattern for resilience.
- How do I handle schema changes in Typesense without downtime?
- Typesense schemas are immutable, so changes require recreating the collection. Mitigate this by designing schemas with flexibility in mind—use JSON fields for dynamic attributes or maintain parallel collections during migrations. Document your schema evolution strategy in your team’s runbook.
- Are there performance benchmarks for large-scale vector searches?
- No official benchmarks exist, but Typesense handles ~10K+ vectors efficiently on modest hardware. Test your workload with Typesense’s [performance tuning guide](https://typesense.org/docs/0.24.1/performance.html) and monitor latency under load. Self-hosted instances may require scaling for high-throughput use cases.
- Can I use this with Laravel Scout for hybrid search?
- Indirectly, yes. You can use this package for vector-based retrieval (e.g., semantic search) and pair it with Scout for traditional keyword search. Combine results in your application logic or use Typesense’s hybrid search to merge both in a single query.
- What are the alternatives to symfony/ai-typesense-store for Laravel?
- For Laravel-specific solutions, consider `spatie/laravel-typesense` (for non-vector search) or direct integration with the [Typesense PHP client](https://github.com/typesense/typesense-php). For vector stores, `meilisearch/meilisearch-php` or `pgvector/pgvector` (PostgreSQL) are popular alternatives. Choose based on your need for Symfony AI’s ecosystem.
- How do I test this package in a Laravel CI pipeline?
- Mock the Typesense client in your tests using PHPUnit’s mocking tools. Example: `$store = $this->createMock(TypesenseStore::class); $store->method('find')->willReturn([...]);`. Test edge cases like network failures by injecting a failing client. Use Dockerized Typesense instances for integration tests.