https://github.com/neuron-core/php-vector
Adapter for PHPVector database for Neuron AI framework
https://github.com/neuron-core/php-vector
php rag retrieval retrieval-augmented-generation similarity-search vector-database
Last synced: 16 days ago
JSON representation
Adapter for PHPVector database for Neuron AI framework
- Host: GitHub
- URL: https://github.com/neuron-core/php-vector
- Owner: neuron-core
- License: mit
- Created: 2026-04-01T06:02:43.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-06-04T13:04:21.000Z (16 days ago)
- Last Synced: 2026-06-04T14:10:11.366Z (16 days ago)
- Topics: php, rag, retrieval, retrieval-augmented-generation, similarity-search, vector-database
- Language: PHP
- Homepage: https://docs.neuron-ai.dev
- Size: 25.4 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Neuron AI Adapter for php-vector
PHPVector adapter for the [Neuron AI](https://neuron-ai.dev) framework. Implements
`NeuronAI\RAG\VectorStore\VectorStoreInterface` on top of `ezimuel/phpvector`.
## Dependencies
- PHP ^8.2
- [ezimuel/phpvector](https://github.com/ezimuel/PHPVector) ^0.3.0
- [Neuron AI](https://github.com/neuron-core/neuron-ai) ^3.0
## Installation
```bash
composer require neuron-core/php-vector
```
## Usage
Inside a Neuron RAG class:
```php
class MyRAG extends RAG
{
...
protected function vectorStore(): VectorStoreInterface
{
return new PHPVector(
path: '/var/data/mydb',
topK: 5,
);
}
}
```
Use it as a standalone component:
```php
use NeuronAI\PHPVector\PHPVector;
use PHPVector\VectorDatabase;
// Persistent database: pass a path to enable on-disk storage.
$store = new PHPVector(
path: '/var/data/mydb',
topK: 5,
);
```
## Persistence
By default, this adapter auto-saves after every mutation (`addDocument`, `addDocuments`,
`deleteBy`), batched to a single `save()` per call, so persistence "just works".
## Deletion
`deleteBy()` removes documents by Neuron's `sourceType` / `sourceName`, which this adapter
stores as PHPVector metadata:
```php
$store->deleteBy('pdf'); // all documents from sourceType "pdf"
$store->deleteBy('pdf', 'manual.pdf'); // only that exact source
```