- How do I install symfony/ai-store in a Laravel application?
- Install the core abstraction with composer require symfony/ai-store, then add the bridge for your backend, for example symfony/ai-postgres-store or symfony/ai-pinecone-store. Because the component is experimental and not covered by Symfony's backward compatibility promise, pin a minor range such as ^0.14.0 in composer.json. There is no Laravel service provider to publish, so you wire the store into the container yourself in a service provider.
- Which vector store backends does symfony/ai-store support?
- The core package only defines the abstraction; each backend ships as a separate bridge package. Official bridges include PostgreSQL pgvector, SQLite, Redis, MariaDB, MongoDB Atlas, Pinecone, Weaviate, Qdrant, Milvus, ChromaDB, Typesense, Meilisearch, Elasticsearch, OpenSearch, ClickHouse, Neo4j, Supabase, Azure AI Search, AWS S3 Vectors, Cloudflare Vectorize, ManticoreSearch, SurrealDB, Vektor and a generic Cache store. That means you can start on SQLite or pgvector locally and move to a managed service in production without rewriting your application code.
- How do I bind StoreInterface to a concrete store in Laravel's service container?
- In a service provider's register method, bind the interface to a factory closure, for example $this->app->bind(StoreInterface::class, fn () => new PostgresStore($connection)). Constructor signatures differ per bridge, so check the bridge documentation for the exact client or connection arguments. Once bound, you can type-hint StoreInterface in controllers, jobs and services and Laravel will resolve the correct implementation.
- Is symfony/ai-store compatible with Laravel 10, 11 and 12?
- Symfony AI components are framework-agnostic PHP packages with no hard dependency on Laravel, so compatibility is driven mainly by the PHP version constraint in the package's composer.json rather than by the Laravel release. In practice any recent Laravel version running a supported PHP build will work, but there is no official Laravel support matrix published by Symfony. Check the PHP requirement before installing and run your test suite after adding the package.
- How do I test Laravel code that depends on symfony/ai-store?
- Because everything is programmed against StoreInterface, you can bind a fake or in-memory implementation in the container during tests instead of hitting a real backend. Since v0.14.0 documents are typed against VectorDocumentInterface rather than a concrete class, creating test doubles for documents is trivial and no longer requires array-to-object mapping. The package does not ship Laravel-specific testing helpers, so a small hand-written fake store is usually the cleanest option. The cache store bridge is also handy for fast, dependency-free integration tests.
- Is symfony/ai-store safe to use in production if it is experimental?
- It can be used in production, but the component is explicitly marked experimental and is not covered by Symfony's backward compatibility promise, so minor releases may contain breaking changes. Mitigate by pinning a minor version range such as ^0.14.0, gating store calls behind a feature flag, and reviewing the Symfony AI release notes before every upgrade. Also audit any custom store implementations or decorators, since interface additions like count() will fatal if not implemented.
- Does symfony/ai-store integrate with Laravel Scout?
- No, there is no native Scout driver or first-party adapter for this package, so it cannot replace Scout's full-text engine out of the box. You would need to write a custom Scout engine that delegates to StoreInterface, or keep Scout for keyword search and use the AI Store alongside it. The HybridQuery type, which combines keyword and vector matching, is a good fit for building a unified search UI on top of both.
- What changed in symfony/ai-store v0.14.0 and will it break my code?
- Version 0.14.0 introduced VectorDocumentInterface type hints, a count() method on stores, support for any VectorInterface in vector queries, and indexer options passthrough. The count() addition is the riskiest change: any in-house StoreInterface implementation or decorator such as a caching or tenancy wrapper must add the method or it will fatal. Code that type-hints the concrete VectorDocument class or relies on instanceof checks should also be reviewed. A short spike branch plus your existing test suite is usually enough to confirm the upgrade is safe.
- How do I index documents asynchronously using Laravel queues?
- Wrap calls to IndexerInterface in a queued job so batch indexing and embedding generation run off the request cycle. In v0.14.0 the indexer options passthrough lets each dispatched job vary loader behaviour, such as batch size or filters, without changing the loader class. This pattern is especially useful with cloud bridges like Pinecone or Azure AI Search, where rate limits and per-request costs make controlled batches important.
- Can I use an Eloquent model as a VectorDocument in symfony/ai-store?
- Yes, as of v0.14.0 documents are type-hinted against VectorDocumentInterface, so an Eloquent model or a DTO can implement the interface directly and be stored without a manual mapping layer. The package does not ship a HasVectorDocument trait, but writing one in-house is straightforward now that the interface exists. This keeps your domain objects as the single source of truth and makes it easy to swap between a local SQLite store and a hosted vector database.