- What is symfony/ai-mongo-db-store used for?
- It is the MongoDB Atlas vector store bridge for Symfony AI Store. It lets you persist embeddings and documents in Atlas collections and run vector similarity queries through Symfony AI's StoreInterface. Typical uses include semantic search, retrieval-augmented generation, and similarity search in Laravel applications.
- How do I install symfony/ai-mongo-db-store in Laravel?
- Install it with Composer using composer require symfony/ai-mongo-db-store. You also need PHP 8.1 or newer, mongodb/mongodb 2.0 or newer, and a compatible Symfony AI Store version. After installation, register and configure the store in a Laravel service provider.
- Does symfony/ai-mongo-db-store support Laravel 10, 11, or 12?
- It is not a Laravel-specific package, so support depends on your app's PHP and dependency constraints rather than a Laravel version number. Modern Laravel applications on PHP 8.1+ with mongodb/mongodb 2.0+ can use it, but you must verify compatibility with your installed Symfony AI packages. There is no native Eloquent or Laravel Scout integration included.
- Do I need MongoDB Atlas for this vector store?
- Yes, the package targets MongoDB Atlas and requires Atlas Vector Search to be enabled on the collection you query. Self-hosted MongoDB and multi-cloud vector search are not supported by this bridge. Production use typically requires an Atlas tier that supports Vector Search.
- How do I configure the MongoDB Atlas store in a Laravel service provider?
- Configure the Atlas URI, database, collection, credentials, and TLS settings through environment variables, then instantiate the Symfony AI store in a service provider. Bind it as a singleton or scoped service so controllers, jobs, and admin endpoints share the same configuration. Initial setup is usually about 5 to 10 lines of PHP plus your Atlas collection and vector index configuration.
- What is VectorDocumentInterface in version 0.14.0?
- VectorDocumentInterface introduces a formal contract for a stored embedding and document pair in Symfony AI Store. It improves type safety and extensibility for inserts and retrievals. New integrations should implement or use the interface where possible, and existing code that passes raw arrays should be tested for compatibility.
- What does the new count capability do?
- The count capability lets you count stored documents or vectors through the store instead of querying MongoDB directly. It is useful for pagination, admin dashboards, ingestion reconciliation, health checks, and quota enforcement. Confirm whether your version counts all documents or only vector-indexed documents and whether filtered counts are supported.
- Does this package support hybrid search or metadata filtering?
- The bridge does not natively support hybrid search; vector similarity retrieval is the primary feature. You can post-filter vector results with MongoDB native queries, and VectorDocumentInterface can make metadata alongside vectors easier to model. Hybrid ranking and query fusion remain application-managed.
- How should I test a Laravel app using symfony/ai-mongo-db-store?
- The bridge does not document a Laravel-specific fake or testing helper, so wrap the store behind your own interface or mock Symfony AI's StoreInterface for unit tests. Use a dedicated Atlas collection with Vector Search enabled for integration tests, and keep credentials in CI secrets. Assert your ingestion counts and retrieval behavior separately from Atlas availability where possible.
- What are the production risks and alternatives to this package?
- The main risks are the hard dependency on MongoDB Atlas, Vector Search pricing, early-stage CRUD and vector features, and migration work if you adopt VectorDocumentInterface. The bridge lacks batch operations, dynamic indexing, async queries, and native hybrid search. Alternatives include other Symfony AI vector stores or building directly on MongoDB Atlas Vector Search if you do not need the Symfony AI abstraction.