{"id":26674385,"url":"https://github.com/multiomics-analytics-group/pubmed-rag","last_synced_at":"2025-04-12T06:53:58.070Z","repository":{"id":258379754,"uuid":"848958037","full_name":"Multiomics-Analytics-Group/pubmed-rag","owner":"Multiomics-Analytics-Group","description":"A playground for RAG development from pubmed API","archived":false,"fork":false,"pushed_at":"2025-03-19T12:18:19.000Z","size":4484,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T06:53:54.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Multiomics-Analytics-Group.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-28T18:04:04.000Z","updated_at":"2025-03-21T06:07:00.000Z","dependencies_parsed_at":"2024-11-11T20:29:58.644Z","dependency_job_id":null,"html_url":"https://github.com/Multiomics-Analytics-Group/pubmed-rag","commit_stats":null,"previous_names":["multiomics-analytics-group/pubmed-rag"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Multiomics-Analytics-Group%2Fpubmed-rag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Multiomics-Analytics-Group%2Fpubmed-rag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Multiomics-Analytics-Group%2Fpubmed-rag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Multiomics-Analytics-Group%2Fpubmed-rag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Multiomics-Analytics-Group","download_url":"https://codeload.github.com/Multiomics-Analytics-Group/pubmed-rag/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248530588,"owners_count":21119595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-26T02:19:00.762Z","updated_at":"2025-04-12T06:53:58.046Z","avatar_url":"https://github.com/Multiomics-Analytics-Group.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pubmed-rag\nA playground for RAG development from pubmed API (starting with bkg-review project)\n\nWork in progress..\n\n## 1. Getting Started\n\n### Installation and Set up\n\n1. Install [poetry](https://python-poetry.org/docs/#installation) on your device\n2. Clone this repository\n3. Set up environment by \n    - open terminal\n    - `cd` into repo directory\n    - running `poetry install`\n4. activate the environment by running `poetry shell` in repo dir\n5. a running instance of the Milvus\n\n5. download ollama and set up account\n\n## 2. Creating the Vector Database\n\n### Option A) Run python scripts manually\n\n#### 2.a) Retrieving the pubmed articles\n\nUsing pubmed_rag/get_embeddings.py\n`python pubmed_rag/get_embeddings.py --config \u003cpath to config file\u003e`\n\nArgs:\n- `--config` or `-c \u003cpath to config file\u003e` \n- `--files_downloaded` or `-fd \u003cpath to folder with biocjson files\u003e`\n\nExamples:\n- `python pubmed_rag/get_embeddings.py -c demo/config.yaml -fd biocjson`\n- `python pubmed_rag/get_embeddings.py --config config.yaml`\n\n#### 2.b) Putting the embeddings into a vector database\n\nUsing pubmed_rag/create_db.py\n`python pubmed_rag/create_db.py --config \u003cpath to config file\u003e`\n\nArgs:\n- `--config` or `-c \u003cpath to config file\u003e` \n\nExamples:\n- `python pubmed_rag/create_db.py -c demo/config.yaml`\n- `python pubmed_rag/create_db.py --config /users/blah/what/config.yaml`\n\n### Option B) Run bash script (Recommended)\n\nInstead, using get_pmid_vdb.sh which will carry out 2.a) and 2.b)\n`bash get_pmid_vdb.sh --files_downloaded \u003cpath to folder with biocjson files\u003e --config  \u003cpath to config file\u003e`\n\nArgs:\n- `--config` or `-c \u003cpath to config file\u003e` \n- `--files_downloaded` or `-fd \u003cpath to folder with biocjson files\u003e`\n\nExamples:\n- `bash get_pmid_vdb.sh --config demo/config.yaml`\n- `bash get_pmid_vdb.sh -fd demo/output -c /users/blah/what/config.yaml`\n\n## Querying the database\n\n#### Find nearest vectors\n\nUsing pubmed_rag/run_search.py\n`python pubmed_rag/run_search.py --config \u003cpath to config file\u003e --query \u003cthe LLM prompt\u003e`\n\nArgs:\n- `--config` or `-c \u003cpath to config file\u003e` \n- `--query` or `--q \u003ctext to embed\u003e` \n\nExamples:\n- `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?\"`\n- `python pubmed_rag/run_search.py --config demo/config.yaml --query \"Best databases to use for a knowledge graph for biological question answering?\"`\n\n#### RAG model\n\nUsing use_rag.py\n`python pubmed_rag/use_rag.py --config \u003cpath to config file\u003e --query \u003cthe LLM prompt\u003e`\n\nArgs:\n- `--config` or `-c \u003cpath to config file\u003e` \n- `--query` or `--q \u003ctext to embed\u003e` \n\nExamples:\n- `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?\"`\n- `python pubmed_rag/use_rag.py --config demo/config.yaml --query \"Best databases to use for a knowledge graph for biological question answering?\"`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiomics-analytics-group%2Fpubmed-rag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultiomics-analytics-group%2Fpubmed-rag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiomics-analytics-group%2Fpubmed-rag/lists"}