Skip to content

Commit

Permalink
feat: Enable hybrid search strategy for Elasticsearch (#41)
Browse files Browse the repository at this point in the history
* Update retrieval result

* Update deps

* Update lint

* Update yaml

* Add lint

* Update lint

* Update test case

* Add job name

* Add status badge

* Add coverage task

* Fix coverage

* Fix yaml

* Add workflow permission

* Add test coverage

* Load knowledge

* Update test threshold

* Update coverage threshold

* Update name

* Use hybrid strategy for es
  • Loading branch information
moria97 authored Jun 3, 2024
1 parent 447f014 commit 061f796
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
25 changes: 13 additions & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ llama-index-readers-database = "^0.1.3"
llama-index-vector-stores-chroma = "^0.1.6"
llama-index-vector-stores-faiss = "^0.1.2"
llama-index-vector-stores-analyticdb = "^0.1.1"
llama-index-vector-stores-elasticsearch = "^0.1.7"
llama-index-vector-stores-elasticsearch = "^0.2.0"
llama-index-vector-stores-milvus = "^0.1.10"
gradio = "3.41.0"
faiss-cpu = "^1.8.0"
Expand Down
2 changes: 2 additions & 0 deletions src/pai_rag/modules/index/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from llama_index.vector_stores.chroma import ChromaVectorStore
from llama_index.vector_stores.elasticsearch import ElasticsearchStore
from llama_index.vector_stores.milvus import MilvusVectorStore
from elasticsearch.helpers.vectorstore import AsyncDenseVectorStrategy

from pai_rag.integrations.vector_stores.vector_stores_hologres.hologres import (
HologresVectorStore,
Expand Down Expand Up @@ -128,6 +129,7 @@ def _get_or_create_es(self):
es_url=es_config["es_url"],
es_user=es_config["es_user"],
es_password=es_config["es_password"],
retrieval_strategy=AsyncDenseVectorStrategy(hybrid=True),
)

def _get_or_create_milvus(self):
Expand Down

0 comments on commit 061f796

Please sign in to comment.