Download the PHP package x-laravel/embedding-qdrant-driver without Composer
On this page you can find all versions of the php package x-laravel/embedding-qdrant-driver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package embedding-qdrant-driver
x-laravel/embedding — Qdrant Driver
Qdrant vector database driver for x-laravel/embedding.
How It Works
- Implements
SimilarityDriver— registers as theqdrantdriver, similarity search runs entirely in Qdrant using its native ANN (Approximate Nearest Neighbor) engine - Implements
VectorStore— writes embeddings to both the SQLembeddingstable (for Eloquent relationships) and the Qdrant collection (for search) - Implements
PayloadStore— keeps payload records in the SQLembeddablestable and mirrors them onto the entity's Qdrant points, so payloadfilter:constraints run natively in Qdrant
Requirements
- PHP ^8.3
- Laravel ^12.0 | ^13.0
x-laravel/embedding ^1.0- Qdrant server (self-hosted or Qdrant Cloud)
Installation
The QdrantEmbeddingServiceProvider is auto-discovered and registers the qdrant driver automatically.
Setup
1. Configure x-laravel/embedding
Publish the config if you haven't already:
Set the similarity driver in config/embedding.php:
2. Configure Qdrant
Set the following environment variables:
Or publish the config to config/embedding-qdrant-driver.php for full customisation:
3. Create the SQL tables and the Qdrant collection
Migrations are not loaded automatically. Publish the core migrations (embeddings and embeddables tables) and this driver's Qdrant collection migration, then run them:
The embedding-qdrant tag also publishes config/embedding-qdrant-driver.php.
Note: The Qdrant collection is created with cosine similarity. The
EMBEDDING_DIMENSIONSconfig value sets the vector size — it must match your AI model's output dimension.
4. Model
Follow the standard x-laravel/embedding setup. No Qdrant-specific changes are needed on your models.
Usage
The driver is transparent — use the standard x-laravel/embedding API:
All methods set a similarity_score float attribute on each returned model. A threshold of 0.0 returns every match; a positive value is passed to Qdrant as score_threshold.
Payload filtering
Models using #[EmbedPayload] can filter similarity searches inside Qdrant:
How the payload reaches Qdrant:
- The SQL
embeddablestable stays the source of truth.QdrantPayloadStoreextends the coreDatabasePayloadStore: after writing the row it sets the same payload under thepayloadkey of every Qdrant point of that entity (all slots), and removes that key when the row is deleted. QdrantVectorStorereads the entity's currentembeddablesrow when it upserts a point, so a point written after the payload sync carries the payload too.- The driver turns the filter into Qdrant conditions on
payload.<key>:match.valuefor equality,match.anyfor IN,is_nullfornull, all ANDed inmust. An empty array matches nothing. - Qdrant matches by JSON type, so
34never matches"34"andtruenever matches1. Records without a payload row never match a filtered search. - Hits are checked against the SQL tables before models are loaded: points whose
embeddingsrow is gone, or (for a filtered search) whoseembeddablesrow is gone, are dropped.
Filter keys must match ^[A-Za-z_][A-Za-z0-9_]*$. For large collections, create Qdrant payload indexes on embeddable_type, slot and the payload.<key> fields you filter on.
Note: Qdrant points are not deleted when their
embeddingsrows are: deleting a model,embedding:vector:clearandembedding:vector:cleanremove SQL rows only, andembedding:payload:clear/embedding:payload:cleanbypass thePayloadStore. Search results stay correct because hits are checked against SQL, but the stale points remain in the collection and count againstlimit. Runembedding:payload:sync --forceafter clearing payloads if you want Qdrant back in step.
Testing
License
This package is open-sourced software licensed under the MIT license.
All versions of embedding-qdrant-driver with dependencies
illuminate/support Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
x-laravel/embedding Version ^1.0