PHPackages                             hkulekci/qdrant - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. hkulekci/qdrant

ActiveLibrary[API Development](/categories/api)

hkulekci/qdrant
===============

PHP Client for Qdrant

v0.5.8(1y ago)157174.4k↓14.2%31[2 issues](https://github.com/hkulekci/qdrant-php/issues)[1 PRs](https://github.com/hkulekci/qdrant-php/pulls)9MITPHPPHP ^8.1

Since Apr 24Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/hkulekci/qdrant-php)[ Packagist](https://packagist.org/packages/hkulekci/qdrant)[ RSS](/packages/hkulekci-qdrant/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (16)Used By (9)

Qdrant PHP Client
=================

[](#qdrant-php-client)

[![Test Application](https://github.com/hkulekci/qdrant-php/actions/workflows/test.yaml/badge.svg)](https://github.com/hkulekci/qdrant-php/actions/workflows/test.yaml) [![codecov](https://camo.githubusercontent.com/7c1c74d1ab107fe01f6b2edc2beaf7021a12f10998e0056dbe43279aee427579/68747470733a2f2f636f6465636f762e696f2f6769746875622f686b756c656b63692f716472616e742d7068702f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d354b3846414930433942)](https://codecov.io/github/hkulekci/qdrant-php)

This library is a PHP Client for Qdrant.

Qdrant is a vector similarity engine &amp; vector database. It deploys as an API service providing search for the nearest high-dimensional vectors. With Qdrant, embeddings or neural network encoders can be turned into full-fledged applications for matching, searching, recommending, and much more!

Installation
============

[](#installation)

You can install the client in your PHP project using composer:

```
composer require hkulekci/qdrant
```

### Connecting to Qdrant

[](#connecting-to-qdrant)

```
include __DIR__ . "/../vendor/autoload.php";
include_once 'config.php';

use Qdrant\Qdrant;
use Qdrant\Config;
use Qdrant\Http\Builder;

$config = new Config(QDRANT_HOST);
$config->setApiKey(QDRANT_API_KEY);

$transport = (new Builder())->build($config);
$client = new Qdrant($transport);
```

### Creating a Collection

[](#creating-a-collection)

```
use Qdrant\Endpoints\Collections;
use Qdrant\Models\Request\CreateCollection;
use Qdrant\Models\Request\VectorParams;

$createCollection = new CreateCollection();
$createCollection->addVector(new VectorParams(1536, VectorParams::DISTANCE_COSINE), 'content');
$response = $client->collections('contents')->create($createCollection);
```

### Inserting Points Into Collection

[](#inserting-points-into-collection)

```
use Qdrant\Models\PointsStruct;
use Qdrant\Models\PointStruct;
use Qdrant\Models\VectorStruct;

$openai = OpenAI::client(OPENAI_API_KEY);

$query = 'sustainable agricultural startups';
$response = $openai->embeddings()->create([
    'model' => 'text-embedding-ada-002',
    'input' => $query,
]);
$embedding = array_values($response->embeddings[0]->embedding);

$points = new PointsStruct();
$points->addPoint(
    new PointStruct(
        (int) $imageId,
        new VectorStruct($embedding, 'content'),
        [
            'id' => 1,
            'meta' => 'Meta data'
        ]
    )
);
$client->collections('contents')->points()->upsert($points);
```

### Wait for Acknowledges

[](#wait-for-acknowledges)

While upsert data, if you want to wait for upsert to actually happen, you can use query parameters:

```
$client->collections('contents')->points()->upsert($points, ['wait' => 'true']);
```

You can check for more parameters : [https://qdrant.github.io/qdrant/redoc/index.html#tag/points/operation/upsert\_points](https://qdrant.github.io/qdrant/redoc/index.html#tag/points/operation/upsert_points)

### Search on Points

[](#search-on-points)

Search with a filter :

```
use Qdrant\Models\Filter\Condition\MatchString;
use Qdrant\Models\Filter\Filter;
use Qdrant\Models\Request\SearchRequest;
use Qdrant\Models\VectorStruct;

$searchRequest = (new SearchRequest(new VectorStruct($embedding, 'elev_pitch')))
    ->setFilter(
        (new Filter())->addMust(
            new MatchString('name', 'Palm')
        )
    )
    ->setLimit(10)
    ->setParams([
        'hnsw_ef' => 128,
        'exact' => false,
    ])
    ->setWithPayload(true);

$response = $client->collections('contents')->points()->search($searchRequest);
```

### Search on Points with OpenAI Embeddings

[](#search-on-points-with-openai-embeddings)

```
$openai = OpenAI::client(OPENAI_API_KEY);

$query = 'lorem ipsum dolor sit amed';
$response = $openai->embeddings()->create([
    'model' => 'text-embedding-ada-002',
    'input' => $query,
]);
$embedding = array_values($response->embeddings[0]->embedding);

$searchRequest = (new SearchRequest(new VectorStruct($embedding, 'content')))
    ->setLimit(10)
    ->setParams([
        'hnsw_ef' => 128,
        'exact' => false,
    ])
    ->setWithPayload(true);

$response = $client->collections('contents')->points()->search($searchRequest);

foreach ($response['result'] as $item) {
    echo $item['score'] . ';' . $item['payload']['id'] . ';' . $item['payload']['meta_data'] . PHP_EOL;
}
```

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance67

Regular maintenance activity

Popularity52

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~45 days

Total

14

Last Release

535d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b6ed736e5ca125af79eb457d08626694b6e83e18e0a7597b4e37b891ad60eb4e?d=identicon)[hkulekci](/maintainers/hkulekci)

---

Top Contributors

[![hkulekci](https://avatars.githubusercontent.com/u/586318?v=4)](https://github.com/hkulekci "hkulekci (117 commits)")[![gregpriday](https://avatars.githubusercontent.com/u/1126859?v=4)](https://github.com/gregpriday "gregpriday (20 commits)")[![yunwuxin](https://avatars.githubusercontent.com/u/2168125?v=4)](https://github.com/yunwuxin "yunwuxin (2 commits)")[![NiCr42](https://avatars.githubusercontent.com/u/18549424?v=4)](https://github.com/NiCr42 "NiCr42 (2 commits)")[![yaroslavpopovic](https://avatars.githubusercontent.com/u/12303752?v=4)](https://github.com/yaroslavpopovic "yaroslavpopovic (2 commits)")[![adrmrn](https://avatars.githubusercontent.com/u/22296760?v=4)](https://github.com/adrmrn "adrmrn (2 commits)")[![julien-jourde](https://avatars.githubusercontent.com/u/82051126?v=4)](https://github.com/julien-jourde "julien-jourde (2 commits)")[![mbukovy](https://avatars.githubusercontent.com/u/27806309?v=4)](https://github.com/mbukovy "mbukovy (2 commits)")[![fafiebig](https://avatars.githubusercontent.com/u/499340?v=4)](https://github.com/fafiebig "fafiebig (1 commits)")[![evil1morty](https://avatars.githubusercontent.com/u/42971559?v=4)](https://github.com/evil1morty "evil1morty (1 commits)")[![snapshotpl](https://avatars.githubusercontent.com/u/312655?v=4)](https://github.com/snapshotpl "snapshotpl (1 commits)")

---

Tags

phpphp-clientqdrantqdrant-vector-database

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hkulekci-qdrant/health.svg)

```
[![Health](https://phpackages.com/badges/hkulekci-qdrant/health.svg)](https://phpackages.com/packages/hkulekci-qdrant)
```

###  Alternatives

[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15224.3M65](/packages/opensearch-project-opensearch-php)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
