aiagents4pharma 1.44.0__py3-none-any.whl → 1.45.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. aiagents4pharma/__init__.py +2 -2
  2. aiagents4pharma/talk2aiagents4pharma/.dockerignore +13 -0
  3. aiagents4pharma/talk2aiagents4pharma/Dockerfile +105 -0
  4. aiagents4pharma/talk2aiagents4pharma/README.md +1 -0
  5. aiagents4pharma/talk2aiagents4pharma/__init__.py +4 -5
  6. aiagents4pharma/talk2aiagents4pharma/agents/__init__.py +3 -2
  7. aiagents4pharma/talk2aiagents4pharma/agents/main_agent.py +24 -23
  8. aiagents4pharma/talk2aiagents4pharma/configs/__init__.py +2 -2
  9. aiagents4pharma/talk2aiagents4pharma/configs/agents/__init__.py +2 -2
  10. aiagents4pharma/talk2aiagents4pharma/configs/agents/main_agent/default.yaml +2 -2
  11. aiagents4pharma/talk2aiagents4pharma/configs/config.yaml +1 -1
  12. aiagents4pharma/talk2aiagents4pharma/docker-compose/cpu/.env.example +23 -0
  13. aiagents4pharma/talk2aiagents4pharma/docker-compose/cpu/docker-compose.yml +93 -0
  14. aiagents4pharma/talk2aiagents4pharma/docker-compose/gpu/.env.example +23 -0
  15. aiagents4pharma/talk2aiagents4pharma/docker-compose/gpu/docker-compose.yml +108 -0
  16. aiagents4pharma/talk2aiagents4pharma/install.md +127 -0
  17. aiagents4pharma/talk2aiagents4pharma/states/__init__.py +3 -2
  18. aiagents4pharma/talk2aiagents4pharma/states/state_talk2aiagents4pharma.py +5 -3
  19. aiagents4pharma/talk2aiagents4pharma/tests/__init__.py +2 -2
  20. aiagents4pharma/talk2aiagents4pharma/tests/test_main_agent.py +72 -50
  21. aiagents4pharma/talk2biomodels/.dockerignore +13 -0
  22. aiagents4pharma/talk2biomodels/Dockerfile +104 -0
  23. aiagents4pharma/talk2biomodels/README.md +1 -0
  24. aiagents4pharma/talk2biomodels/__init__.py +4 -8
  25. aiagents4pharma/talk2biomodels/agents/__init__.py +3 -2
  26. aiagents4pharma/talk2biomodels/agents/t2b_agent.py +47 -42
  27. aiagents4pharma/talk2biomodels/api/__init__.py +4 -5
  28. aiagents4pharma/talk2biomodels/api/kegg.py +14 -10
  29. aiagents4pharma/talk2biomodels/api/ols.py +13 -10
  30. aiagents4pharma/talk2biomodels/api/uniprot.py +7 -6
  31. aiagents4pharma/talk2biomodels/configs/__init__.py +3 -4
  32. aiagents4pharma/talk2biomodels/configs/agents/__init__.py +2 -2
  33. aiagents4pharma/talk2biomodels/configs/agents/t2b_agent/__init__.py +2 -2
  34. aiagents4pharma/talk2biomodels/configs/agents/t2b_agent/default.yaml +1 -1
  35. aiagents4pharma/talk2biomodels/configs/config.yaml +1 -1
  36. aiagents4pharma/talk2biomodels/configs/tools/__init__.py +4 -5
  37. aiagents4pharma/talk2biomodels/configs/tools/ask_question/__init__.py +2 -2
  38. aiagents4pharma/talk2biomodels/configs/tools/ask_question/default.yaml +1 -2
  39. aiagents4pharma/talk2biomodels/configs/tools/custom_plotter/__init__.py +2 -2
  40. aiagents4pharma/talk2biomodels/configs/tools/custom_plotter/default.yaml +1 -1
  41. aiagents4pharma/talk2biomodels/configs/tools/get_annotation/__init__.py +2 -2
  42. aiagents4pharma/talk2biomodels/configs/tools/get_annotation/default.yaml +1 -1
  43. aiagents4pharma/talk2biomodels/install.md +63 -0
  44. aiagents4pharma/talk2biomodels/models/__init__.py +4 -4
  45. aiagents4pharma/talk2biomodels/models/basico_model.py +36 -28
  46. aiagents4pharma/talk2biomodels/models/sys_bio_model.py +13 -10
  47. aiagents4pharma/talk2biomodels/states/__init__.py +3 -2
  48. aiagents4pharma/talk2biomodels/states/state_talk2biomodels.py +12 -8
  49. aiagents4pharma/talk2biomodels/tests/BIOMD0000000449_url.xml +1585 -0
  50. aiagents4pharma/talk2biomodels/tests/__init__.py +2 -2
  51. aiagents4pharma/talk2biomodels/tests/article_on_model_537.pdf +0 -0
  52. aiagents4pharma/talk2biomodels/tests/test_api.py +18 -14
  53. aiagents4pharma/talk2biomodels/tests/test_ask_question.py +8 -9
  54. aiagents4pharma/talk2biomodels/tests/test_basico_model.py +15 -9
  55. aiagents4pharma/talk2biomodels/tests/test_get_annotation.py +54 -55
  56. aiagents4pharma/talk2biomodels/tests/test_getmodelinfo.py +28 -27
  57. aiagents4pharma/talk2biomodels/tests/test_integration.py +21 -33
  58. aiagents4pharma/talk2biomodels/tests/test_load_biomodel.py +14 -11
  59. aiagents4pharma/talk2biomodels/tests/test_param_scan.py +21 -20
  60. aiagents4pharma/talk2biomodels/tests/test_query_article.py +129 -29
  61. aiagents4pharma/talk2biomodels/tests/test_search_models.py +9 -13
  62. aiagents4pharma/talk2biomodels/tests/test_simulate_model.py +16 -15
  63. aiagents4pharma/talk2biomodels/tests/test_steady_state.py +12 -22
  64. aiagents4pharma/talk2biomodels/tests/test_sys_bio_model.py +33 -29
  65. aiagents4pharma/talk2biomodels/tools/__init__.py +15 -12
  66. aiagents4pharma/talk2biomodels/tools/ask_question.py +42 -32
  67. aiagents4pharma/talk2biomodels/tools/custom_plotter.py +51 -43
  68. aiagents4pharma/talk2biomodels/tools/get_annotation.py +99 -75
  69. aiagents4pharma/talk2biomodels/tools/get_modelinfo.py +57 -51
  70. aiagents4pharma/talk2biomodels/tools/load_arguments.py +52 -32
  71. aiagents4pharma/talk2biomodels/tools/load_biomodel.py +8 -2
  72. aiagents4pharma/talk2biomodels/tools/parameter_scan.py +107 -90
  73. aiagents4pharma/talk2biomodels/tools/query_article.py +14 -13
  74. aiagents4pharma/talk2biomodels/tools/search_models.py +37 -26
  75. aiagents4pharma/talk2biomodels/tools/simulate_model.py +47 -37
  76. aiagents4pharma/talk2biomodels/tools/steady_state.py +76 -58
  77. aiagents4pharma/talk2biomodels/tools/utils.py +4 -3
  78. aiagents4pharma/talk2cells/README.md +1 -0
  79. aiagents4pharma/talk2cells/__init__.py +4 -5
  80. aiagents4pharma/talk2cells/agents/__init__.py +3 -2
  81. aiagents4pharma/talk2cells/agents/scp_agent.py +21 -19
  82. aiagents4pharma/talk2cells/states/__init__.py +3 -2
  83. aiagents4pharma/talk2cells/states/state_talk2cells.py +4 -2
  84. aiagents4pharma/talk2cells/tests/scp_agent/test_scp_agent.py +8 -9
  85. aiagents4pharma/talk2cells/tools/__init__.py +3 -2
  86. aiagents4pharma/talk2cells/tools/scp_agent/__init__.py +4 -4
  87. aiagents4pharma/talk2cells/tools/scp_agent/display_studies.py +5 -3
  88. aiagents4pharma/talk2cells/tools/scp_agent/search_studies.py +21 -22
  89. aiagents4pharma/talk2knowledgegraphs/.dockerignore +13 -0
  90. aiagents4pharma/talk2knowledgegraphs/Dockerfile +103 -0
  91. aiagents4pharma/talk2knowledgegraphs/README.md +1 -0
  92. aiagents4pharma/talk2knowledgegraphs/__init__.py +4 -7
  93. aiagents4pharma/talk2knowledgegraphs/agents/__init__.py +3 -2
  94. aiagents4pharma/talk2knowledgegraphs/agents/t2kg_agent.py +40 -30
  95. aiagents4pharma/talk2knowledgegraphs/configs/__init__.py +3 -6
  96. aiagents4pharma/talk2knowledgegraphs/configs/agents/t2kg_agent/__init__.py +2 -2
  97. aiagents4pharma/talk2knowledgegraphs/configs/agents/t2kg_agent/default.yaml +8 -8
  98. aiagents4pharma/talk2knowledgegraphs/configs/app/__init__.py +3 -2
  99. aiagents4pharma/talk2knowledgegraphs/configs/app/frontend/__init__.py +2 -2
  100. aiagents4pharma/talk2knowledgegraphs/configs/app/frontend/default.yaml +1 -1
  101. aiagents4pharma/talk2knowledgegraphs/configs/config.yaml +1 -1
  102. aiagents4pharma/talk2knowledgegraphs/configs/tools/__init__.py +4 -5
  103. aiagents4pharma/talk2knowledgegraphs/configs/tools/graphrag_reasoning/__init__.py +2 -2
  104. aiagents4pharma/talk2knowledgegraphs/configs/tools/graphrag_reasoning/default.yaml +1 -1
  105. aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_extraction/__init__.py +2 -2
  106. aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_extraction/default.yaml +1 -1
  107. aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_summarization/__init__.py +2 -2
  108. aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_summarization/default.yaml +1 -1
  109. aiagents4pharma/talk2knowledgegraphs/configs/utils/enrichments/ols_terms/default.yaml +1 -1
  110. aiagents4pharma/talk2knowledgegraphs/configs/utils/enrichments/reactome_pathways/default.yaml +1 -1
  111. aiagents4pharma/talk2knowledgegraphs/configs/utils/enrichments/uniprot_proteins/default.yaml +1 -1
  112. aiagents4pharma/talk2knowledgegraphs/configs/utils/pubchem_utils/default.yaml +1 -1
  113. aiagents4pharma/talk2knowledgegraphs/datasets/__init__.py +4 -6
  114. aiagents4pharma/talk2knowledgegraphs/datasets/biobridge_primekg.py +115 -67
  115. aiagents4pharma/talk2knowledgegraphs/datasets/dataset.py +2 -0
  116. aiagents4pharma/talk2knowledgegraphs/datasets/primekg.py +35 -24
  117. aiagents4pharma/talk2knowledgegraphs/datasets/starkqa_primekg.py +29 -21
  118. aiagents4pharma/talk2knowledgegraphs/docker-compose/cpu/.env.example +23 -0
  119. aiagents4pharma/talk2knowledgegraphs/docker-compose/cpu/docker-compose.yml +93 -0
  120. aiagents4pharma/talk2knowledgegraphs/docker-compose/gpu/.env.example +23 -0
  121. aiagents4pharma/talk2knowledgegraphs/docker-compose/gpu/docker-compose.yml +108 -0
  122. aiagents4pharma/talk2knowledgegraphs/entrypoint.sh +190 -0
  123. aiagents4pharma/talk2knowledgegraphs/install.md +140 -0
  124. aiagents4pharma/talk2knowledgegraphs/milvus_data_dump.py +31 -65
  125. aiagents4pharma/talk2knowledgegraphs/states/__init__.py +3 -2
  126. aiagents4pharma/talk2knowledgegraphs/states/state_talk2knowledgegraphs.py +1 -0
  127. aiagents4pharma/talk2knowledgegraphs/tests/test_agents_t2kg_agent.py +65 -40
  128. aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_biobridge_primekg.py +54 -48
  129. aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_dataset.py +4 -0
  130. aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_primekg.py +17 -4
  131. aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_starkqa_primekg.py +33 -24
  132. aiagents4pharma/talk2knowledgegraphs/tests/test_tools_graphrag_reasoning.py +116 -69
  133. aiagents4pharma/talk2knowledgegraphs/tests/test_tools_milvus_multimodal_subgraph_extraction.py +334 -216
  134. aiagents4pharma/talk2knowledgegraphs/tests/test_tools_multimodal_subgraph_extraction.py +22 -15
  135. aiagents4pharma/talk2knowledgegraphs/tests/test_tools_subgraph_extraction.py +19 -12
  136. aiagents4pharma/talk2knowledgegraphs/tests/test_tools_subgraph_summarization.py +95 -48
  137. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_embeddings.py +4 -0
  138. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_huggingface.py +5 -0
  139. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_nim_molmim.py +13 -18
  140. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_ollama.py +10 -3
  141. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_enrichments.py +4 -3
  142. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_ollama.py +3 -2
  143. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_ols.py +1 -0
  144. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_pubchem.py +9 -4
  145. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_reactome.py +6 -6
  146. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_uniprot.py +4 -0
  147. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_extractions_milvus_multimodal_pcst.py +160 -97
  148. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_kg_utils.py +3 -4
  149. aiagents4pharma/talk2knowledgegraphs/tests/test_utils_pubchem_utils.py +87 -13
  150. aiagents4pharma/talk2knowledgegraphs/tools/__init__.py +10 -7
  151. aiagents4pharma/talk2knowledgegraphs/tools/graphrag_reasoning.py +15 -20
  152. aiagents4pharma/talk2knowledgegraphs/tools/milvus_multimodal_subgraph_extraction.py +145 -142
  153. aiagents4pharma/talk2knowledgegraphs/tools/multimodal_subgraph_extraction.py +92 -90
  154. aiagents4pharma/talk2knowledgegraphs/tools/subgraph_extraction.py +25 -37
  155. aiagents4pharma/talk2knowledgegraphs/tools/subgraph_summarization.py +10 -13
  156. aiagents4pharma/talk2knowledgegraphs/utils/__init__.py +4 -7
  157. aiagents4pharma/talk2knowledgegraphs/utils/embeddings/__init__.py +4 -7
  158. aiagents4pharma/talk2knowledgegraphs/utils/embeddings/embeddings.py +4 -0
  159. aiagents4pharma/talk2knowledgegraphs/utils/embeddings/huggingface.py +11 -14
  160. aiagents4pharma/talk2knowledgegraphs/utils/embeddings/nim_molmim.py +7 -7
  161. aiagents4pharma/talk2knowledgegraphs/utils/embeddings/ollama.py +12 -6
  162. aiagents4pharma/talk2knowledgegraphs/utils/embeddings/sentence_transformer.py +8 -6
  163. aiagents4pharma/talk2knowledgegraphs/utils/enrichments/__init__.py +9 -6
  164. aiagents4pharma/talk2knowledgegraphs/utils/enrichments/enrichments.py +1 -0
  165. aiagents4pharma/talk2knowledgegraphs/utils/enrichments/ollama.py +15 -9
  166. aiagents4pharma/talk2knowledgegraphs/utils/enrichments/ols_terms.py +23 -20
  167. aiagents4pharma/talk2knowledgegraphs/utils/enrichments/pubchem_strings.py +12 -10
  168. aiagents4pharma/talk2knowledgegraphs/utils/enrichments/reactome_pathways.py +16 -10
  169. aiagents4pharma/talk2knowledgegraphs/utils/enrichments/uniprot_proteins.py +26 -18
  170. aiagents4pharma/talk2knowledgegraphs/utils/extractions/__init__.py +4 -5
  171. aiagents4pharma/talk2knowledgegraphs/utils/extractions/milvus_multimodal_pcst.py +14 -34
  172. aiagents4pharma/talk2knowledgegraphs/utils/extractions/multimodal_pcst.py +53 -47
  173. aiagents4pharma/talk2knowledgegraphs/utils/extractions/pcst.py +18 -14
  174. aiagents4pharma/talk2knowledgegraphs/utils/kg_utils.py +22 -23
  175. aiagents4pharma/talk2knowledgegraphs/utils/pubchem_utils.py +11 -10
  176. aiagents4pharma/talk2scholars/.dockerignore +13 -0
  177. aiagents4pharma/talk2scholars/Dockerfile +104 -0
  178. aiagents4pharma/talk2scholars/README.md +1 -0
  179. aiagents4pharma/talk2scholars/agents/__init__.py +1 -5
  180. aiagents4pharma/talk2scholars/agents/main_agent.py +6 -4
  181. aiagents4pharma/talk2scholars/agents/paper_download_agent.py +5 -4
  182. aiagents4pharma/talk2scholars/agents/pdf_agent.py +4 -2
  183. aiagents4pharma/talk2scholars/agents/s2_agent.py +2 -2
  184. aiagents4pharma/talk2scholars/agents/zotero_agent.py +10 -11
  185. aiagents4pharma/talk2scholars/configs/__init__.py +1 -3
  186. aiagents4pharma/talk2scholars/configs/agents/talk2scholars/__init__.py +1 -4
  187. aiagents4pharma/talk2scholars/configs/agents/talk2scholars/main_agent/default.yaml +1 -1
  188. aiagents4pharma/talk2scholars/configs/agents/talk2scholars/pdf_agent/default.yaml +1 -1
  189. aiagents4pharma/talk2scholars/configs/agents/talk2scholars/s2_agent/default.yaml +8 -8
  190. aiagents4pharma/talk2scholars/configs/agents/talk2scholars/zotero_agent/default.yaml +7 -7
  191. aiagents4pharma/talk2scholars/configs/tools/__init__.py +8 -6
  192. aiagents4pharma/talk2scholars/docker-compose/cpu/.env.example +21 -0
  193. aiagents4pharma/talk2scholars/docker-compose/cpu/docker-compose.yml +90 -0
  194. aiagents4pharma/talk2scholars/docker-compose/gpu/.env.example +21 -0
  195. aiagents4pharma/talk2scholars/docker-compose/gpu/docker-compose.yml +105 -0
  196. aiagents4pharma/talk2scholars/install.md +122 -0
  197. aiagents4pharma/talk2scholars/state/state_talk2scholars.py +8 -8
  198. aiagents4pharma/talk2scholars/tests/{test_main_agent.py → test_agents_main_agent.py} +41 -23
  199. aiagents4pharma/talk2scholars/tests/{test_paper_download_agent.py → test_agents_paper_agents_download_agent.py} +10 -16
  200. aiagents4pharma/talk2scholars/tests/{test_pdf_agent.py → test_agents_pdf_agent.py} +6 -10
  201. aiagents4pharma/talk2scholars/tests/{test_s2_agent.py → test_agents_s2_agent.py} +8 -16
  202. aiagents4pharma/talk2scholars/tests/{test_zotero_agent.py → test_agents_zotero_agent.py} +5 -7
  203. aiagents4pharma/talk2scholars/tests/{test_s2_display_dataframe.py → test_s2_tools_display_dataframe.py} +6 -7
  204. aiagents4pharma/talk2scholars/tests/{test_s2_query_dataframe.py → test_s2_tools_query_dataframe.py} +5 -15
  205. aiagents4pharma/talk2scholars/tests/{test_paper_downloader.py → test_tools_paper_downloader.py} +25 -63
  206. aiagents4pharma/talk2scholars/tests/{test_question_and_answer_tool.py → test_tools_question_and_answer_tool.py} +2 -6
  207. aiagents4pharma/talk2scholars/tests/{test_s2_multi.py → test_tools_s2_multi.py} +5 -5
  208. aiagents4pharma/talk2scholars/tests/{test_s2_retrieve.py → test_tools_s2_retrieve.py} +2 -1
  209. aiagents4pharma/talk2scholars/tests/{test_s2_search.py → test_tools_s2_search.py} +5 -5
  210. aiagents4pharma/talk2scholars/tests/{test_s2_single.py → test_tools_s2_single.py} +5 -5
  211. aiagents4pharma/talk2scholars/tests/{test_arxiv_downloader.py → test_utils_arxiv_downloader.py} +16 -25
  212. aiagents4pharma/talk2scholars/tests/{test_base_paper_downloader.py → test_utils_base_paper_downloader.py} +25 -47
  213. aiagents4pharma/talk2scholars/tests/{test_biorxiv_downloader.py → test_utils_biorxiv_downloader.py} +14 -42
  214. aiagents4pharma/talk2scholars/tests/{test_medrxiv_downloader.py → test_utils_medrxiv_downloader.py} +15 -49
  215. aiagents4pharma/talk2scholars/tests/{test_nvidia_nim_reranker.py → test_utils_nvidia_nim_reranker.py} +6 -16
  216. aiagents4pharma/talk2scholars/tests/{test_pdf_answer_formatter.py → test_utils_pdf_answer_formatter.py} +1 -0
  217. aiagents4pharma/talk2scholars/tests/{test_pdf_batch_processor.py → test_utils_pdf_batch_processor.py} +6 -15
  218. aiagents4pharma/talk2scholars/tests/{test_pdf_collection_manager.py → test_utils_pdf_collection_manager.py} +34 -11
  219. aiagents4pharma/talk2scholars/tests/{test_pdf_document_processor.py → test_utils_pdf_document_processor.py} +2 -3
  220. aiagents4pharma/talk2scholars/tests/{test_pdf_generate_answer.py → test_utils_pdf_generate_answer.py} +3 -6
  221. aiagents4pharma/talk2scholars/tests/{test_pdf_gpu_detection.py → test_utils_pdf_gpu_detection.py} +5 -16
  222. aiagents4pharma/talk2scholars/tests/{test_pdf_rag_pipeline.py → test_utils_pdf_rag_pipeline.py} +7 -17
  223. aiagents4pharma/talk2scholars/tests/{test_pdf_retrieve_chunks.py → test_utils_pdf_retrieve_chunks.py} +4 -11
  224. aiagents4pharma/talk2scholars/tests/{test_pdf_singleton_manager.py → test_utils_pdf_singleton_manager.py} +26 -23
  225. aiagents4pharma/talk2scholars/tests/{test_pdf_vector_normalization.py → test_utils_pdf_vector_normalization.py} +1 -1
  226. aiagents4pharma/talk2scholars/tests/{test_pdf_vector_store.py → test_utils_pdf_vector_store.py} +27 -55
  227. aiagents4pharma/talk2scholars/tests/{test_pubmed_downloader.py → test_utils_pubmed_downloader.py} +31 -91
  228. aiagents4pharma/talk2scholars/tests/{test_read_helper_utils.py → test_utils_read_helper_utils.py} +2 -6
  229. aiagents4pharma/talk2scholars/tests/{test_s2_utils_ext_ids.py → test_utils_s2_utils_ext_ids.py} +5 -15
  230. aiagents4pharma/talk2scholars/tests/{test_zotero_human_in_the_loop.py → test_utils_zotero_human_in_the_loop.py} +6 -13
  231. aiagents4pharma/talk2scholars/tests/{test_zotero_path.py → test_utils_zotero_path.py} +53 -45
  232. aiagents4pharma/talk2scholars/tests/{test_zotero_read.py → test_utils_zotero_read.py} +30 -91
  233. aiagents4pharma/talk2scholars/tests/{test_zotero_write.py → test_utils_zotero_write.py} +6 -16
  234. aiagents4pharma/talk2scholars/tools/__init__.py +1 -4
  235. aiagents4pharma/talk2scholars/tools/paper_download/paper_downloader.py +20 -35
  236. aiagents4pharma/talk2scholars/tools/paper_download/utils/__init__.py +7 -5
  237. aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py +9 -11
  238. aiagents4pharma/talk2scholars/tools/paper_download/utils/base_paper_downloader.py +14 -21
  239. aiagents4pharma/talk2scholars/tools/paper_download/utils/biorxiv_downloader.py +14 -22
  240. aiagents4pharma/talk2scholars/tools/paper_download/utils/medrxiv_downloader.py +11 -13
  241. aiagents4pharma/talk2scholars/tools/paper_download/utils/pubmed_downloader.py +14 -28
  242. aiagents4pharma/talk2scholars/tools/pdf/question_and_answer.py +4 -8
  243. aiagents4pharma/talk2scholars/tools/pdf/utils/__init__.py +16 -14
  244. aiagents4pharma/talk2scholars/tools/pdf/utils/answer_formatter.py +4 -4
  245. aiagents4pharma/talk2scholars/tools/pdf/utils/batch_processor.py +15 -17
  246. aiagents4pharma/talk2scholars/tools/pdf/utils/collection_manager.py +2 -2
  247. aiagents4pharma/talk2scholars/tools/pdf/utils/document_processor.py +5 -5
  248. aiagents4pharma/talk2scholars/tools/pdf/utils/generate_answer.py +4 -4
  249. aiagents4pharma/talk2scholars/tools/pdf/utils/get_vectorstore.py +2 -6
  250. aiagents4pharma/talk2scholars/tools/pdf/utils/gpu_detection.py +5 -9
  251. aiagents4pharma/talk2scholars/tools/pdf/utils/nvidia_nim_reranker.py +4 -4
  252. aiagents4pharma/talk2scholars/tools/pdf/utils/paper_loader.py +2 -2
  253. aiagents4pharma/talk2scholars/tools/pdf/utils/rag_pipeline.py +6 -15
  254. aiagents4pharma/talk2scholars/tools/pdf/utils/retrieve_chunks.py +7 -15
  255. aiagents4pharma/talk2scholars/tools/pdf/utils/singleton_manager.py +2 -2
  256. aiagents4pharma/talk2scholars/tools/pdf/utils/tool_helper.py +3 -4
  257. aiagents4pharma/talk2scholars/tools/pdf/utils/vector_normalization.py +8 -17
  258. aiagents4pharma/talk2scholars/tools/pdf/utils/vector_store.py +17 -33
  259. aiagents4pharma/talk2scholars/tools/s2/__init__.py +8 -6
  260. aiagents4pharma/talk2scholars/tools/s2/display_dataframe.py +3 -7
  261. aiagents4pharma/talk2scholars/tools/s2/multi_paper_rec.py +7 -6
  262. aiagents4pharma/talk2scholars/tools/s2/query_dataframe.py +5 -12
  263. aiagents4pharma/talk2scholars/tools/s2/retrieve_semantic_scholar_paper_id.py +2 -4
  264. aiagents4pharma/talk2scholars/tools/s2/search.py +6 -6
  265. aiagents4pharma/talk2scholars/tools/s2/single_paper_rec.py +5 -3
  266. aiagents4pharma/talk2scholars/tools/s2/utils/__init__.py +1 -3
  267. aiagents4pharma/talk2scholars/tools/s2/utils/multi_helper.py +12 -18
  268. aiagents4pharma/talk2scholars/tools/s2/utils/search_helper.py +11 -18
  269. aiagents4pharma/talk2scholars/tools/s2/utils/single_helper.py +11 -16
  270. aiagents4pharma/talk2scholars/tools/zotero/__init__.py +1 -4
  271. aiagents4pharma/talk2scholars/tools/zotero/utils/__init__.py +1 -4
  272. aiagents4pharma/talk2scholars/tools/zotero/utils/read_helper.py +21 -39
  273. aiagents4pharma/talk2scholars/tools/zotero/utils/review_helper.py +2 -6
  274. aiagents4pharma/talk2scholars/tools/zotero/utils/write_helper.py +8 -11
  275. aiagents4pharma/talk2scholars/tools/zotero/utils/zotero_path.py +4 -12
  276. aiagents4pharma/talk2scholars/tools/zotero/utils/zotero_pdf_downloader.py +13 -27
  277. aiagents4pharma/talk2scholars/tools/zotero/zotero_read.py +4 -7
  278. aiagents4pharma/talk2scholars/tools/zotero/zotero_review.py +8 -10
  279. aiagents4pharma/talk2scholars/tools/zotero/zotero_write.py +3 -2
  280. {aiagents4pharma-1.44.0.dist-info → aiagents4pharma-1.45.1.dist-info}/METADATA +115 -51
  281. aiagents4pharma-1.45.1.dist-info/RECORD +324 -0
  282. {aiagents4pharma-1.44.0.dist-info → aiagents4pharma-1.45.1.dist-info}/WHEEL +1 -2
  283. aiagents4pharma-1.44.0.dist-info/RECORD +0 -293
  284. aiagents4pharma-1.44.0.dist-info/top_level.txt +0 -1
  285. /aiagents4pharma/talk2scholars/tests/{test_state.py → test_states_state.py} +0 -0
  286. /aiagents4pharma/talk2scholars/tests/{test_pdf_paper_loader.py → test_utils_pdf_paper_loader.py} +0 -0
  287. /aiagents4pharma/talk2scholars/tests/{test_tool_helper_utils.py → test_utils_tool_helper_utils.py} +0 -0
  288. /aiagents4pharma/talk2scholars/tests/{test_zotero_pdf_downloader_utils.py → test_utils_zotero_pdf_downloader_utils.py} +0 -0
  289. {aiagents4pharma-1.44.0.dist-info → aiagents4pharma-1.45.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,93 @@
1
+ version: "1.0.0"
2
+
3
+ services:
4
+ # talk2knowledgegraphs with automatic data loading via entrypoint
5
+ talk2knowledgegraphs:
6
+ container_name: talk2knowledgegraphs
7
+ image: vpatientengine/talk2knowledgegraphs:latest
8
+ platform: linux/amd64
9
+ ports:
10
+ - "8501:8501"
11
+ environment:
12
+ - MILVUS_HOST=milvus-standalone
13
+ - MILVUS_PORT=19530
14
+ env_file:
15
+ - .env
16
+ volumes:
17
+ # Mount external data directory if DATA_DIR is specified in .env
18
+ - ${DATA_DIR:-./default_data}:/mnt/external_data:ro
19
+ healthcheck:
20
+ test: ["CMD", "curl", "-f", "http://localhost:8501/health"]
21
+ interval: 30s
22
+ timeout: 10s
23
+ retries: 3
24
+ start_period: 120s # Allow time for data loading
25
+ depends_on:
26
+ milvus-standalone:
27
+ condition: service_healthy
28
+
29
+ # Milvus Dependencies
30
+ etcd:
31
+ container_name: milvus-etcd
32
+ image: quay.io/coreos/etcd:v3.5.18
33
+ environment:
34
+ - ETCD_AUTO_COMPACTION_MODE=revision
35
+ - ETCD_AUTO_COMPACTION_RETENTION=1000
36
+ - ETCD_QUOTA_BACKEND_BYTES=4294967296
37
+ - ETCD_SNAPSHOT_COUNT=50000
38
+ volumes:
39
+ - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/etcd:/etcd
40
+ command: etcd -advertise-client-urls=http://etcd:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
41
+ healthcheck:
42
+ test: ["CMD", "etcdctl", "endpoint", "health"]
43
+ interval: 30s
44
+ timeout: 20s
45
+ retries: 3
46
+
47
+ minio:
48
+ container_name: milvus-minio
49
+ image: minio/minio:RELEASE.2024-05-28T17-19-04Z
50
+ environment:
51
+ MINIO_ACCESS_KEY: minioadmin
52
+ MINIO_SECRET_KEY: minioadmin
53
+ ports:
54
+ - "9001:9001"
55
+ - "9000:9000"
56
+ volumes:
57
+ - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/minio:/minio_data
58
+ command: minio server /minio_data --console-address ":9001"
59
+ healthcheck:
60
+ test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
61
+ interval: 30s
62
+ timeout: 20s
63
+ retries: 3
64
+
65
+ # Milvus Vector Database (CPU-only)
66
+ milvus-standalone:
67
+ container_name: milvus-standalone
68
+ image: milvusdb/milvus:v2.5.14
69
+ command: ["milvus", "run", "standalone"]
70
+ security_opt:
71
+ - seccomp:unconfined
72
+ environment:
73
+ MINIO_REGION: us-east-1
74
+ ETCD_ENDPOINTS: etcd:2379
75
+ MINIO_ADDRESS: minio:9000
76
+ volumes:
77
+ - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/milvus:/var/lib/milvus
78
+ ports:
79
+ - "19530:19530"
80
+ - "9091:9091"
81
+ healthcheck:
82
+ test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
83
+ interval: 30s
84
+ start_period: 90s
85
+ timeout: 20s
86
+ retries: 3
87
+ depends_on:
88
+ - "etcd"
89
+ - "minio"
90
+
91
+ networks:
92
+ milvus:
93
+ name: milvus
@@ -0,0 +1,23 @@
1
+ # .env.example (DO NOT put actual API keys here, read the README.md)
2
+
3
+ # OPENAI API KEY
4
+ OPENAI_API_KEY=your_openai_api_key_here
5
+
6
+ # LangSmith API KEY
7
+ LANGCHAIN_TRACING_V2=true
8
+ LANGCHAIN_API_KEY=your_langchain_api_key_here
9
+
10
+ # NVIDIA API KEY
11
+ NVIDIA_API_KEY=your_nvidia_api_key_here
12
+
13
+ # Set environment variables for data loader
14
+ MILVUS_HOST=localhost
15
+ MILVUS_PORT=19530
16
+ MILVUS_USER=root
17
+ MILVUS_PASSWORD=Milvus
18
+ MILVUS_DATABASE=your_database_name_here
19
+
20
+ # Specify the data directory for multimodal data to your own data directory
21
+ # DATA_DIR=/your_absolute_path_to_your_data_dir/
22
+
23
+ BATCH_SIZE=500
@@ -0,0 +1,108 @@
1
+ version: "1.0.0"
2
+
3
+ services:
4
+ # talk2knowledgegraphs with automatic data loading via entrypoint
5
+ talk2knowledgegraphs:
6
+ container_name: talk2knowledgegraphs
7
+ image: vpatientengine/talk2knowledgegraphs:latest
8
+ platform: linux/amd64
9
+ ports:
10
+ - "8501:8501"
11
+ deploy:
12
+ resources:
13
+ reservations:
14
+ devices:
15
+ - driver: nvidia
16
+ capabilities: ["gpu"]
17
+ device_ids: ["0"]
18
+ environment:
19
+ - MILVUS_HOST=milvus-standalone
20
+ - MILVUS_PORT=19530
21
+ env_file:
22
+ - .env
23
+ volumes:
24
+ # Mount external data directory if DATA_DIR is specified in .env
25
+ - ${DATA_DIR:-./default_data}:/mnt/external_data:ro
26
+ healthcheck:
27
+ test: ["CMD", "curl", "-f", "http://localhost:8501/health"]
28
+ interval: 30s
29
+ timeout: 10s
30
+ retries: 3
31
+ start_period: 120s # Allow time for data loading
32
+ depends_on:
33
+ milvus-standalone:
34
+ condition: service_healthy
35
+
36
+ # Milvus Dependencies
37
+ etcd:
38
+ container_name: milvus-etcd
39
+ image: quay.io/coreos/etcd:v3.5.18
40
+ environment:
41
+ - ETCD_AUTO_COMPACTION_MODE=revision
42
+ - ETCD_AUTO_COMPACTION_RETENTION=1000
43
+ - ETCD_QUOTA_BACKEND_BYTES=4294967296
44
+ - ETCD_SNAPSHOT_COUNT=50000
45
+ volumes:
46
+ - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/etcd:/etcd
47
+ command: etcd -advertise-client-urls=http://etcd:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
48
+ healthcheck:
49
+ test: ["CMD", "etcdctl", "endpoint", "health"]
50
+ interval: 30s
51
+ timeout: 20s
52
+ retries: 3
53
+
54
+ minio:
55
+ container_name: milvus-minio
56
+ image: minio/minio:RELEASE.2023-03-20T20-16-18Z
57
+ environment:
58
+ MINIO_ACCESS_KEY: minioadmin
59
+ MINIO_SECRET_KEY: minioadmin
60
+ ports:
61
+ - "9001:9001"
62
+ - "9000:9000"
63
+ volumes:
64
+ - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/minio:/minio_data
65
+ command: minio server /minio_data --console-address ":9001"
66
+ healthcheck:
67
+ test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
68
+ interval: 30s
69
+ timeout: 20s
70
+ retries: 3
71
+
72
+ # Milvus Vector Database (GPU-enabled)
73
+ milvus-standalone:
74
+ container_name: milvus-standalone
75
+ image: milvusdb/milvus:v2.6.0-rc1-gpu
76
+ command: ["milvus", "run", "standalone"]
77
+ security_opt:
78
+ - seccomp:unconfined
79
+ environment:
80
+ MINIO_REGION: us-east-1
81
+ ETCD_ENDPOINTS: etcd:2379
82
+ MINIO_ADDRESS: minio:9000
83
+ MQ_TYPE: woodpecker
84
+ volumes:
85
+ - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/milvus:/var/lib/milvus
86
+ ports:
87
+ - "19530:19530"
88
+ - "9091:9091"
89
+ deploy:
90
+ resources:
91
+ reservations:
92
+ devices:
93
+ - driver: nvidia
94
+ capabilities: ["gpu"]
95
+ device_ids: ["0"]
96
+ healthcheck:
97
+ test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
98
+ interval: 30s
99
+ start_period: 90s
100
+ timeout: 20s
101
+ retries: 3
102
+ depends_on:
103
+ - "etcd"
104
+ - "minio"
105
+
106
+ networks:
107
+ milvus:
108
+ name: milvus
@@ -0,0 +1,190 @@
1
+ #!/bin/bash
2
+ # entrypoint.sh - Container entrypoint with automatic data loading
3
+
4
+ set -e
5
+
6
+ # Function to log with timestamp
7
+ log() {
8
+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] [ENTRYPOINT] $1"
9
+ }
10
+
11
+ log "=== talk2knowledgegraphs Container Starting ==="
12
+ log "Container hostname: $(hostname)"
13
+
14
+ # Show GPU info if available
15
+ if command -v nvidia-smi >/dev/null 2>&1; then
16
+ log "Available GPUs:"
17
+ nvidia-smi -L 2>/dev/null || log "nvidia-smi failed"
18
+ else
19
+ log "nvidia-smi not available"
20
+ fi
21
+
22
+ # Set default values for data loader environment variables
23
+ export MILVUS_HOST=${MILVUS_HOST:-milvus-standalone}
24
+ export MILVUS_PORT=${MILVUS_PORT:-19530}
25
+ export MILVUS_USER=${MILVUS_USER:-root}
26
+ export MILVUS_PASSWORD=${MILVUS_PASSWORD:-Milvus}
27
+ export MILVUS_DATABASE=${MILVUS_DATABASE:-t2kg_primekg}
28
+ export BATCH_SIZE=${BATCH_SIZE:-500}
29
+ export CHUNK_SIZE=${CHUNK_SIZE:-5}
30
+ export AUTO_INSTALL_PACKAGES=${AUTO_INSTALL_PACKAGES:-true}
31
+ export FORCE_CPU=${FORCE_CPU:-false}
32
+ export RUN_DATA_LOADER=${RUN_DATA_LOADER:-true}
33
+
34
+ # Determine data directory with priority:
35
+ # 1. External mount (/mnt/external_data)
36
+ # 2. Environment variable DATA_DIR
37
+ # 3. Default internal path
38
+ if [ -d "/mnt/external_data" ] && [ "$(ls -A /mnt/external_data 2>/dev/null)" ]; then
39
+ export DATA_DIR="/mnt/external_data"
40
+ log "Using external data directory: $DATA_DIR"
41
+ elif [ -n "$DATA_DIR" ] && [ -d "$DATA_DIR" ]; then
42
+ log "Using specified data directory: $DATA_DIR"
43
+ elif [ -d "/app/aiagents4pharma/talk2knowledgegraphs/tests/files/biobridge_multimodal/" ]; then
44
+ export DATA_DIR="/app/aiagents4pharma/talk2knowledgegraphs/tests/files/biobridge_multimodal/"
45
+ log "Using default internal data directory: $DATA_DIR"
46
+ else
47
+ log "WARNING: No valid data directory found!"
48
+ log "Checked:"
49
+ log " - External mount: /mnt/external_data"
50
+ log " - Environment DATA_DIR: ${DATA_DIR:-not set}"
51
+ log " - Default internal: /app/aiagents4pharma/talk2knowledgegraphs/tests/files/biobridge_multimodal/"
52
+ log "Continuing without data loading..."
53
+ export RUN_DATA_LOADER="false"
54
+ fi
55
+
56
+ # Display configuration
57
+ log "=== Configuration ==="
58
+ log "MILVUS_HOST: $MILVUS_HOST"
59
+ log "MILVUS_PORT: $MILVUS_PORT"
60
+ log "MILVUS_DATABASE: $MILVUS_DATABASE"
61
+ log "DATA_DIR: $DATA_DIR"
62
+ log "BATCH_SIZE: $BATCH_SIZE"
63
+ log "FORCE_CPU: $FORCE_CPU"
64
+ log "RUN_DATA_LOADER: $RUN_DATA_LOADER"
65
+
66
+ # Function to check if Milvus is ready
67
+ check_milvus() {
68
+ python3 -c "
69
+ import sys
70
+ try:
71
+ from pymilvus import connections
72
+ connections.connect(host='$MILVUS_HOST', port='$MILVUS_PORT', user='$MILVUS_USER', password='$MILVUS_PASSWORD')
73
+ connections.disconnect('default')
74
+ sys.exit(0)
75
+ except Exception:
76
+ sys.exit(1)
77
+ " >/dev/null 2>&1
78
+ }
79
+
80
+ # Function to check if data already exists
81
+ check_existing_data() {
82
+ python3 -c "
83
+ import sys
84
+ try:
85
+ from pymilvus import connections, utility, db
86
+ connections.connect(host='$MILVUS_HOST', port='$MILVUS_PORT', user='$MILVUS_USER', password='$MILVUS_PASSWORD')
87
+
88
+ # Check if database exists
89
+ if '$MILVUS_DATABASE' in db.list_database():
90
+ db.using_database('$MILVUS_DATABASE')
91
+ collections = utility.list_collections()
92
+ if collections:
93
+ connections.disconnect('default')
94
+ sys.exit(0) # Data exists
95
+
96
+ connections.disconnect('default')
97
+ sys.exit(1) # No data found
98
+ except Exception:
99
+ sys.exit(1)
100
+ " >/dev/null 2>&1
101
+ }
102
+
103
+ # Wait for Milvus to be ready (only if data loader is enabled)
104
+ if [ "$RUN_DATA_LOADER" = "true" ]; then
105
+ log "Waiting for Milvus to be ready..."
106
+ max_attempts=30
107
+ attempt=1
108
+
109
+ while [ $attempt -le $max_attempts ]; do
110
+ if check_milvus; then
111
+ log "Milvus is ready!"
112
+ break
113
+ else
114
+ log "Milvus not ready yet (attempt $attempt/$max_attempts), waiting 10 seconds..."
115
+ sleep 10
116
+ attempt=$((attempt + 1))
117
+ fi
118
+ done
119
+
120
+ if [ $attempt -gt $max_attempts ]; then
121
+ log "ERROR: Milvus failed to become ready after $max_attempts attempts"
122
+ log "Continuing without data loading..."
123
+ export RUN_DATA_LOADER="false"
124
+ fi
125
+ fi
126
+
127
+ # Run data loader if enabled and Milvus is ready
128
+ if [ "$RUN_DATA_LOADER" = "true" ]; then
129
+ if check_existing_data; then
130
+ log "Data already exists in Milvus, skipping data loading"
131
+ echo "SKIPPED" >/tmp/data_loading_status
132
+ else
133
+ log "No existing data found, starting data loading process..."
134
+ echo "IN_PROGRESS" >/tmp/data_loading_status
135
+
136
+ # Verify data directory contents
137
+ if [ ! -d "$DATA_DIR" ]; then
138
+ log "ERROR: Data directory does not exist: $DATA_DIR"
139
+ echo "FAILED" >/tmp/data_loading_status
140
+ else
141
+ log "Data directory contents preview:"
142
+ find "$DATA_DIR" -name "*.parquet*" | head -5 | while read file; do
143
+ log " Found: $file"
144
+ done
145
+
146
+ # Check if data loader script exists
147
+ if [ -f "/app/aiagents4pharma/talk2knowledgegraphs/milvus_data_dump.py" ]; then
148
+ log "Starting Milvus data loader..."
149
+ cd /app/aiagents4pharma/talk2knowledgegraphs
150
+
151
+ if python3 milvus_data_dump.py; then
152
+ log "Data loading completed successfully!"
153
+ echo "SUCCESS" >/tmp/data_loading_status
154
+ else
155
+ log "ERROR: Data loading failed! Continuing with application startup..."
156
+ echo "FAILED" >/tmp/data_loading_status
157
+ fi
158
+ else
159
+ log "ERROR: Data loader script not found at /app/aiagents4pharma/talk2knowledgegraphs/milvus_data_dump.py"
160
+ log "Continuing with application startup..."
161
+ echo "FAILED" >/tmp/data_loading_status
162
+ fi
163
+ fi
164
+ fi
165
+ else
166
+ log "Data loader disabled"
167
+ echo "DISABLED" >/tmp/data_loading_status
168
+ fi
169
+
170
+ # Start the main application
171
+ log "Data loading phase completed. Starting main application..."
172
+
173
+ # Ensure Python path includes the app directory
174
+ export PYTHONPATH="/app:${PYTHONPATH}"
175
+
176
+ # Create cache directory and set path for container
177
+ cache_dir="/app/aiagents4pharma/talk2knowledgegraphs/tests/files"
178
+ if [ ! -d "$cache_dir" ]; then
179
+ log "Creating cache directory: $cache_dir"
180
+ mkdir -p "$cache_dir"
181
+ fi
182
+
183
+ # Set container-specific cache path
184
+ export CACHE_EDGE_INDEX_PATH="/app/aiagents4pharma/talk2knowledgegraphs/tests/files/t2kg_primekg_edge_index.pkl"
185
+
186
+ log "Starting main application..."
187
+ log "Python path: $PYTHONPATH"
188
+ log "Cache edge index path: $CACHE_EDGE_INDEX_PATH"
189
+ log "Executing command: $@"
190
+ exec "$@"
@@ -0,0 +1,140 @@
1
+ **Talk2KnowledgeGraphs** is an AI agent designed to interact with biomedical knowledge graphs. Biomedical knowledge graphs contains crucial information in the form of entities (nodes) and their relationships (edges). These graphs are used to represent complex biological systems, such as metabolic pathways, protein-protein interactions, and gene regulatory networks. In order to easily interact with this information, Talk2KnowledgeGraphs uses natural language processing (NLP) to enable users to ask questions and make requests. By simply asking questions or making requests, users can:
2
+
3
+ - Dataset loading: load knowledge graph from datasets.
4
+ - Embedding: embed entities and relationships in the knowledge graph.
5
+ - Knowledge graph construction: construct a knowledge graph from dataframes.
6
+ - Subgraph extraction: extract subgraphs from the initial knowledge graph.
7
+ - Retrieval: retrieve information from the (sub-) knowledge graph.
8
+ - Reasoning: reason over the (sub-) knowledge graph.
9
+ - Visualization: visualize the (sub-) knowledge graph.
10
+
11
+ 📝 By default, `talk2knowledgegraphs` includes a small subset of the PrimeKG knowledge graph, allowing users to start interacting with it out of the box.
12
+ To switch to a different knowledge graph or use your own, refer to the [deployment guide](https://virtualpatientengine.github.io/AIAgents4Pharma/talk2knowledgegraphs/deployment/).
13
+
14
+ ## Installation
15
+
16
+ If your machine has NVIDIA GPU(s), please install the following this:
17
+
18
+ - [nvidia-cuda-toolkit](https://developer.nvidia.com/cuda-toolkit)
19
+ - [nvidia-container-toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/1.17.8/install-guide.html) (required for GPU support with Docker; enables containers to access NVIDIA GPUs for accelerated computing). After installing `nvidia-container-toolkit`, please restart Docker to ensure GPU support is enabled.
20
+
21
+ ### Docker (stable-release)
22
+
23
+ _This agent is available on Docker Hub._
24
+
25
+ **Prerequisites**
26
+
27
+ - If your machine has NVIDIA GPU(s), please install [nvidia-container-toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/1.17.8/install-guide.html) (required for GPU support with Docker; enables containers to access NVIDIA GPUs for accelerated computing). After installing `nvidia-container-toolkit`, please restart Docker to ensure GPU support is enabled.
28
+
29
+ - [Milvus](https://milvus.io) (for a vector database)
30
+
31
+ ---
32
+
33
+ #### 1. Download files
34
+
35
+ Choose the appropriate version of the `docker-compose.yml` file based on your system:
36
+
37
+ **For GPU:**
38
+
39
+ ```sh
40
+ wget https://raw.githubusercontent.com/VirtualPatientEngine/AIAgents4Pharma/main/aiagents4pharma/talk2knowledgegraphs/docker-compose/gpu/docker-compose.yml \
41
+ https://raw.githubusercontent.com/VirtualPatientEngine/AIAgents4Pharma/main/aiagents4pharma/talk2knowledgegraphs/docker-compose/gpu/.env.example
42
+ ```
43
+
44
+ **For CPU:**
45
+
46
+ ```sh
47
+ wget https://raw.githubusercontent.com/VirtualPatientEngine/AIAgents4Pharma/main/aiagents4pharma/talk2knowledgegraphs/docker-compose/cpu/docker-compose.yml \
48
+ https://raw.githubusercontent.com/VirtualPatientEngine/AIAgents4Pharma/main/aiagents4pharma/talk2knowledgegraphs/docker-compose/cpu/.env.example
49
+ ```
50
+
51
+ #### 2. Setup environment variables
52
+
53
+ ```sh
54
+ cp .env.example .env
55
+ ```
56
+
57
+ Edit `.env` with your API keys:
58
+
59
+ ```env
60
+ # .env.example (DO NOT put actual API keys here, read the README.md)
61
+
62
+ # OPENAI API KEY
63
+ OPENAI_API_KEY=your_openai_api_key_here
64
+
65
+ # LangSmith API KEY
66
+ LANGCHAIN_TRACING_V2=true
67
+ LANGCHAIN_API_KEY=your_langchain_api_key_here
68
+
69
+ # NVIDIA API KEY
70
+ NVIDIA_API_KEY=your_nvidia_api_key_here
71
+
72
+ # Set environment variables for data loader
73
+ MILVUS_HOST=localhost
74
+ MILVUS_PORT=19530
75
+ MILVUS_USER=root
76
+ MILVUS_PASSWORD=Milvus
77
+ MILVUS_DATABASE=your_database_name_here
78
+
79
+ # Specify the data directory for multimodal data to your own data directory
80
+ # DATA_DIR=/your_absolute_path_to_your_data_dir/
81
+
82
+ BATCH_SIZE=500
83
+ ```
84
+
85
+ ---
86
+
87
+ #### 3. Start the agent
88
+
89
+ ```sh
90
+ docker compose up -d
91
+ ```
92
+
93
+ ---
94
+
95
+ ### Access the Web UI
96
+
97
+ Once started, open:
98
+
99
+ ```
100
+ http://localhost:8501
101
+ ```
102
+
103
+ > In the background, the BioBridge multimodal embeddings will be inserted into the Milvus database, and the `talk2knowledgegraphs` service will start. Once the data is fully inserted, the application will be in a healthy state and accessible at the above address.
104
+ >
105
+ > You can monitor the process using:
106
+ >
107
+ > ```sh
108
+ > docker logs -f talk2knowledgegraphs
109
+ > ```
110
+
111
+ ---
112
+
113
+ ## Get Key
114
+
115
+ - `NVIDIA_API_KEY` – required (obtain a free key at [https://build.nvidia.com/explore/discover](https://build.nvidia.com/explore/discover))
116
+
117
+ **LangSmith** support is optional. To enable it, create an API key [here](https://docs.smith.langchain.com/administration/how_to_guides/organization_management/create_account_api_key).
118
+
119
+ _Please note that this will create a new tracing project in your Langsmith
120
+ account with the name `T2X-xxxx`, where `X` can be `KG` (KnowledgeGraphs).
121
+ If you skip the previous step, it will default to the name `default`.
122
+ `xxxx` will be the 4-digit ID created for the session._
123
+
124
+ ---
125
+
126
+ ## Notes for Windows Users
127
+
128
+ If you are using Windows, it is recommended to install [**Git Bash**](https://git-scm.com/downloads) for a smoother experience when running the bash commands in this guide.
129
+
130
+ - For applications that use **Docker Compose**, Git Bash is **required**.
131
+ - For applications that use **docker run** manually, Git Bash is **optional**, but recommended for consistency.
132
+
133
+ You can download Git Bash here: [Git for Windows](https://git-scm.com/downloads).
134
+
135
+ When using Docker on Windows, make sure you **run Docker with administrative privileges** if you face permission issues.
136
+
137
+ To resolve permission issues, you can:
138
+
139
+ - Review the official Docker documentation on [Windows permission requirements](https://docs.docker.com/desktop/setup/install/windows-permission-requirements/).
140
+ - Alternatively, follow the community discussion and solutions on [Docker Community Forums](https://forums.docker.com/t/error-when-trying-to-run-windows-containers-docker-client-must-be-run-with-elevated-privileges/136619).