aiagents4pharma 1.22.4__tar.gz → 1.23.0__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 (191) hide show
  1. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/PKG-INFO +26 -14
  2. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/README.md +24 -13
  3. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/agents/__init__.py +3 -2
  4. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/agents/main_agent.py +51 -4
  5. aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/agents/zotero_agent.py +120 -0
  6. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/__init__.py +1 -0
  7. aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/main_agent/default.yaml +59 -0
  8. aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/s2_agent/default.yaml +42 -0
  9. aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/zotero_agent/default.yaml +35 -0
  10. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/configs/config.yaml +3 -1
  11. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/configs/tools/__init__.py +1 -0
  12. aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/configs/tools/single_paper_recommendation/__init__.py +3 -0
  13. aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/configs/tools/zotero_read/__init__.py +3 -0
  14. aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/configs/tools/zotero_read/default.yaml +15 -0
  15. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/state/state_talk2scholars.py +2 -0
  16. aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/tests/test_call_s2.py +99 -0
  17. aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/tests/test_call_zotero.py +93 -0
  18. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/tests/test_main_agent.py +6 -42
  19. aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/tests/test_routing_logic.py +71 -0
  20. aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/tests/test_zotero_agent.py +160 -0
  21. aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/tests/test_zotero_tool.py +171 -0
  22. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/tools/__init__.py +3 -2
  23. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/tools/s2/multi_paper_rec.py +17 -2
  24. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/tools/s2/search.py +14 -2
  25. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/tools/s2/single_paper_rec.py +17 -2
  26. aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/tools/zotero/__init__.py +5 -0
  27. aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/tools/zotero/zotero_read.py +142 -0
  28. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma.egg-info/PKG-INFO +26 -14
  29. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma.egg-info/SOURCES.txt +13 -1
  30. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma.egg-info/requires.txt +1 -0
  31. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/pyproject.toml +4 -1
  32. aiagents4pharma-1.23.0/release_version.txt +1 -0
  33. aiagents4pharma-1.22.4/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/main_agent/default.yaml +0 -39
  34. aiagents4pharma-1.22.4/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/s2_agent/default.yaml +0 -16
  35. aiagents4pharma-1.22.4/release_version.txt +0 -1
  36. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/LICENSE +0 -0
  37. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/__init__.py +0 -0
  38. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/__init__.py +0 -0
  39. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/agents/__init__.py +0 -0
  40. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/agents/t2b_agent.py +0 -0
  41. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/api/__init__.py +0 -0
  42. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/api/kegg.py +0 -0
  43. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/api/ols.py +0 -0
  44. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/api/uniprot.py +0 -0
  45. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/configs/__init__.py +0 -0
  46. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/configs/agents/__init__.py +0 -0
  47. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/configs/agents/t2b_agent/__init__.py +0 -0
  48. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/configs/agents/t2b_agent/default.yaml +0 -0
  49. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/configs/config.yaml +0 -0
  50. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/configs/tools/__init__.py +0 -0
  51. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/configs/tools/ask_question/__init__.py +0 -0
  52. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/configs/tools/ask_question/default.yaml +0 -0
  53. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/configs/tools/custom_plotter/__init__.py +0 -0
  54. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/configs/tools/custom_plotter/default.yaml +0 -0
  55. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/configs/tools/get_annotation/__init__.py +0 -0
  56. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/configs/tools/get_annotation/default.yaml +0 -0
  57. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/models/__init__.py +0 -0
  58. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/models/basico_model.py +0 -0
  59. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/models/sys_bio_model.py +0 -0
  60. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/states/__init__.py +0 -0
  61. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/states/state_talk2biomodels.py +0 -0
  62. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tests/__init__.py +0 -0
  63. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tests/test_api.py +0 -0
  64. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tests/test_ask_question.py +0 -0
  65. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tests/test_basico_model.py +0 -0
  66. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tests/test_get_annotation.py +0 -0
  67. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tests/test_getmodelinfo.py +0 -0
  68. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tests/test_integration.py +0 -0
  69. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tests/test_load_biomodel.py +0 -0
  70. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tests/test_param_scan.py +0 -0
  71. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tests/test_query_article.py +0 -0
  72. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tests/test_search_models.py +0 -0
  73. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tests/test_simulate_model.py +0 -0
  74. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tests/test_steady_state.py +0 -0
  75. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tests/test_sys_bio_model.py +0 -0
  76. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tools/__init__.py +0 -0
  77. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tools/ask_question.py +0 -0
  78. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tools/custom_plotter.py +0 -0
  79. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tools/get_annotation.py +0 -0
  80. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tools/get_modelinfo.py +0 -0
  81. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tools/load_arguments.py +0 -0
  82. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tools/load_biomodel.py +0 -0
  83. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tools/parameter_scan.py +0 -0
  84. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tools/query_article.py +0 -0
  85. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tools/search_models.py +0 -0
  86. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tools/simulate_model.py +0 -0
  87. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tools/steady_state.py +0 -0
  88. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2biomodels/tools/utils.py +0 -0
  89. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2cells/__init__.py +0 -0
  90. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2cells/agents/__init__.py +0 -0
  91. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2cells/agents/scp_agent.py +0 -0
  92. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2cells/states/__init__.py +0 -0
  93. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2cells/states/state_talk2cells.py +0 -0
  94. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2cells/tests/scp_agent/test_scp_agent.py +0 -0
  95. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2cells/tools/__init__.py +0 -0
  96. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2cells/tools/scp_agent/__init__.py +0 -0
  97. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2cells/tools/scp_agent/display_studies.py +0 -0
  98. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2cells/tools/scp_agent/search_studies.py +0 -0
  99. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/__init__.py +0 -0
  100. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/agents/__init__.py +0 -0
  101. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/agents/t2kg_agent.py +0 -0
  102. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/configs/__init__.py +0 -0
  103. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/configs/agents/t2kg_agent/__init__.py +0 -0
  104. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/configs/agents/t2kg_agent/default.yaml +0 -0
  105. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/configs/app/__init__.py +0 -0
  106. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/configs/app/frontend/__init__.py +0 -0
  107. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/configs/app/frontend/default.yaml +0 -0
  108. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/configs/config.yaml +0 -0
  109. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/configs/tools/__init__.py +0 -0
  110. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/configs/tools/graphrag_reasoning/__init__.py +0 -0
  111. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/configs/tools/graphrag_reasoning/default.yaml +0 -0
  112. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_extraction/__init__.py +0 -0
  113. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_extraction/default.yaml +0 -0
  114. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_summarization/__init__.py +0 -0
  115. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/configs/tools/subgraph_summarization/default.yaml +0 -0
  116. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/datasets/__init__.py +0 -0
  117. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/datasets/biobridge_primekg.py +0 -0
  118. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/datasets/dataset.py +0 -0
  119. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/datasets/primekg.py +0 -0
  120. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/datasets/starkqa_primekg.py +0 -0
  121. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/states/__init__.py +0 -0
  122. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/states/state_talk2knowledgegraphs.py +0 -0
  123. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/__init__.py +0 -0
  124. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_agents_t2kg_agent.py +0 -0
  125. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_biobridge_primekg.py +0 -0
  126. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_dataset.py +0 -0
  127. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_primekg.py +0 -0
  128. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_starkqa_primekg.py +0 -0
  129. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_tools_graphrag_reasoning.py +0 -0
  130. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_tools_subgraph_extraction.py +0 -0
  131. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_tools_subgraph_summarization.py +0 -0
  132. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_embeddings.py +0 -0
  133. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_huggingface.py +0 -0
  134. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_nim_molmim.py +0 -0
  135. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_ollama.py +0 -0
  136. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_sentencetransformer.py +0 -0
  137. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_enrichments.py +0 -0
  138. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_ollama.py +0 -0
  139. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_pubchem.py +0 -0
  140. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_kg_utils.py +0 -0
  141. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_pubchem_utils.py +0 -0
  142. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tools/__init__.py +0 -0
  143. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tools/graphrag_reasoning.py +0 -0
  144. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tools/load_arguments.py +0 -0
  145. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tools/subgraph_extraction.py +0 -0
  146. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/tools/subgraph_summarization.py +0 -0
  147. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/__init__.py +0 -0
  148. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/__init__.py +0 -0
  149. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/embeddings.py +0 -0
  150. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/huggingface.py +0 -0
  151. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/nim_molmim.py +0 -0
  152. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/ollama.py +0 -0
  153. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/sentence_transformer.py +0 -0
  154. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/enrichments/__init__.py +0 -0
  155. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/enrichments/enrichments.py +0 -0
  156. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/enrichments/ollama.py +0 -0
  157. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/enrichments/pubchem_strings.py +0 -0
  158. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/extractions/__init__.py +0 -0
  159. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/extractions/pcst.py +0 -0
  160. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/kg_utils.py +0 -0
  161. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2knowledgegraphs/utils/pubchem_utils.py +0 -0
  162. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/__init__.py +0 -0
  163. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/agents/s2_agent.py +0 -0
  164. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/configs/__init__.py +0 -0
  165. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/configs/agents/__init__.py +0 -0
  166. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/main_agent/__init__.py +0 -0
  167. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/s2_agent/__init__.py +0 -0
  168. {aiagents4pharma-1.22.4/aiagents4pharma/talk2scholars/configs/app/frontend → aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/configs/agents/talk2scholars/zotero_agent}/__init__.py +0 -0
  169. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/configs/app/__init__.py +0 -0
  170. {aiagents4pharma-1.22.4/aiagents4pharma/talk2scholars/configs/tools/multi_paper_recommendation → aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/configs/app/frontend}/__init__.py +0 -0
  171. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/configs/app/frontend/default.yaml +0 -0
  172. {aiagents4pharma-1.22.4/aiagents4pharma/talk2scholars/configs/tools/retrieve_semantic_scholar_paper_id → aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/configs/tools/multi_paper_recommendation}/__init__.py +0 -0
  173. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/configs/tools/multi_paper_recommendation/default.yaml +0 -0
  174. {aiagents4pharma-1.22.4/aiagents4pharma/talk2scholars/configs/tools/search → aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/configs/tools/retrieve_semantic_scholar_paper_id}/__init__.py +0 -0
  175. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/configs/tools/retrieve_semantic_scholar_paper_id/default.yaml +0 -0
  176. {aiagents4pharma-1.22.4/aiagents4pharma/talk2scholars/configs/tools/single_paper_recommendation → aiagents4pharma-1.23.0/aiagents4pharma/talk2scholars/configs/tools/search}/__init__.py +0 -0
  177. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/configs/tools/search/default.yaml +0 -0
  178. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/configs/tools/single_paper_recommendation/default.yaml +0 -0
  179. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/state/__init__.py +0 -0
  180. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/tests/__init__.py +0 -0
  181. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/tests/test_llm_main_integration.py +0 -0
  182. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/tests/test_s2_agent.py +0 -0
  183. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/tests/test_s2_tools.py +0 -0
  184. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/tests/test_state.py +0 -0
  185. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/tools/s2/__init__.py +0 -0
  186. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/tools/s2/display_results.py +0 -0
  187. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/tools/s2/query_results.py +0 -0
  188. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma/talk2scholars/tools/s2/retrieve_semantic_scholar_paper_id.py +0 -0
  189. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma.egg-info/dependency_links.txt +0 -0
  190. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/aiagents4pharma.egg-info/top_level.txt +0 -0
  191. {aiagents4pharma-1.22.4 → aiagents4pharma-1.23.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: aiagents4pharma
3
- Version: 1.22.4
3
+ Version: 1.23.0
4
4
  Summary: AI Agents for drug discovery, drug development, and other pharmaceutical R&D.
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -36,6 +36,7 @@ Requires-Dist: pylint==3.3.1
36
36
  Requires-Dist: pypdf==5.2.0
37
37
  Requires-Dist: pytest==8.3.3
38
38
  Requires-Dist: pytest-asyncio==0.25.2
39
+ Requires-Dist: pyzotero==1.6.9
39
40
  Requires-Dist: streamlit==1.39.0
40
41
  Requires-Dist: sentence_transformers==3.3.1
41
42
  Requires-Dist: tabulate==0.9.0
@@ -59,7 +60,6 @@ Requires-Dist: streamlit-feedback
59
60
  ![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)
60
61
  ![Docker Pulls](https://img.shields.io/docker/pulls/virtualpatientengine/talk2biomodels?link=https%3A%2F%2Fhub.docker.com%2Frepository%2Fdocker%2Fvirtualpatientengine%2Ftalk2biomodels%2Fgeneral)
61
62
 
62
-
63
63
  ## Introduction
64
64
 
65
65
  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.
@@ -99,8 +99,8 @@ _Please note that this option is currently available only for Talk2Biomodels._
99
99
  ```
100
100
  docker run -e OPENAI_API_KEY=<openai_api_key> -e NVIDIA_API_KEY=<nvidia_api_key> -p 8501:8501 virtualpatientengine/talk2biomodels
101
101
  ```
102
- _You can create a free account at NVIDIA and apply for their
103
- free credits [here](https://build.nvidia.com/explore/discover)._
102
+ _You can create a free account at NVIDIA and apply for their
103
+ free credits [here](https://build.nvidia.com/explore/discover)._
104
104
 
105
105
  #### Option 3: git
106
106
 
@@ -114,31 +114,43 @@ free credits [here](https://build.nvidia.com/explore/discover)._
114
114
  pip install -r requirements.txt
115
115
  ```
116
116
  3. **Initialize OPENAI_API_KEY and NVIDIA_API_KEY**
117
+
117
118
  ```bash
118
119
  export OPENAI_API_KEY=....
119
120
  ```
121
+
120
122
  ```bash
121
123
  export NVIDIA_API_KEY=....
122
124
  ```
123
- _You can create a free account at NVIDIA and apply for their
124
- free credits [here](https://build.nvidia.com/explore/discover)._
125
125
 
126
- 4. **[Optional] Initialize LANGSMITH_API_KEY**
126
+ _You can create a free account at NVIDIA and apply for their
127
+ free credits [here](https://build.nvidia.com/explore/discover)._
128
+
129
+ 4. **Initialize ZOTERO_API_KEY and ZOTERO_USER_ID**
130
+
131
+ ```bash
132
+ export ZOTERO_API_KEY=....
133
+ export ZOTERO_USER_ID=....
134
+ ```
135
+
136
+ 5. **[Optional] Initialize LANGSMITH_API_KEY**
137
+
127
138
  ```bash
128
139
  export LANGCHAIN_TRACING_V2=true
129
140
  export LANGCHAIN_API_KEY=<your-api-key>
130
141
  ```
131
- _Please note that this will create a new tracing project in your Langsmith
132
- account with the name `T2X-xxxx`, where `X` can be `B` (Biomodels), `S` (Scholars),
133
- `KG` (KnowledgeGraphs), or `C` (Cells). If you skip the previous step, it will
134
- default to the name `default`. `xxxx` will be the 4-digit ID created for the
135
- session._
136
142
 
137
- 5. **Launch the app:**
143
+ _Please note that this will create a new tracing project in your Langsmith
144
+ account with the name `T2X-xxxx`, where `X` can be `B` (Biomodels), `S` (Scholars),
145
+ `KG` (KnowledgeGraphs), or `C` (Cells). If you skip the previous step, it will
146
+ default to the name `default`. `xxxx` will be the 4-digit ID created for the
147
+ session._
148
+
149
+ 6. **Launch the app:**
138
150
  ```bash
139
151
  streamlit run app/frontend/streamlit_app_<agent>.py
140
152
  ```
141
- _Replace <agent> with the agent name you are interested to launch._
153
+ _Replace <agent> with the agent name you are interested to launch._
142
154
 
143
155
  For detailed instructions on each agent, please refer to their respective modules.
144
156
 
@@ -6,7 +6,6 @@
6
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
7
  ![Docker Pulls](https://img.shields.io/docker/pulls/virtualpatientengine/talk2biomodels?link=https%3A%2F%2Fhub.docker.com%2Frepository%2Fdocker%2Fvirtualpatientengine%2Ftalk2biomodels%2Fgeneral)
8
8
 
9
-
10
9
  ## Introduction
11
10
 
12
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.
@@ -46,8 +45,8 @@ _Please note that this option is currently available only for Talk2Biomodels._
46
45
  ```
47
46
  docker run -e OPENAI_API_KEY=<openai_api_key> -e NVIDIA_API_KEY=<nvidia_api_key> -p 8501:8501 virtualpatientengine/talk2biomodels
48
47
  ```
49
- _You can create a free account at NVIDIA and apply for their
50
- free credits [here](https://build.nvidia.com/explore/discover)._
48
+ _You can create a free account at NVIDIA and apply for their
49
+ free credits [here](https://build.nvidia.com/explore/discover)._
51
50
 
52
51
  #### Option 3: git
53
52
 
@@ -61,31 +60,43 @@ free credits [here](https://build.nvidia.com/explore/discover)._
61
60
  pip install -r requirements.txt
62
61
  ```
63
62
  3. **Initialize OPENAI_API_KEY and NVIDIA_API_KEY**
63
+
64
64
  ```bash
65
65
  export OPENAI_API_KEY=....
66
66
  ```
67
+
67
68
  ```bash
68
69
  export NVIDIA_API_KEY=....
69
70
  ```
70
- _You can create a free account at NVIDIA and apply for their
71
- free credits [here](https://build.nvidia.com/explore/discover)._
72
71
 
73
- 4. **[Optional] Initialize LANGSMITH_API_KEY**
72
+ _You can create a free account at NVIDIA and apply for their
73
+ free credits [here](https://build.nvidia.com/explore/discover)._
74
+
75
+ 4. **Initialize ZOTERO_API_KEY and ZOTERO_USER_ID**
76
+
77
+ ```bash
78
+ export ZOTERO_API_KEY=....
79
+ export ZOTERO_USER_ID=....
80
+ ```
81
+
82
+ 5. **[Optional] Initialize LANGSMITH_API_KEY**
83
+
74
84
  ```bash
75
85
  export LANGCHAIN_TRACING_V2=true
76
86
  export LANGCHAIN_API_KEY=<your-api-key>
77
87
  ```
78
- _Please note that this will create a new tracing project in your Langsmith
79
- account with the name `T2X-xxxx`, where `X` can be `B` (Biomodels), `S` (Scholars),
80
- `KG` (KnowledgeGraphs), or `C` (Cells). If you skip the previous step, it will
81
- default to the name `default`. `xxxx` will be the 4-digit ID created for the
82
- session._
83
88
 
84
- 5. **Launch the app:**
89
+ _Please note that this will create a new tracing project in your Langsmith
90
+ account with the name `T2X-xxxx`, where `X` can be `B` (Biomodels), `S` (Scholars),
91
+ `KG` (KnowledgeGraphs), or `C` (Cells). If you skip the previous step, it will
92
+ default to the name `default`. `xxxx` will be the 4-digit ID created for the
93
+ session._
94
+
95
+ 6. **Launch the app:**
85
96
  ```bash
86
97
  streamlit run app/frontend/streamlit_app_<agent>.py
87
98
  ```
88
- _Replace <agent> with the agent name you are interested to launch._
99
+ _Replace <agent> with the agent name you are interested to launch._
89
100
 
90
101
  For detailed instructions on each agent, please refer to their respective modules.
91
102
 
@@ -1,6 +1,7 @@
1
- '''
1
+ """
2
2
  This file is used to import all the modules in the package.
3
- '''
3
+ """
4
4
 
5
5
  from . import main_agent
6
6
  from . import s2_agent
7
+ from . import zotero_agent
@@ -19,6 +19,7 @@ from langgraph.checkpoint.memory import MemorySaver
19
19
  from langgraph.graph import END, START, StateGraph
20
20
  from langgraph.types import Command
21
21
  from ..agents import s2_agent
22
+ from ..agents import zotero_agent
22
23
  from ..state.state_talk2scholars import Talk2Scholars
23
24
 
24
25
  # Configure logging
@@ -49,7 +50,7 @@ def make_supervisor_node(llm_model: BaseChatModel, thread_id: str) -> Callable:
49
50
 
50
51
  This function initializes the routing logic by leveraging the system and router prompts defined
51
52
  in the Hydra configuration. The supervisor determines whether to
52
- call a sub-agent (like `s2_agent`)
53
+ call a sub-agent (like `s2_agent`, `zotero_agent`)
53
54
  or directly generate a response using the language model.
54
55
 
55
56
  Args:
@@ -62,12 +63,12 @@ def make_supervisor_node(llm_model: BaseChatModel, thread_id: str) -> Callable:
62
63
  """
63
64
  cfg = get_hydra_config()
64
65
  logger.info("Hydra configuration for Talk2Scholars main agent loaded: %s", cfg)
65
- members = ["s2_agent"]
66
+ members = ["s2_agent", "zotero_agent"]
66
67
  options = ["FINISH"] + members
67
68
  # Define system prompt for general interactions
68
69
  system_prompt = cfg.system_prompt
69
70
  # Define router prompt for routing to sub-agents
70
- router_prompt = cfg.router_prompt
71
+ router_prompt = cfg.router_prompt + " " + " ".join(members)
71
72
 
72
73
  class Router(BaseModel):
73
74
  """Worker to route to next. If no workers needed, route to FINISH."""
@@ -90,7 +91,7 @@ def make_supervisor_node(llm_model: BaseChatModel, thread_id: str) -> Callable:
90
91
  Returns:
91
92
  Command: A command dictating whether to invoke a sub-agent or generate a final response.
92
93
  """
93
- messages = [SystemMessage(content=router_prompt)] + state["messages"]
94
+ messages = [SystemMessage(content=router_prompt)] + list(state["messages"])
94
95
  structured_llm = llm_model.with_structured_output(Router)
95
96
  response = structured_llm.invoke(messages)
96
97
  goto = response.next
@@ -189,6 +190,51 @@ def get_app(
189
190
  goto="supervisor",
190
191
  )
191
192
 
193
+ def call_zotero_agent(
194
+ state: Talk2Scholars,
195
+ ) -> Command[Literal["supervisor"]]:
196
+ """
197
+ Invokes the Zotero agent to retrieve and process papers from the user's Zotero library.
198
+
199
+ This function calls the Zotero agent, which interacts with the user's Zotero database
200
+ to retrieve relevant papers based on the conversation context. It updates the
201
+ conversation state with the retrieved papers and relevant metadata.
202
+
203
+ Args:
204
+ state (Talk2Scholars): The current conversation state, containing user messages
205
+ and any previously retrieved Zotero data.
206
+
207
+ Returns:
208
+ Command: A command that updates the conversation state with retrieved Zotero
209
+ papers and metadata before returning control to the supervisor node.
210
+
211
+ Example:
212
+ >>> result = call_zotero_agent(current_state)
213
+ >>> next_step = result.goto
214
+ """
215
+ logger.info("Calling Zotero agent")
216
+ app = zotero_agent.get_app(thread_id, llm_model)
217
+ # Invoke the Zotero agent, passing state
218
+ response = app.invoke(
219
+ state,
220
+ {
221
+ "configurable": {
222
+ "config_id": thread_id,
223
+ "thread_id": thread_id,
224
+ }
225
+ },
226
+ )
227
+ logger.info("Zotero agent completed with response")
228
+ return Command(
229
+ update={
230
+ "messages": response["messages"],
231
+ "zotero_read": response.get("zotero_read", {}),
232
+ "last_displayed_papers": response.get("last_displayed_papers", {}),
233
+ },
234
+ # Always return to supervisor
235
+ goto="supervisor",
236
+ )
237
+
192
238
  # Initialize LLM
193
239
  logger.info("Using model %s with temperature %s", llm_model, cfg.temperature)
194
240
 
@@ -198,6 +244,7 @@ def get_app(
198
244
  # Add nodes
199
245
  workflow.add_node("supervisor", supervisor)
200
246
  workflow.add_node("s2_agent", call_s2_agent)
247
+ workflow.add_node("zotero_agent", call_zotero_agent)
201
248
  # Add edges
202
249
  workflow.add_edge(START, "supervisor")
203
250
  # Compile the workflow
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env python3
2
+
3
+ """
4
+ Agent for interacting with Zotero
5
+ """
6
+
7
+ import logging
8
+ from typing import Any, Dict
9
+ import hydra
10
+ from langchain_openai import ChatOpenAI
11
+ from langchain_core.language_models.chat_models import BaseChatModel
12
+ from langgraph.graph import START, StateGraph
13
+ from langgraph.prebuilt import create_react_agent, ToolNode
14
+ from langgraph.checkpoint.memory import MemorySaver
15
+ from ..state.state_talk2scholars import Talk2Scholars
16
+ from ..tools.zotero.zotero_read import zotero_search_tool
17
+ from ..tools.s2.display_results import display_results as s2_display
18
+ from ..tools.s2.query_results import query_results as s2_query_results
19
+ from ..tools.s2.retrieve_semantic_scholar_paper_id import (
20
+ retrieve_semantic_scholar_paper_id,
21
+ )
22
+
23
+ # Initialize logger
24
+ logging.basicConfig(level=logging.INFO)
25
+ logger = logging.getLogger(__name__)
26
+
27
+
28
+ def get_app(
29
+ uniq_id, llm_model: BaseChatModel = ChatOpenAI(model="gpt-4o-mini", temperature=0)
30
+ ):
31
+ """
32
+ Initializes and returns the LangGraph application for the Zotero agent.
33
+
34
+ This function sets up the Zotero agent, which integrates various tools to search,
35
+ retrieve, and display research papers from Zotero. The agent follows the ReAct
36
+ pattern for structured interaction.
37
+
38
+ Args:
39
+ uniq_id (str): Unique identifier for the current conversation session.
40
+ llm_model (BaseChatModel, optional): The language model to be used by the agent.
41
+ Defaults to `ChatOpenAI(model="gpt-4o-mini", temperature=0)`.
42
+
43
+ Returns:
44
+ StateGraph: A compiled LangGraph application that enables the Zotero agent to
45
+ process user queries and retrieve research papers.
46
+
47
+ Example:
48
+ >>> app = get_app("thread_123")
49
+ >>> result = app.invoke(initial_state)
50
+ """
51
+
52
+ def agent_zotero_node(state: Talk2Scholars) -> Dict[str, Any]:
53
+ """
54
+ Processes the user query and retrieves relevant research papers from Zotero.
55
+
56
+ This function calls the language model using the configured `ReAct` agent to
57
+ analyze the state and generate an appropriate response. The function then
58
+ returns control to the main supervisor.
59
+
60
+ Args:
61
+ state (Talk2Scholars): The current conversation state, including messages exchanged
62
+ and any previously retrieved research papers.
63
+
64
+ Returns:
65
+ Dict[str, Any]: A dictionary containing the updated conversation state.
66
+
67
+ Example:
68
+ >>> result = agent_zotero_node(current_state)
69
+ >>> papers = result.get("papers", [])
70
+ """
71
+ logger.log(
72
+ logging.INFO, "Creating Agent_Zotero node with thread_id %s", uniq_id
73
+ )
74
+ result = model.invoke(state, {"configurable": {"thread_id": uniq_id}})
75
+
76
+ return result
77
+
78
+ # Load hydra configuration
79
+ logger.log(logging.INFO, "Load Hydra configuration for Talk2Scholars Zotero agent.")
80
+ with hydra.initialize(version_base=None, config_path="../configs"):
81
+ cfg = hydra.compose(
82
+ config_name="config",
83
+ overrides=["agents/talk2scholars/zotero_agent=default"],
84
+ )
85
+ cfg = cfg.agents.talk2scholars.zotero_agent
86
+
87
+ # Define the tools
88
+ tools = ToolNode(
89
+ [
90
+ zotero_search_tool,
91
+ s2_display,
92
+ s2_query_results,
93
+ retrieve_semantic_scholar_paper_id,
94
+ ]
95
+ )
96
+
97
+ # Define the model
98
+ logger.log(logging.INFO, "Using model %s", llm_model)
99
+
100
+ # Create the agent
101
+ model = create_react_agent(
102
+ llm_model,
103
+ tools=tools,
104
+ state_schema=Talk2Scholars,
105
+ state_modifier=cfg.zotero_agent,
106
+ checkpointer=MemorySaver(),
107
+ )
108
+
109
+ workflow = StateGraph(Talk2Scholars)
110
+ workflow.add_node("agent_zotero", agent_zotero_node)
111
+ workflow.add_edge(START, "agent_zotero")
112
+
113
+ # Initialize memory to persist state between graph runs
114
+ checkpointer = MemorySaver()
115
+
116
+ # Compile the graph
117
+ app = workflow.compile(checkpointer=checkpointer)
118
+ logger.log(logging.INFO, "Compiled the graph")
119
+
120
+ return app
@@ -4,3 +4,4 @@ Import all the modules in the package
4
4
 
5
5
  from . import s2_agent
6
6
  from . import main_agent
7
+ from . import zotero_agent
@@ -0,0 +1,59 @@
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
+ system_prompt: >
9
+ You are the Talk2Scholars agent coordinating academic paper discovery and analysis.
10
+
11
+ You have access to the following agents:
12
+ 1. S2_agent: This agent can be used to search and recommend papers
13
+ from Semantic Scholar. Use this agent when the user asks for
14
+ general paper searches and recommendations.
15
+ 2. Zotero_agent: This agent can be used to retrieve, display, and query
16
+ papers from the Zotero library. Use this agent only when the user
17
+ explicitly asks for papers from Zotero.
18
+
19
+ router_prompt: >
20
+ You are a supervisor tasked with managing a conversation between the
21
+ following workers/members: ["s2_agent", "zotero_agent"] Given the user request, respond with the
22
+ worker to act next. Each worker will perform a task and respond with
23
+ their results and status. When finished, respond with FINISH.
24
+
25
+ Here is a description of the workers:
26
+ 1. S2_agent: This agent can be used to search and recommend papers
27
+ from Semantic Scholar. Use this agent when the user asks for
28
+ general paper searches and recommendations. This agent can also
29
+ retrieve the Semantic Scholar ID of a paper. It can also be used to
30
+ provide more information about a paper.
31
+ 2. Zotero_agent: This agent can be used to retrieve, display, and query
32
+ papers from the Zotero library. Use this agent only when the user
33
+ explicitly asks for papers from Zotero. This agent can also
34
+ retrieve the Semantic Scholar ID of a paper.
35
+
36
+ CRITICAL RULES:
37
+ 1. Do not generate any content or modify worker outputs
38
+ 2. Route to FINISH ONLY when a worker has COMPLETELY finished their task
39
+ 3. For the S2_agent and zotero_agent, ensure it has both SEARCHED and DISPLAYED results before FINISH
40
+
41
+ Available workers: members
42
+
43
+ Worker descriptions:
44
+ 1. S2_agent: Routes to this agent ONLY for:
45
+ - Initial paper searches
46
+ - Getting paper recommendations
47
+ - Retrieving paper IDs based on the title of a paper
48
+ - Displaying search/recommendation results
49
+ - Query over papers
50
+ 2. Zotero_agent: Routes to this agent ONLY for:
51
+ - Paper/journals searches from Zotero library
52
+ - Displaying search results
53
+ - Retrieving paper IDs based on the title of a paper
54
+ - Query over papers
55
+
56
+ Respond with FINISH when and ONLY when:
57
+ 1. A worker has COMPLETELY finished their task (including display)
58
+ 2. The results have been displayed to the user using display_results
59
+ 3. No further action is needed
@@ -0,0 +1,42 @@
1
+ _target_: agents.s2_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
+ s2_agent: >
9
+ You are an academic research assistant with access to the
10
+ Semantic Scholar API for paper discovery and analysis.
11
+
12
+ AVAILABLE TOOLS:
13
+ 1. search_tool - Search for academic papers by query string
14
+ 2. display_results - Display the papers retrieved by other tools
15
+ 3. single_paper_rec - Get recommendations based on a SINGLE paper
16
+ 4. multi_paper_rec - Get recommendations based on MULTIPLE papers
17
+ 5. query_results - Ask questions about the current set of papers
18
+ 6. retrieve_semantic_scholar_paper_id - Get Semantic Scholar ID for a paper title
19
+
20
+ You also have tools to gain more insights on the papers and
21
+ display them.
22
+ You must strictly rely on retrieved information and avoid
23
+ generating unsupported content. Do not generate hallucinations
24
+ or fabricate details of any article. Stay focused on accurate,
25
+ sourced academic insights.
26
+
27
+ CRITICAL INSTRUCTIONS:
28
+ 1. You must ONLY use information retrieved directly from the API
29
+ 2. NEVER generate or fabricate paper details
30
+ 3. NEVER modify or enhance the API responses
31
+ 4. If information is missing from the API response, state that it's not available
32
+ 5. ALWAYS CALL THE DISPLAY_RESULTS TOOL after completing a search
33
+
34
+ WORKFLOW STEPS (ALWAYS FOLLOW THIS EXACT SEQUENCE):
35
+ 1. When user requests papers, use search/recommendation tools to find papers
36
+ 2. IMMEDIATELY AFTER `search_tool`, `single_paper_rec`, `multi_paper_rec` completes, ALWAYS call display_results tool
37
+ 3. Use `query_results` tool to query over the selected paper only when the user asks to
38
+ 4. NEVER skip the display_results step - it is REQUIRED for showing results to the user
39
+ 5. Do not try to analyze or summarize papers yourself
40
+
41
+ Remember: The display_results tool is MANDATORY after every search -
42
+ without it, users cannot see the search results.
@@ -0,0 +1,35 @@
1
+ target: agents.zotero_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
+ zotero_agent: >
9
+ You are a specialized Zotero library agent with access to tools for paper retrieval and management.
10
+
11
+ AVAILABLE TOOLS:
12
+ 1. zotero_search_tool - Search and retrieve papers from Zotero library
13
+ 2. display_results - Display the papers retrieved by other tools
14
+ 3. query_results - Ask questions about the current set of papers
15
+ 4. retrieve_semantic_scholar_paper_id - Get Semantic Scholar ID for a paper title for the papers from zotero library
16
+
17
+ You also have tools to gain more insights on the papers and display them.
18
+ You must strictly rely on retrieved information and avoid generating unsupported content. Do not generate hallucinations or fabricate details of any article. Stay focused on accurate, sourced academic insights.
19
+
20
+ CRITICAL INSTRUCTIONS:
21
+ 1. You must ONLY use information retrieved directly from the Zotero Library
22
+ 2. NEVER generate or fabricate paper details
23
+ 3. NEVER modify or enhance the responses
24
+ 4. If information is missing from the response, state that it's not available
25
+ 5. ALWAYS CALL THE DISPLAY_RESULTS TOOL after completing a search
26
+
27
+ WORKFLOW STEPS (ALWAYS FOLLOW THIS EXACT SEQUENCE):
28
+ 1. When user requests papers, use `zotero_search_tool` to find papers
29
+ 2. IMMEDIATELY AFTER `zotero_search_tool` completes, ALWAYS call display_results tool
30
+ 3. Use `query_results` tool to query over the selected paper only when the user asks to
31
+ 4. Use `retrieve_semantic_scholar_paper_id` to get the semantic scholar id of a paper title for the papers from zotero library
32
+ 5. NEVER skip the display_results step - it is REQUIRED for showing results to the user
33
+ 6. Do not try to analyze or summarize papers yourself
34
+
35
+ Remember: The display_results tool is MANDATORY after every search - without it, users cannot see the search results.
@@ -2,8 +2,10 @@ defaults:
2
2
  - _self_
3
3
  - agents/talk2scholars/main_agent: default
4
4
  - agents/talk2scholars/s2_agent: default
5
+ - agents/talk2scholars/zotero_agent: default
6
+ - app/frontend: default
5
7
  - tools/search: default
6
8
  - tools/single_paper_recommendation: default
7
9
  - tools/multi_paper_recommendation: default
8
10
  - tools/retrieve_semantic_scholar_paper_id: default
9
- - app/frontend: default
11
+ - tools/zotero_read: default
@@ -5,3 +5,4 @@ Import all the modules in the package
5
5
  from . import search
6
6
  from . import single_paper_recommendation
7
7
  from . import multi_paper_recommendation
8
+ from . import zotero_read
@@ -0,0 +1,3 @@
1
+ """
2
+ Import all the modules in the package
3
+ """
@@ -0,0 +1,3 @@
1
+ """
2
+ Import all the modules in the package
3
+ """
@@ -0,0 +1,15 @@
1
+ # Default configuration for Zotero search tool
2
+ library_type: "user" # Type of library ('user' or 'group')
3
+ default_limit: 2
4
+ request_timeout: 10
5
+ user_id: ${oc.env:ZOTERO_USER_ID} # Load from environment variable
6
+ api_key: ${oc.env:ZOTERO_API_KEY} # Load from environment variable
7
+
8
+ # Default search parameters
9
+ search_params:
10
+ limit: ${.default_limit}
11
+
12
+ # Item Types and Limit
13
+ zotero:
14
+ max_limit: 100
15
+ filter_item_types: ["journalArticle", "conferencePaper", "preprint"]
@@ -52,6 +52,7 @@ class Talk2Scholars(AgentState):
52
52
  last_displayed_papers (Dict[str, Any]): Stores the most recently displayed papers.
53
53
  papers (Dict[str, Any]): Stores the research papers retrieved from the agent's queries.
54
54
  multi_papers (Dict[str, Any]): Stores multiple recommended papers from various sources.
55
+ zotero_read (Dict[str, Any]): Stores the papers retrieved from Zotero.
55
56
  llm_model (BaseChatModel): The language model instance used for generating responses.
56
57
  """
57
58
 
@@ -59,4 +60,5 @@ class Talk2Scholars(AgentState):
59
60
  last_displayed_papers: Annotated[Dict[str, Any], replace_dict]
60
61
  papers: Annotated[Dict[str, Any], replace_dict]
61
62
  multi_papers: Annotated[Dict[str, Any], replace_dict]
63
+ zotero_read: Annotated[Dict[str, Any], replace_dict]
62
64
  llm_model: BaseChatModel