A playground for RAG development from pubmed API (starting with bkg-review project)
Work in progress..
-
Install poetry on your device
-
Clone this repository
-
Set up environment by
- open terminal
cd
into repo directory- running
poetry install
-
activate the environment by running
poetry shell
in repo dir -
a running instance of the Milvus
-
download ollama and set up account
Using pubmed_rag/get_embeddings.py
python pubmed_rag/get_embeddings.py --config <path to config file>
Args:
--config
or-c <path to config file>
--files_downloaded
or-fd <path to folder with biocjson files>
Examples:
python pubmed_rag/get_embeddings.py -c demo/config.yaml -fd biocjson
python pubmed_rag/get_embeddings.py --config config.yaml
Using pubmed_rag/create_db.py
python pubmed_rag/create_db.py --config <path to config file>
Args:
--config
or-c <path to config file>
Examples:
python pubmed_rag/create_db.py -c demo/config.yaml
python pubmed_rag/create_db.py --config /users/blah/what/config.yaml
Instead, using get_pmid_vdb.sh which will carry out 2.a) and 2.b)
bash get_pmid_vdb.sh --files_downloaded <path to folder with biocjson files> --config <path to config file>
Args:
--config
or-c <path to config file>
--files_downloaded
or-fd <path to folder with biocjson files>
Examples:
bash get_pmid_vdb.sh --config demo/config.yaml
bash get_pmid_vdb.sh -fd demo/output -c /users/blah/what/config.yaml
Using pubmed_rag/run_search.py
python pubmed_rag/run_search.py --config <path to config file> --query <the LLM prompt>
Args:
--config
or-c <path to config file>
--query
or--q <text to embed>
Examples:
python pubmed_rag/run_search.py -c demo/config.yaml -q "Can you please tell me what nodes and edges I should include in a biological knowledge graph for drug repurposing?"
python pubmed_rag/run_search.py --config demo/config.yaml --query "Best databases to use for a knowledge graph for biological question answering?"
Using use_rag.py
python pubmed_rag/use_rag.py --config <path to config file> --query <the LLM prompt>
Args:
--config
or-c <path to config file>
--query
or--q <text to embed>
Examples:
python pubmed_rag/use_rag.py -c demo/config.yaml -q "Can you please tell me what nodes and edges I should include in a biological knowledge graph for drug repurposing?"
python pubmed_rag/use_rag.py --config demo/config.yaml --query "Best databases to use for a knowledge graph for biological question answering?"