Retrieval
Implement custom retrieval strategies
Introduction
namespace App\Neuron;
use NeuronAI\Providers\AIProviderInterface;
use NeuronAI\RAG\Embeddings\EmbeddingsProviderInterface;
use NeuronAI\RAG\RAG;
use NeuronAI\RAG\RAG\Retrieval\RetrievalInterface;
use NeuronAI\RAG\RAG\Retrieval\SimilarityRetrieval;
use NeuronAI\RAG\VectorStore\VectorStoreInterface;
class WorkoutTipsAgent extends RAG
{
protected function retrieval(): RetrievalInterface
{
return new SimilarityRetrieval(
$this->resolveVectorStore(),
$this->resolveEmbeddingsProvider()
);
}
protected function provider(): AIProviderInterface
{
// Return an instance of an AI provider...
}
protected function embeddings(): EmbeddingsProviderInterface
{
// Return an embeddings provider instance...
}
protected function vectorStore(): VectorStoreInterface
{
// Return a vector store instance...
}
}RAPTOR Retrieval Module
Last updated