aiagents4pharma 1.16.0__tar.gz → 1.17.1__tar.gz

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 (132) hide show
  1. aiagents4pharma-1.17.1/PKG-INFO +150 -0
  2. aiagents4pharma-1.17.1/README.md +101 -0
  3. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/__init__.py +0 -1
  4. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/__init__.py +1 -0
  5. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/agents/t2b_agent.py +3 -3
  6. {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/agents/t2b_agent/default.yaml +1 -1
  7. {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/tools/ask_question/default.yaml +1 -1
  8. {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/tools/get_annotation/default.yaml +1 -1
  9. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/ask_question.py +5 -4
  10. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/get_annotation.py +3 -3
  11. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/search_models.py +1 -1
  12. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/__init__.py +1 -1
  13. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/agents/main_agent.py +36 -15
  14. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/agents/s2_agent.py +38 -29
  15. {aiagents4pharma-1.16.0/aiagents4pharma/talk2scholars/config → aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs}/__init__.py +3 -1
  16. {aiagents4pharma-1.16.0/aiagents4pharma/configs → aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/agents}/__init__.py +3 -3
  17. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/__init__.py +6 -0
  18. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/main_agent/__init__.py +3 -0
  19. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/main_agent/default.yaml +39 -0
  20. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/s2_agent/__init__.py +3 -0
  21. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/s2_agent/default.yaml +68 -0
  22. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/app/__init__.py +5 -0
  23. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/app/frontend/__init__.py +3 -0
  24. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/app/frontend/default.yaml +33 -0
  25. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/config.yaml +8 -0
  26. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/tools/__init__.py +7 -0
  27. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/tools/multi_paper_recommendation/__init__.py +3 -0
  28. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/tools/multi_paper_recommendation/default.yaml +19 -0
  29. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/tools/search/__init__.py +3 -0
  30. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/tools/search/default.yaml +19 -0
  31. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/tools/single_paper_recommendation/__init__.py +3 -0
  32. aiagents4pharma-1.17.1/aiagents4pharma/talk2scholars/configs/tools/single_paper_recommendation/default.yaml +20 -0
  33. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tests/test_langgraph.py +71 -54
  34. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tools/s2/multi_paper_rec.py +13 -5
  35. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tools/s2/search.py +9 -3
  36. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tools/s2/single_paper_rec.py +13 -7
  37. aiagents4pharma-1.17.1/aiagents4pharma.egg-info/PKG-INFO +150 -0
  38. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma.egg-info/SOURCES.txt +27 -13
  39. aiagents4pharma-1.17.1/pyproject.toml +86 -0
  40. aiagents4pharma-1.17.1/release_version.txt +1 -0
  41. aiagents4pharma-1.16.0/PKG-INFO +0 -212
  42. aiagents4pharma-1.16.0/README.md +0 -163
  43. aiagents4pharma-1.16.0/aiagents4pharma/configs/config.yaml +0 -5
  44. aiagents4pharma-1.16.0/aiagents4pharma/talk2scholars/config/config.py +0 -110
  45. aiagents4pharma-1.16.0/aiagents4pharma.egg-info/PKG-INFO +0 -212
  46. aiagents4pharma-1.16.0/pyproject.toml +0 -76
  47. aiagents4pharma-1.16.0/release_version.txt +0 -1
  48. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/LICENSE +0 -0
  49. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/agents/__init__.py +0 -0
  50. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/api/__init__.py +0 -0
  51. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/api/kegg.py +0 -0
  52. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/api/ols.py +0 -0
  53. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/api/uniprot.py +0 -0
  54. {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/__init__.py +0 -0
  55. {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/agents/__init__.py +0 -0
  56. {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/agents/t2b_agent/__init__.py +0 -0
  57. {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/tools/__init__.py +0 -0
  58. {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/tools/ask_question/__init__.py +0 -0
  59. {aiagents4pharma-1.16.0/aiagents4pharma/configs/talk2biomodels → aiagents4pharma-1.17.1/aiagents4pharma/talk2biomodels/configs}/tools/get_annotation/__init__.py +0 -0
  60. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/models/__init__.py +0 -0
  61. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/models/basico_model.py +0 -0
  62. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/models/sys_bio_model.py +0 -0
  63. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/states/__init__.py +0 -0
  64. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/states/state_talk2biomodels.py +0 -0
  65. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/__init__.py +0 -0
  66. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_api.py +0 -0
  67. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_ask_question.py +0 -0
  68. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_basico_model.py +0 -0
  69. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_get_annotation.py +0 -0
  70. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_getmodelinfo.py +0 -0
  71. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_integration.py +0 -0
  72. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_param_scan.py +0 -0
  73. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_query_article.py +0 -0
  74. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_search_models.py +0 -0
  75. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_simulate_model.py +0 -0
  76. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_steady_state.py +0 -0
  77. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tests/test_sys_bio_model.py +0 -0
  78. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/__init__.py +0 -0
  79. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/custom_plotter.py +0 -0
  80. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/get_modelinfo.py +0 -0
  81. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/load_arguments.py +0 -0
  82. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/load_biomodel.py +0 -0
  83. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/parameter_scan.py +0 -0
  84. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/query_article.py +0 -0
  85. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/simulate_model.py +0 -0
  86. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2biomodels/tools/steady_state.py +0 -0
  87. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/__init__.py +0 -0
  88. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/agents/__init__.py +0 -0
  89. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/agents/scp_agent.py +0 -0
  90. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/states/__init__.py +0 -0
  91. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/states/state_talk2cells.py +0 -0
  92. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/tests/scp_agent/test_scp_agent.py +0 -0
  93. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/tools/__init__.py +0 -0
  94. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/tools/scp_agent/__init__.py +0 -0
  95. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/tools/scp_agent/display_studies.py +0 -0
  96. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2cells/tools/scp_agent/search_studies.py +0 -0
  97. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/__init__.py +0 -0
  98. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/datasets/__init__.py +0 -0
  99. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/datasets/biobridge_primekg.py +0 -0
  100. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/datasets/dataset.py +0 -0
  101. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/datasets/primekg.py +0 -0
  102. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/datasets/starkqa_primekg.py +0 -0
  103. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/__init__.py +0 -0
  104. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_biobridge_primekg.py +0 -0
  105. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_dataset.py +0 -0
  106. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_primekg.py +0 -0
  107. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_starkqa_primekg.py +0 -0
  108. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_embeddings.py +0 -0
  109. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_huggingface.py +0 -0
  110. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_sentencetransformer.py +0 -0
  111. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_enrichments.py +0 -0
  112. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_ollama.py +0 -0
  113. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/__init__.py +0 -0
  114. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/__init__.py +0 -0
  115. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/embeddings.py +0 -0
  116. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/huggingface.py +0 -0
  117. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/sentence_transformer.py +0 -0
  118. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/enrichments/__init__.py +0 -0
  119. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/enrichments/enrichments.py +0 -0
  120. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/enrichments/ollama.py +0 -0
  121. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2knowledgegraphs/utils/kg_utils.py +0 -0
  122. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/agents/__init__.py +0 -0
  123. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/state/__init__.py +0 -0
  124. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/state/state_talk2scholars.py +0 -0
  125. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tests/__init__.py +0 -0
  126. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tools/__init__.py +0 -0
  127. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tools/s2/__init__.py +0 -0
  128. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma/talk2scholars/tools/s2/display_results.py +0 -0
  129. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma.egg-info/dependency_links.txt +0 -0
  130. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma.egg-info/requires.txt +0 -0
  131. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/aiagents4pharma.egg-info/top_level.txt +0 -0
  132. {aiagents4pharma-1.16.0 → aiagents4pharma-1.17.1}/setup.cfg +0 -0
@@ -0,0 +1,150 @@
1
+ Metadata-Version: 2.2
2
+ Name: aiagents4pharma
3
+ Version: 1.17.1
4
+ Summary: AI Agents for drug discovery, drug development, and other pharmaceutical R&D
5
+ Classifier: Programming Language :: Python :: 3
6
+ Classifier: License :: OSI Approved :: MIT License
7
+ Classifier: Operating System :: OS Independent
8
+ Requires-Python: >=3.12
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: copasi_basico==0.78
12
+ Requires-Dist: coverage==7.6.4
13
+ Requires-Dist: einops==0.8.0
14
+ Requires-Dist: gdown==5.2.0
15
+ Requires-Dist: huggingface_hub==0.26.5
16
+ Requires-Dist: hydra-core==1.3.2
17
+ Requires-Dist: joblib==1.4.2
18
+ Requires-Dist: langchain==0.3.7
19
+ Requires-Dist: langchain-community==0.3.5
20
+ Requires-Dist: langchain-core==0.3.31
21
+ Requires-Dist: langchain-experimental==0.3.3
22
+ Requires-Dist: langchain-openai==0.2.5
23
+ Requires-Dist: langchain_ollama==0.2.2
24
+ Requires-Dist: langgraph==0.2.66
25
+ Requires-Dist: matplotlib==3.9.2
26
+ Requires-Dist: openai==1.59.4
27
+ Requires-Dist: ollama==0.4.6
28
+ Requires-Dist: pandas==2.2.3
29
+ Requires-Dist: plotly==5.24.1
30
+ Requires-Dist: pydantic==2.9.2
31
+ Requires-Dist: pylint==3.3.1
32
+ Requires-Dist: pypdf==5.2.0
33
+ Requires-Dist: pytest==8.3.3
34
+ Requires-Dist: pytest-asyncio==0.25.2
35
+ Requires-Dist: streamlit==1.39.0
36
+ Requires-Dist: sentence_transformers==3.3.1
37
+ Requires-Dist: tabulate==0.9.0
38
+ Requires-Dist: torch==2.2.2
39
+ Requires-Dist: torch_geometric==2.6.1
40
+ Requires-Dist: tqdm==4.66.6
41
+ Requires-Dist: transformers==4.48.0
42
+ Requires-Dist: mkdocs==1.6.1
43
+ Requires-Dist: mkdocs-jupyter==0.25.1
44
+ Requires-Dist: mkdocs-material==9.5.47
45
+ Requires-Dist: mkdocstrings-python==1.12.2
46
+ Requires-Dist: mkdocs-include-markdown-plugin==7.1.2
47
+ Requires-Dist: mkdocstrings==0.27.0
48
+ Requires-Dist: streamlit-feedback
49
+
50
+ [![Talk2BioModels](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2biomodels.yml/badge.svg)](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2biomodels.yml)
51
+ [![Talk2Cells](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2cells.yml/badge.svg)](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2cells.yml)
52
+ [![Talk2KnowledgeGraphs](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2knowledgegraphs.yml/badge.svg)](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2knowledgegraphs.yml)
53
+ [![TESTS Talk2Scholars](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2scholars.yml/badge.svg)](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2scholars.yml)
54
+ ![GitHub Release](https://img.shields.io/github/v/release/VirtualPatientEngine/AIAgents4Pharma)
55
+ ![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FVirtualPatientEngine%2FAIAgents4Pharma%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)
56
+
57
+
58
+ ## Introduction
59
+
60
+ Welcome to **AIAgents4Pharma** – an open-source project by [Team VPE](https://github.com/VirtualPatientEngine) that brings together AI-driven tools to help researchers and pharma interact seamlessly with complex biological data.
61
+
62
+ Our toolkit currently consists of the following agents:
63
+
64
+ - **Talk2BioModels** _(v1 released; v2 in progress)_: Engage directly with mathematical models in systems biology.
65
+ - **Talk2KnowledgeGraphs** _(v1 in progress)_: Access and explore complex biological knowledge graphs for insightful data connections.
66
+ - **Talk2Scholars** _(v1 in progress)_: Get recommendations for articles related to your choice. Download, query, and write/retrieve them to your reference manager (currently supporting Zotero).
67
+ - **Talk2Cells** _(v1 in progress)_: Query and analyze sequencing data with ease.
68
+
69
+ ![AIAgents4Pharma](docs/assets/AIAgents4Pharma.png)
70
+
71
+ ## Getting Started
72
+
73
+ ![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FVirtualPatientEngine%2FAIAgents4Pharma%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)
74
+
75
+ ### Installation
76
+
77
+ #### Option 1: PyPI
78
+
79
+ ```bash
80
+ pip install aiagents4pharma
81
+ ```
82
+
83
+ Check out the tutorials on each agent for detailed instrcutions.
84
+
85
+ #### Option 2: git
86
+
87
+ 1. **Clone the repository:**
88
+ ```bash
89
+ git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
90
+ cd AIAgents4Pharma
91
+ ```
92
+ 2. **Install dependencies:**
93
+ ```bash
94
+ pip install .
95
+ ```
96
+ 3. **Initialize OPENAI_API_KEY**
97
+ ```bash
98
+ export OPENAI_API_KEY=....
99
+ ```
100
+ 4. **[Optional] Initialize LANGSMITH_API_KEY**
101
+ ```bash
102
+ export LANGCHAIN_TRACING_V2=true
103
+ export LANGCHAIN_API_KEY=<your-api-key>
104
+ ```
105
+ _Please note that this will create a new tracing project in your Langsmith
106
+ account with the name `T2X-xxxx`, where `X` can be `B` (Biomodels), `S` (Scholars),
107
+ `KG` (KnowledgeGraphs), or `C` (Cells). If you skip the previous step, it will
108
+ default to the name `default`. `xxxx` will be the 4-digit ID created for the
109
+ session._
110
+
111
+ 5. **Launch the app:**
112
+ ```bash
113
+ streamlit run app/frontend/streamlit_app_<agent>.py
114
+ ```
115
+ _Replace <agent> with the agent name you are interested to launch._
116
+
117
+ For detailed instructions on each agent, please refer to their respective modules.
118
+
119
+ ---
120
+
121
+ ## Contributing
122
+
123
+ We welcome contributions to AIAgents4Pharma! Here’s how you can help:
124
+
125
+ 1. **Fork the repository**
126
+ 2. **Create a new branch** for your feature (`git checkout -b feat/feature-name`)
127
+ 3. **Commit your changes** (`git commit -m 'feat: Add new feature'`)
128
+ 4. **Push to the branch** (`git push origin feat/feature-name`)
129
+ 5. **Open a pull request** and reach out to any one of us below via Discussions:
130
+
131
+ _Note: We welcome all contributions, not just programming-related ones. Feel free to open bug reports, suggest new features, or participate as a beta tester. Your support is greatly appreciated!_
132
+
133
+ - **Talk2Biomodels/Talk2Cells**: [@gurdeep330](https://github.com/gurdeep330) [@lilijap](https://github.com/lilijap) [@dmccloskey](https://github.com/dmccloskey)
134
+ - **Talk2KnowledgeGraphs**: [@awmulyadi](https://github.com/awmulyadi) [@dmccloskey](https://github.com/dmccloskey)
135
+ - **Talk2Scholars**: [@ansh-info](https://github.com/ansh-info) [@gurdeep330](https://github.com/gurdeep330) [@dmccloskey](https://github.com/dmccloskey)
136
+
137
+ ### Current Needs
138
+
139
+ - **Beta testers** for Talk2BioModels and Talk2Scholars.
140
+ - **Developers** with experience in Python and Bioinformatics and/or knowledge graphs for contributions to AIAgents4Pharma.
141
+
142
+ Feel free to reach out to us via Discussions.
143
+
144
+ Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
145
+
146
+ ---
147
+
148
+ ## Feedback
149
+
150
+ Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use `Isssues` or `Discussions` 😀
@@ -0,0 +1,101 @@
1
+ [![Talk2BioModels](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2biomodels.yml/badge.svg)](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2biomodels.yml)
2
+ [![Talk2Cells](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2cells.yml/badge.svg)](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2cells.yml)
3
+ [![Talk2KnowledgeGraphs](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2knowledgegraphs.yml/badge.svg)](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2knowledgegraphs.yml)
4
+ [![TESTS Talk2Scholars](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2scholars.yml/badge.svg)](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2scholars.yml)
5
+ ![GitHub Release](https://img.shields.io/github/v/release/VirtualPatientEngine/AIAgents4Pharma)
6
+ ![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FVirtualPatientEngine%2FAIAgents4Pharma%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)
7
+
8
+
9
+ ## Introduction
10
+
11
+ Welcome to **AIAgents4Pharma** – an open-source project by [Team VPE](https://github.com/VirtualPatientEngine) that brings together AI-driven tools to help researchers and pharma interact seamlessly with complex biological data.
12
+
13
+ Our toolkit currently consists of the following agents:
14
+
15
+ - **Talk2BioModels** _(v1 released; v2 in progress)_: Engage directly with mathematical models in systems biology.
16
+ - **Talk2KnowledgeGraphs** _(v1 in progress)_: Access and explore complex biological knowledge graphs for insightful data connections.
17
+ - **Talk2Scholars** _(v1 in progress)_: Get recommendations for articles related to your choice. Download, query, and write/retrieve them to your reference manager (currently supporting Zotero).
18
+ - **Talk2Cells** _(v1 in progress)_: Query and analyze sequencing data with ease.
19
+
20
+ ![AIAgents4Pharma](docs/assets/AIAgents4Pharma.png)
21
+
22
+ ## Getting Started
23
+
24
+ ![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FVirtualPatientEngine%2FAIAgents4Pharma%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)
25
+
26
+ ### Installation
27
+
28
+ #### Option 1: PyPI
29
+
30
+ ```bash
31
+ pip install aiagents4pharma
32
+ ```
33
+
34
+ Check out the tutorials on each agent for detailed instrcutions.
35
+
36
+ #### Option 2: git
37
+
38
+ 1. **Clone the repository:**
39
+ ```bash
40
+ git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
41
+ cd AIAgents4Pharma
42
+ ```
43
+ 2. **Install dependencies:**
44
+ ```bash
45
+ pip install .
46
+ ```
47
+ 3. **Initialize OPENAI_API_KEY**
48
+ ```bash
49
+ export OPENAI_API_KEY=....
50
+ ```
51
+ 4. **[Optional] Initialize LANGSMITH_API_KEY**
52
+ ```bash
53
+ export LANGCHAIN_TRACING_V2=true
54
+ export LANGCHAIN_API_KEY=<your-api-key>
55
+ ```
56
+ _Please note that this will create a new tracing project in your Langsmith
57
+ account with the name `T2X-xxxx`, where `X` can be `B` (Biomodels), `S` (Scholars),
58
+ `KG` (KnowledgeGraphs), or `C` (Cells). If you skip the previous step, it will
59
+ default to the name `default`. `xxxx` will be the 4-digit ID created for the
60
+ session._
61
+
62
+ 5. **Launch the app:**
63
+ ```bash
64
+ streamlit run app/frontend/streamlit_app_<agent>.py
65
+ ```
66
+ _Replace <agent> with the agent name you are interested to launch._
67
+
68
+ For detailed instructions on each agent, please refer to their respective modules.
69
+
70
+ ---
71
+
72
+ ## Contributing
73
+
74
+ We welcome contributions to AIAgents4Pharma! Here’s how you can help:
75
+
76
+ 1. **Fork the repository**
77
+ 2. **Create a new branch** for your feature (`git checkout -b feat/feature-name`)
78
+ 3. **Commit your changes** (`git commit -m 'feat: Add new feature'`)
79
+ 4. **Push to the branch** (`git push origin feat/feature-name`)
80
+ 5. **Open a pull request** and reach out to any one of us below via Discussions:
81
+
82
+ _Note: We welcome all contributions, not just programming-related ones. Feel free to open bug reports, suggest new features, or participate as a beta tester. Your support is greatly appreciated!_
83
+
84
+ - **Talk2Biomodels/Talk2Cells**: [@gurdeep330](https://github.com/gurdeep330) [@lilijap](https://github.com/lilijap) [@dmccloskey](https://github.com/dmccloskey)
85
+ - **Talk2KnowledgeGraphs**: [@awmulyadi](https://github.com/awmulyadi) [@dmccloskey](https://github.com/dmccloskey)
86
+ - **Talk2Scholars**: [@ansh-info](https://github.com/ansh-info) [@gurdeep330](https://github.com/gurdeep330) [@dmccloskey](https://github.com/dmccloskey)
87
+
88
+ ### Current Needs
89
+
90
+ - **Beta testers** for Talk2BioModels and Talk2Scholars.
91
+ - **Developers** with experience in Python and Bioinformatics and/or knowledge graphs for contributions to AIAgents4Pharma.
92
+
93
+ Feel free to reach out to us via Discussions.
94
+
95
+ Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
96
+
97
+ ---
98
+
99
+ ## Feedback
100
+
101
+ Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use `Isssues` or `Discussions` 😀
@@ -3,7 +3,6 @@ This file is used to import aiagents4pharma modules.
3
3
  """
4
4
 
5
5
  from . import (
6
- configs,
7
6
  talk2biomodels,
8
7
  talk2cells,
9
8
  talk2scholars,
@@ -6,3 +6,4 @@ from . import tools
6
6
  from . import agents
7
7
  from . import states
8
8
  from . import api
9
+ from . import configs
@@ -55,10 +55,10 @@ def get_app(uniq_id, llm_model='gpt-4o-mini'):
55
55
  llm = ChatOpenAI(model=llm_model, temperature=0)
56
56
  # Load hydra configuration
57
57
  logger.log(logging.INFO, "Load Hydra configuration for Talk2BioModels agent.")
58
- with hydra.initialize(version_base=None, config_path="../../configs"):
58
+ with hydra.initialize(version_base=None, config_path="../configs"):
59
59
  cfg = hydra.compose(config_name='config',
60
- overrides=['talk2biomodels/agents/t2b_agent=default'])
61
- cfg = cfg.talk2biomodels.agents.t2b_agent
60
+ overrides=['agents/t2b_agent=default'])
61
+ cfg = cfg.agents.t2b_agent
62
62
  logger.log(logging.INFO, "state_modifier: %s", cfg.state_modifier)
63
63
  # Create the agent
64
64
  model = create_react_agent(
@@ -1,4 +1,4 @@
1
- _target_: talk2biomodels.agents.t2b_agent.get_app
1
+ _target_: agents.t2b_agent.get_app
2
2
  state_modifier: >
3
3
  You are Talk2BioModels agent.
4
4
  If the user asks for the uploaded model,
@@ -1,4 +1,4 @@
1
- _target_: talk2biomodels.tools.ask_question.AskQuestionTool
1
+ _target_: tools.ask_question.AskQuestionTool
2
2
  steady_state_prompt: >
3
3
  Following are header columns of the data:
4
4
  `species_name`: Name of the species,
@@ -1,4 +1,4 @@
1
- _target_: talk2biomodels.tools.get_annotation.GetAnnotationTool
1
+ _target_: tools.get_annotation.GetAnnotationTool
2
2
  prompt: >
3
3
  Given the user question, extract the relevant species names.
4
4
  If the user aks for a specific species, extract that species.
@@ -66,10 +66,10 @@ class AskQuestionTool(BaseTool):
66
66
  question_context,
67
67
  experiment_name)
68
68
  # Load hydra configuration
69
- with hydra.initialize(version_base=None, config_path="../../configs"):
69
+ with hydra.initialize(version_base=None, config_path="../configs"):
70
70
  cfg = hydra.compose(config_name='config',
71
- overrides=['talk2biomodels/tools/ask_question=default'])
72
- cfg = cfg.talk2biomodels.tools.ask_question
71
+ overrides=['tools/ask_question=default'])
72
+ cfg = cfg.tools.ask_question
73
73
  # Get the context of the question
74
74
  # and based on the context, get the data
75
75
  # and prompt content to ask the question
@@ -111,5 +111,6 @@ class AskQuestionTool(BaseTool):
111
111
  verbose=True,
112
112
  prefix=prompt_content)
113
113
  # Invoke the agent with the question
114
- llm_result = df_agent.invoke(question)
114
+ llm_result = df_agent.invoke(question, stream_mode=None)
115
+ # print (llm_result)
115
116
  return llm_result["output"]
@@ -34,10 +34,10 @@ def extract_relevant_species_names(model_object, arg_data, state):
34
34
  Extract relevant species names based on the user question.
35
35
  """
36
36
  # Load hydra configuration
37
- with hydra.initialize(version_base=None, config_path="../../configs"):
37
+ with hydra.initialize(version_base=None, config_path="../configs"):
38
38
  cfg = hydra.compose(config_name='config',
39
- overrides=['talk2biomodels/tools/get_annotation=default'])
40
- cfg = cfg.talk2biomodels.tools.get_annotation
39
+ overrides=['tools/get_annotation=default'])
40
+ cfg = cfg.tools.get_annotation
41
41
  logger.info("Loaded the following system prompt for the LLM"
42
42
  " to get a structured output: %s", cfg.prompt)
43
43
 
@@ -29,7 +29,7 @@ class SearchModelsTool(BaseTool):
29
29
  name: str = "search_models"
30
30
  description: str = "Search models in the BioMmodels database based on keywords."
31
31
  args_schema: Type[BaseModel] = SearchModelsInput
32
- return_direct: bool = True
32
+ return_direct: bool = False
33
33
 
34
34
  def _run(self,
35
35
  query: str,
@@ -2,4 +2,4 @@
2
2
  This file is used to import all the modules in the package.
3
3
  """
4
4
 
5
- from . import agents, config, state, tests, tools
5
+ from . import agents, configs, state, tests, tools
@@ -5,8 +5,8 @@ Main agent for the talk2scholars app.
5
5
  """
6
6
 
7
7
  import logging
8
- from typing import Literal
9
- from dotenv import load_dotenv
8
+ from typing import Literal, Any
9
+ import hydra
10
10
  from langchain_core.language_models.chat_models import BaseChatModel
11
11
  from langchain_core.messages import AIMessage
12
12
  from langchain_openai import ChatOpenAI
@@ -14,27 +14,26 @@ from langgraph.checkpoint.memory import MemorySaver
14
14
  from langgraph.graph import END, START, StateGraph
15
15
  from langgraph.types import Command
16
16
  from ..agents import s2_agent
17
- from ..config.config import config
18
17
  from ..state.state_talk2scholars import Talk2Scholars
19
18
 
20
19
  logging.basicConfig(level=logging.INFO)
21
20
  logger = logging.getLogger(__name__)
22
21
 
23
- load_dotenv()
24
22
 
25
- def make_supervisor_node(llm: BaseChatModel) -> str:
23
+ def make_supervisor_node(llm: BaseChatModel, cfg: Any) -> str:
26
24
  """
27
25
  Creates a supervisor node following LangGraph patterns.
28
26
 
29
27
  Args:
30
28
  llm (BaseChatModel): The language model to use for generating responses.
29
+ cfg (Any): The configuration object.
31
30
 
32
31
  Returns:
33
32
  str: The supervisor node function.
34
33
  """
35
- # options = ["FINISH", "s2_agent"]
36
-
37
- def supervisor_node(state: Talk2Scholars) -> Command[Literal["s2_agent", "__end__"]]:
34
+ def supervisor_node(
35
+ state: Talk2Scholars,
36
+ ) -> Command[Literal["s2_agent", "__end__"]]:
38
37
  """
39
38
  Supervisor node that routes to appropriate sub-agents.
40
39
 
@@ -44,9 +43,13 @@ def make_supervisor_node(llm: BaseChatModel) -> str:
44
43
  Returns:
45
44
  Command[Literal["s2_agent", "__end__"]]: The command to execute next.
46
45
  """
47
- logger.info("Supervisor node called")
46
+ logger.info(
47
+ "Supervisor node called - Messages count: %d, Current Agent: %s",
48
+ len(state["messages"]),
49
+ state.get("current_agent", "None"),
50
+ )
48
51
 
49
- messages = [{"role": "system", "content": config.MAIN_AGENT_PROMPT}] + state[
52
+ messages = [{"role": "system", "content": cfg.state_modifier}] + state[
50
53
  "messages"
51
54
  ]
52
55
  response = llm.invoke(messages)
@@ -81,7 +84,8 @@ def make_supervisor_node(llm: BaseChatModel) -> str:
81
84
 
82
85
  return supervisor_node
83
86
 
84
- def get_app(thread_id: str, llm_model ='gpt-4o-mini') -> StateGraph:
87
+
88
+ def get_app(thread_id: str, llm_model="gpt-4o-mini") -> StateGraph:
85
89
  """
86
90
  Returns the langraph app with hierarchical structure.
87
91
 
@@ -91,6 +95,16 @@ def get_app(thread_id: str, llm_model ='gpt-4o-mini') -> StateGraph:
91
95
  Returns:
92
96
  The compiled langraph app.
93
97
  """
98
+
99
+ # Load hydra configuration
100
+ logger.log(logging.INFO, "Load Hydra configuration for Talk2Scholars main agent.")
101
+ with hydra.initialize(version_base=None, config_path="../../configs"):
102
+ cfg = hydra.compose(
103
+ config_name="config", overrides=["agents/talk2scholars/main_agent=default"]
104
+ )
105
+ cfg = cfg.agents.talk2scholars.main_agent
106
+ logger.info("Hydra configuration loaded with values: %s", cfg)
107
+
94
108
  def call_s2_agent(state: Talk2Scholars) -> Command[Literal["__end__"]]:
95
109
  """
96
110
  Node for calling the S2 agent.
@@ -101,10 +115,10 @@ def get_app(thread_id: str, llm_model ='gpt-4o-mini') -> StateGraph:
101
115
  Returns:
102
116
  Command[Literal["__end__"]]: The command to execute next.
103
117
  """
104
- logger.info("Calling S2 agent")
118
+ logger.info("Calling S2 agent with state: %s", state)
105
119
  app = s2_agent.get_app(thread_id, llm_model)
106
120
  response = app.invoke(state)
107
- logger.info("S2 agent completed")
121
+ logger.info("S2 agent completed with response: %s", response)
108
122
  return Command(
109
123
  goto=END,
110
124
  update={
@@ -114,10 +128,17 @@ def get_app(thread_id: str, llm_model ='gpt-4o-mini') -> StateGraph:
114
128
  "current_agent": "s2_agent",
115
129
  },
116
130
  )
117
- llm = ChatOpenAI(model=llm_model, temperature=0)
131
+
132
+ logger.log(
133
+ logging.INFO,
134
+ "Using OpenAI model %s with temperature %s",
135
+ llm_model,
136
+ cfg.temperature
137
+ )
138
+ llm = ChatOpenAI(model=llm_model, temperature=cfg.temperature)
118
139
  workflow = StateGraph(Talk2Scholars)
119
140
 
120
- supervisor = make_supervisor_node(llm)
141
+ supervisor = make_supervisor_node(llm, cfg)
121
142
  workflow.add_node("supervisor", supervisor)
122
143
  workflow.add_node("s2_agent", call_s2_agent)
123
144
 
@@ -1,56 +1,65 @@
1
- #/usr/bin/env python3
1
+ # /usr/bin/env python3
2
2
 
3
- '''
3
+ """
4
4
  Agent for interacting with Semantic Scholar
5
- '''
5
+ """
6
6
 
7
7
  import logging
8
- from dotenv import load_dotenv
8
+ import hydra
9
9
  from langchain_openai import ChatOpenAI
10
10
  from langgraph.graph import START, StateGraph
11
- from langgraph.prebuilt import create_react_agent
11
+ from langgraph.prebuilt import create_react_agent, ToolNode
12
12
  from langgraph.checkpoint.memory import MemorySaver
13
- from ..config.config import config
14
13
  from ..state.state_talk2scholars import Talk2Scholars
15
- # from ..tools.s2 import s2_tools
16
- from ..tools.s2.search import search_tool
17
- from ..tools.s2.display_results import display_results
18
- from ..tools.s2.single_paper_rec import get_single_paper_recommendations
19
- from ..tools.s2.multi_paper_rec import get_multi_paper_recommendations
14
+ from ..tools.s2.search import search_tool as s2_search
15
+ from ..tools.s2.display_results import display_results as s2_display
16
+ from ..tools.s2.single_paper_rec import (
17
+ get_single_paper_recommendations as s2_single_rec,
18
+ )
19
+ from ..tools.s2.multi_paper_rec import get_multi_paper_recommendations as s2_multi_rec
20
20
 
21
- load_dotenv()
22
21
 
23
22
  # Initialize logger
24
23
  logging.basicConfig(level=logging.INFO)
25
24
  logger = logging.getLogger(__name__)
26
25
 
27
- def get_app(uniq_id, llm_model='gpt-4o-mini'):
28
- '''
26
+
27
+ def get_app(uniq_id, llm_model="gpt-4o-mini"):
28
+ """
29
29
  This function returns the langraph app.
30
- '''
30
+ """
31
+
31
32
  def agent_s2_node(state: Talk2Scholars):
32
- '''
33
+ """
33
34
  This function calls the model.
34
- '''
35
+ """
35
36
  logger.log(logging.INFO, "Creating Agent_S2 node with thread_id %s", uniq_id)
36
37
  response = model.invoke(state, {"configurable": {"thread_id": uniq_id}})
37
38
  return response
38
39
 
40
+ # Load hydra configuration
41
+ logger.log(logging.INFO, "Load Hydra configuration for Talk2Scholars S2 agent.")
42
+ with hydra.initialize(version_base=None, config_path="../../configs"):
43
+ cfg = hydra.compose(
44
+ config_name="config", overrides=["agents/talk2scholars/s2_agent=default"]
45
+ )
46
+ cfg = cfg.agents.talk2scholars.s2_agent
47
+
39
48
  # Define the tools
40
- tools = [search_tool,
41
- display_results,
42
- get_single_paper_recommendations,
43
- get_multi_paper_recommendations]
49
+ tools = ToolNode([s2_search, s2_display, s2_single_rec, s2_multi_rec])
50
+
51
+ # Define the model
52
+ logger.log(logging.INFO, "Using OpenAI model %s", llm_model)
53
+ llm = ChatOpenAI(model=llm_model, temperature=cfg.temperature)
44
54
 
45
- # Create the LLM
46
- llm = ChatOpenAI(model=llm_model, temperature=0)
55
+ # Create the agent
47
56
  model = create_react_agent(
48
- llm,
49
- tools=tools,
50
- state_schema=Talk2Scholars,
51
- state_modifier=config.S2_AGENT_PROMPT,
52
- checkpointer=MemorySaver()
53
- )
57
+ llm,
58
+ tools=tools,
59
+ state_schema=Talk2Scholars,
60
+ state_modifier=cfg.s2_agent,
61
+ checkpointer=MemorySaver(),
62
+ )
54
63
 
55
64
  # Define a new graph
56
65
  workflow = StateGraph(Talk2Scholars)
@@ -2,4 +2,6 @@
2
2
  This package contains configuration settings and prompts used by various AI agents
3
3
  """
4
4
 
5
- from . import config
5
+ from . import agents
6
+ from . import tools
7
+ from . import app
@@ -1,5 +1,5 @@
1
- '''
1
+ """
2
2
  Import all the modules in the package
3
- '''
3
+ """
4
4
 
5
- from . import talk2biomodels
5
+ from . import talk2scholars
@@ -0,0 +1,6 @@
1
+ """
2
+ Import all the modules in the package
3
+ """
4
+
5
+ from . import s2_agent
6
+ from . import main_agent
@@ -0,0 +1,3 @@
1
+ """
2
+ Import all the modules in the package
3
+ """
@@ -0,0 +1,39 @@
1
+ _target_: agents.main_agent.get_app
2
+ openai_api_key: ${oc.env:OPENAI_API_KEY}
3
+ openai_llms:
4
+ - "gpt-4o-mini"
5
+ - "gpt-4-turbo"
6
+ - "gpt-3.5-turbo"
7
+ temperature: 0
8
+ main_agent: >
9
+ "You are a supervisory AI agent that routes user queries to specialized tools.\n"
10
+ "Your task is to select the most appropriate tool based on the user's request.\n\n"
11
+ "Available tools and their capabilities:\n\n"
12
+ "1. semantic_scholar_agent:\n"
13
+ " - Search for academic papers and research\n"
14
+ " - Get paper recommendations\n"
15
+ " - Find similar papers\n"
16
+ " USE FOR: Any queries about finding papers, academic research, "
17
+ "or getting paper recommendations\n\n"
18
+ "ROUTING GUIDELINES:\n\n"
19
+ "ALWAYS route to semantic_scholar_agent for:\n"
20
+ "- Finding academic papers\n"
21
+ "- Searching research topics\n"
22
+ "- Getting paper recommendations\n"
23
+ "- Finding similar papers\n"
24
+ "- Any query about academic literature\n\n"
25
+ "Approach:\n"
26
+ "1. Identify the core need in the user's query\n"
27
+ "2. Select the most appropriate tool based on the guidelines above\n"
28
+ "3. If unclear, ask for clarification\n"
29
+ "4. For multi-step tasks, focus on the immediate next step\n\n"
30
+ "Remember:\n"
31
+ "- Be decisive in your tool selection\n"
32
+ "- Focus on the immediate task\n"
33
+ "- Default to semantic_scholar_agent for any paper-finding tasks\n"
34
+ "- Ask for clarification if the request is ambiguous\n\n"
35
+ "When presenting paper search results, always use this exact format:\n\n"
36
+ "Remember to:\n"
37
+ "- To always add the url\n"
38
+ "- Put URLs on the title line itself as markdown\n"
39
+ "- Maintain consistent spacing and formatting"
@@ -0,0 +1,3 @@
1
+ """
2
+ Import all the modules in the package
3
+ """