PHPackages                             vectorifyai/vectorify-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. vectorifyai/vectorify-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vectorifyai/vectorify-php
=========================

Vectorify package for PHP. The fastest way to ask AI about your data.

1.0.4(10mo ago)25.8k1MITPHPPHP &gt;=8.2CI passing

Since Jul 6Pushed 10mo ago2 watchersCompare

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

READMEChangelog (5)Dependencies (4)Versions (6)Used By (1)

Vectorify package for PHP
=========================

[](#vectorify-package-for-php)

[![Latest Version](https://camo.githubusercontent.com/21fc98e9095c0c9cbdbcbd88536e0fe7cbc3b1853a5eccf632b1536884e215fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766563746f7269667961692f766563746f726966792d7068702e7376673f6c6162656c3d6c6174657374267374796c653d666c6174)](https://packagist.org/packages/vectorifyai/vectorify-php)[![Total Downloads](https://camo.githubusercontent.com/a2a35e0dee6117f609973a93b4698024c09c66a4f62e5fe459a5dfea88a7a587/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766563746f7269667961692f766563746f726966792d7068702e7376673f7374796c653d666c6174)](https://packagist.org/packages/vectorifyai/vectorify-php)[![Tests](https://camo.githubusercontent.com/be89ea126ec5d70be764df1a02af93877d68a37c34e6abf2ed849322df5ce506/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f766563746f7269667961692f766563746f726966792d7068702f74657374732e796d6c3f6c6162656c3d7465737473267374796c653d666c6174)](https://github.com/vectorifyai/vectorify-php/actions/workflows/tests.yml)[![License](https://camo.githubusercontent.com/0be41946f1960a23ddcb0c35736fe56bda7340e156bfae13fa30ba0dfee57693/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f766563746f7269667961692f766563746f726966792d7068702e7376673f7374796c653d666c6174)](LICENSE.md)

Vectorify is the end-to-end AI connector for PHP, letting you query and explore your data in natural language in seconds.

To interact with your data, you have four primary methods to choose from:

1. Use the [Chats](https://app.vectorify.ai/) page within our platform (fastest)
2. Embed the [Chatbot](https://docs.vectorify.ai/project/chatbot) into your PHP app (turn data querying into a product feature)
3. Add the [MCP](https://docs.vectorify.ai/mcp-server) server to ChatGPT, Claude, etc. (use your data anywhere you work)
4. Call the REST [API](https://docs.vectorify.ai/api-reference) endpoints (build custom integrations and workflows)

Unlike text-to-SQL tools that expose your entire database and take 30+ seconds per query, Vectorify uses proven RAG technology to deliver accurate answers in &lt;4 seconds while keeping your database secure. Head to our [blog](https://vectorify.ai/blog/vectorify-laravel-unlock-ai-ready-data-in-60-seconds) to learn more about Vectorify.

This package provides a simple and elegant way to interact with the Vectorify API. Ask AI about your data with ease.

Requirements
------------

[](#requirements)

- PHP 8.2 or higher

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require vectorifyai/vectorify-php
```

Quick Start
-----------

[](#quick-start)

```
use Vectorify\Vectorify;
use Vectorify\Objects\CollectionObject;
use Vectorify\Objects\ItemObject;
use Vectorify\Objects\UpsertObject;
use Vectorify\Objects\QueryObject;

// Initialize the client
$vectorify = new Vectorify('your-api-key');

// Create a collection
$collection = new CollectionObject(
    slug: 'invoices',
    metadata: [
        'customer_name' => ['type' => 'string'],
        'status' => [
            'type' => 'enum',
            'options' => ['draft', 'sent', 'paid'],
        ]
    ],
);

// Create items
$items = [
    new ItemObject(
        id: '123',
        data: [
            'customer_name' => 'John Doe',
            'status' => 'draft',
            'amount' => '100',
            'currency' => 'USD',
            'due_date' => '2023-10-01'
        ],
        metadata: [
            'customer_name' => 'John Doe',
            'status' => 'draft'
        ],
        tenant: 987,
        url: 'https://example.com/invoice/123',
    ),
];

// Upsert data
$upsertObject = new UpsertObject($collection, $items);
$success = $vectorify->upserts->create($upsertObject);

if ($success) {
    echo "Data upserted successfully!\n";
}

// Query data
$queryObject = new QueryObject(
    text: 'how many invoices are in draft status?',
    collections: ['invoices'],
    tenant: 987,
    identifier: [
        'id' => '123',
        'name' => 'John Doe',
        'email' => 'john@example.com',
    ]
);

$result = $vectorify->query->send($queryObject);

if ($result !== false) {
    print_r($result);
}
```

Features
--------

[](#features)

- **Rate Limiting**: Automatic rate limit handling with exponential backoff
- **Retry Logic**: Built-in retry mechanism for failed requests
- **Type Safety**: Fully typed objects for better development experience
- **Error Handling**: Comprehensive error handling and logging
- **PSR-7 Compatible**: Uses PSR-7 HTTP message interfaces

API Methods
-----------

[](#api-methods)

### Upsert

[](#upsert)

Create or update items in your Vectorify collection:

```
$upsertObject = new UpsertObject($collection, $items);
$success = $vectorify->upserts->create($upsertObject);
```

### Query

[](#query)

Ask questions about your data:

```
$queryObject = new QueryObject('your question here');
$result = $vectorify->query->send($queryObject);
```

Configuration
-------------

[](#configuration)

### Timeout

[](#timeout)

You can configure the request timeout when initializing the client:

```
$vectorify = new Vectorify('your-api-key', 60); // 60 seconds timeout
```

### Debug Logging

[](#debug-logging)

Enable debug logging by defining a constant:

```
define('VECTORIFY_DEBUG', true);
```

Error Handling
--------------

[](#error-handling)

The SDK includes comprehensive error handling:

- **Rate Limiting**: Automatically handles 429 responses with appropriate delays
- **Server Errors**: Retries server errors (5xx) with exponential backoff
- **Client Errors**: Returns `null` or `false` for client errors (4xx)
- **Network Errors**: Retries network-related errors

Changelog
---------

[](#changelog)

Please see [Releases](../../releases) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Pull requests are more than welcome. You must follow the PSR coding standards.

Security
--------

[](#security)

Please review [our security policy](https://github.com/vectorifyai/laravel-vectorify/security/policy) on how to report security vulnerabilities.

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance54

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~3 days

Total

5

Last Release

305d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/9ca06c358f37f03d22661c4260bbc12ca3e96057c0d6f6417f4e04d54522ac49?d=identicon)[emilyhendon](/maintainers/emilyhendon)

---

Top Contributors

[![emilyhendon](https://avatars.githubusercontent.com/u/202198324?v=4)](https://github.com/emilyhendon "emilyhendon (10 commits)")

---

Tags

aillmmcpphpragvectorvector-databasephpsdkmcpaivectoropenaiAgentllmragvector-database

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vectorifyai-vectorify-php/health.svg)

```
[![Health](https://phpackages.com/badges/vectorifyai-vectorify-php/health.svg)](https://phpackages.com/packages/vectorifyai-vectorify-php)
```

###  Alternatives

[vectorifyai/vectorify-laravel

Vectorify package for Laravel. The fastest way to ask AI about your data.

206.1k](/packages/vectorifyai-vectorify-laravel)[maestroerror/laragent

Power of AI Agents in your Laravel project

630106.4k](/packages/maestroerror-laragent)[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)[vizra/vizra-adk

Vizra Agent Development Kit - A comprehensive Laravel package for building intelligent AI agents.

29026.1k](/packages/vizra-vizra-adk)[llm-agents/agents

LLM Agents PHP SDK - Autonomous Language Model Agents for PHP

16410.9k9](/packages/llm-agents-agents)[soukicz/llm

LLM client with support for cache, tools and async requests

445.6k](/packages/soukicz-llm)

PHPackages © 2026

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