File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -409,36 +409,6 @@ class MyChatBot extends RAG
409409
410410Learn more about RAG in the [ documentation] ( https://docs.neuron-ai.dev/rag/rag ) .
411411
412- ### ParadeDB hybrid retrieval
413-
414- ParadeDB can combine its BM25 full-text search with pgvector cosine similarity.
415- Configure both the vector store and the hybrid retrieval strategy explicitly:
416-
417- ``` php
418- use NeuronAI\RAG\Embeddings\OpenAIEmbeddingsProvider;
419- use NeuronAI\RAG\Retrieval\HybridRetrieval;
420- use NeuronAI\RAG\VectorStore\ParadeDBVectorStore;
421- use PDO;
422-
423- $embeddings = new OpenAIEmbeddingsProvider(
424- key: 'OPENAI_API_KEY',
425- model: 'text-embedding-3-small',
426- dimensions: 1536,
427- );
428- $store = new ParadeDBVectorStore(
429- new PDO('pgsql:host=localhost;dbname=app', 'app', 'password')
430- );
431- $store->setupTable(dimensions: 1536);
432-
433- $rag->setEmbeddingsProvider($embeddings);
434- $rag->setVectorStore($store);
435- $rag->setRetrieval(new HybridRetrieval($store, $embeddings));
436- ```
437-
438- ` setupTable() ` enables the ` vector ` and ` pg_search ` extensions and creates the
439- table, BM25 index, and HNSW cosine index. The connected database user therefore
440- needs permission to create extensions and database objects during setup.
441-
442412<a name =" workflow " >
443413
444414## Workflow
You can’t perform that action at this time.
0 commit comments