This is the PHPVector adapter for the Neuron AI framework.
composer require neuron-core/php-vector
use NeuronAI\PHPVector\PHPVector;
class MyRAG extends RAG
{
...
protected function vectorStore(): VectorStoreInterface
{
return new PHPVector(
database: new VectorDatabase(path: '/var/data/mydb'),
topK: 5
);
}
}use NeuronAI\PHPVector\PHPVector;
class MyAgent extends Agent
{
...
protected function tools(): array
{
return [
RetrievalTool::make(
new SimilarityRetrieval(
$this->vectorStore(),
$this->embeddings()
)
),
];
}
protected function vectorStore(): VectorStoreInterface
{
return new PHPVector(
database: new VectorDatabase(path: '/var/data/mydb'),
topK: 5
);
}
protected function embeddings(): EmbeddingsProviderInterface
{
return new OllamaEmbeddingsProvider(
model: 'OLLAMA_EMBEDDINGS_MODEL'
);
}
}