aiagents4pharma 1.9.0__tar.gz → 1.10.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.
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/PKG-INFO +37 -18
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/README.md +35 -16
- aiagents4pharma-1.10.0/aiagents4pharma/__init__.py +11 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/__init__.py +5 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/agents/__init__.py +6 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/agents/main_agent.py +130 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/agents/s2_agent.py +75 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/config/__init__.py +5 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/config/config.py +110 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/state/__init__.py +5 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/state/state_talk2competitors.py +32 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tests/__init__.py +3 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tests/test_langgraph.py +274 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tools/__init__.py +7 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tools/s2/__init__.py +8 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tools/s2/display_results.py +25 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tools/s2/multi_paper_rec.py +132 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tools/s2/search.py +119 -0
- aiagents4pharma-1.10.0/aiagents4pharma/talk2competitors/tools/s2/single_paper_rec.py +141 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma.egg-info/PKG-INFO +37 -18
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma.egg-info/SOURCES.txt +15 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/pyproject.toml +1 -1
- aiagents4pharma-1.10.0/release_version.txt +1 -0
- aiagents4pharma-1.9.0/aiagents4pharma/__init__.py +0 -8
- aiagents4pharma-1.9.0/aiagents4pharma/talk2knowledgegraphs/utils/__init__.py +0 -0
- aiagents4pharma-1.9.0/release_version.txt +0 -1
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/LICENSE +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/configs/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/configs/config.yaml +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/configs/talk2biomodels/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/configs/talk2biomodels/agents/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/configs/talk2biomodels/agents/t2b_agent/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/configs/talk2biomodels/agents/t2b_agent/default.yaml +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/agents/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/agents/t2b_agent.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/models/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/models/basico_model.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/models/sys_bio_model.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/states/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/states/state_talk2biomodels.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tests/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tests/test_basico_model.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tests/test_langgraph.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tests/test_sys_bio_model.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tools/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tools/ask_question.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tools/custom_plotter.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tools/get_modelinfo.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tools/load_biomodel.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tools/search_models.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2biomodels/tools/simulate_model.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/agents/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/agents/scp_agent.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/states/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/states/state_talk2cells.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/tests/scp_agent/test_scp_agent.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/tools/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/tools/scp_agent/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/tools/scp_agent/display_studies.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2cells/tools/scp_agent/search_studies.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/datasets/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/datasets/biobridge_primekg.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/datasets/dataset.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/datasets/primekg.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/datasets/starkqa_primekg.py +0 -0
- {aiagents4pharma-1.9.0/aiagents4pharma/talk2competitors → aiagents4pharma-1.10.0/aiagents4pharma/talk2knowledgegraphs/tests}/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_biobridge_primekg.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_dataset.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_primekg.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_starkqa_primekg.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_embeddings.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_huggingface.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_sentencetransformer.py +0 -0
- {aiagents4pharma-1.9.0/aiagents4pharma/talk2knowledgegraphs/tests → aiagents4pharma-1.10.0/aiagents4pharma/talk2knowledgegraphs/utils}/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/embeddings.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/huggingface.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/sentence_transformer.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma/talk2knowledgegraphs/utils/kg_utils.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma.egg-info/dependency_links.txt +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma.egg-info/requires.txt +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/aiagents4pharma.egg-info/top_level.txt +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.10.0}/setup.cfg +0 -0
@@ -1,11 +1,11 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: aiagents4pharma
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.10.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
|
7
7
|
Classifier: Operating System :: OS Independent
|
8
|
-
Requires-Python: >=3.
|
8
|
+
Requires-Python: >=3.12
|
9
9
|
Description-Content-Type: text/markdown
|
10
10
|
License-File: LICENSE
|
11
11
|
Requires-Dist: copasi_basico==0.78
|
@@ -48,6 +48,9 @@ Requires-Dist: streamlit-feedback
|
|
48
48
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2cells.yml)
|
49
49
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2knowledgegraphs.yml)
|
50
50
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2competitors.yml)
|
51
|
+

|
52
|
+

|
53
|
+
|
51
54
|
|
52
55
|
<h1 align="center" style="border-bottom: none;">🤖 AIAgents4Pharma</h1>
|
53
56
|
|
@@ -56,9 +59,9 @@ Welcome to **AIAgents4Pharma** – an open-source project by [Team VPE](https://
|
|
56
59
|
Our toolkit currently consists of three intelligent agents, each designed to simplify and enhance access to specialized data in biology:
|
57
60
|
|
58
61
|
- **Talk2BioModels**: Engage directly with mathematical models in systems biology.
|
59
|
-
- **Talk2Cells**
|
60
|
-
- **Talk2KnowledgeGraphs**
|
61
|
-
- **Talk2Competitors**
|
62
|
+
- **Talk2Cells** _(Work in progress)_: Query and analyze sequencing data with ease.
|
63
|
+
- **Talk2KnowledgeGraphs** _(Work in progress)_: Access and explore complex biological knowledge graphs for insightful data connections.
|
64
|
+
- **Talk2Competitors** _(Coming soon)_: Get recommendations for articles related to your choice. Download, query, and write/retrieve them to your reference manager (currently supporting Zotero).
|
62
65
|
|
63
66
|
---
|
64
67
|
|
@@ -72,15 +75,15 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
72
75
|
- Adjust parameters within the model to simulate different conditions.
|
73
76
|
- Query simulation results.
|
74
77
|
|
75
|
-
### 2. Talk2Cells
|
78
|
+
### 2. Talk2Cells _(Work in Progress)_
|
76
79
|
|
77
80
|
**Talk2Cells** is being developed to provide direct access to and analysis of sequencing data, such as RNA-Seq or DNA-Seq, using natural language.
|
78
81
|
|
79
|
-
### 3. Talk2KnowledgeGraphs
|
82
|
+
### 3. Talk2KnowledgeGraphs _(Work in Progress)_
|
80
83
|
|
81
84
|
**Talk2KnowledgeGraphs** is an agent designed to enable interaction with biological knowledge graphs (KGs). KGs integrate vast amounts of structured biological data into a format that highlights relationships between entities, such as proteins, genes, and diseases.
|
82
85
|
|
83
|
-
### 4.
|
86
|
+
### 4. Talk2Competitors _(Coming soon)_
|
84
87
|
|
85
88
|
## Getting Started
|
86
89
|
|
@@ -91,48 +94,60 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
91
94
|
- Required libraries specified in `requirements.txt`
|
92
95
|
|
93
96
|
### Installation
|
97
|
+
|
94
98
|
#### Option 1: PyPI
|
95
|
-
|
96
|
-
|
97
|
-
|
99
|
+
|
100
|
+
```bash
|
101
|
+
pip install aiagents4pharma
|
102
|
+
```
|
98
103
|
|
99
104
|
Check out the tutorials on each agent for detailed instrcutions.
|
100
105
|
|
101
106
|
#### Option 2: git
|
107
|
+
|
102
108
|
1. **Clone the repository:**
|
109
|
+
|
103
110
|
```bash
|
104
111
|
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
|
105
112
|
cd AIAgents4Pharma
|
106
113
|
```
|
107
114
|
|
108
115
|
2. **Install dependencies:**
|
116
|
+
|
109
117
|
```bash
|
110
118
|
pip install .
|
111
119
|
```
|
112
120
|
|
113
121
|
3. **Initialize OPENAI_API_KEY**
|
122
|
+
|
114
123
|
```bash
|
115
|
-
export OPENAI_API_KEY
|
124
|
+
export OPENAI_API_KEY=....
|
116
125
|
```
|
117
126
|
|
118
127
|
4. **[Optional] Set up login credentials**
|
128
|
+
|
119
129
|
```bash
|
120
130
|
vi .streamlit/secrets.toml
|
121
131
|
```
|
132
|
+
|
122
133
|
and enter
|
134
|
+
|
123
135
|
```
|
124
136
|
password='XXX'
|
125
137
|
```
|
126
|
-
|
138
|
+
|
139
|
+
Please note that the passoword will be same for all the users.
|
127
140
|
|
128
141
|
5. **[Optional] Initialize LANGSMITH_API_KEY**
|
142
|
+
|
129
143
|
```bash
|
130
144
|
export LANGCHAIN_TRACING_V2=true
|
131
145
|
export LANGCHAIN_API_KEY=<your-api-key>
|
132
146
|
```
|
133
|
-
|
134
|
-
|
135
|
-
|
147
|
+
|
148
|
+
Please note that this will create a new tracing project in your Langsmith
|
149
|
+
account with the name `<user_name>@<uuid>`, where `user_name` is the name
|
150
|
+
you provided in the previous step. If you skip the previous step, it will
|
136
151
|
default to `default`. <uuid> will be the 128 bit unique ID created for the
|
137
152
|
session.
|
138
153
|
|
@@ -164,6 +179,7 @@ We welcome contributions to AIAgents4Pharma! Here’s how you can help:
|
|
164
179
|
5. **Open a pull request**
|
165
180
|
|
166
181
|
### Current Needs
|
182
|
+
|
167
183
|
- **Beta testers** for Talk2BioModels.
|
168
184
|
- **Developers** with experience in natural language processing, bioinformatics, or knowledge graphs for contributions to AIAgents4Pharma.
|
169
185
|
|
@@ -174,19 +190,22 @@ Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
174
190
|
## Roadmap
|
175
191
|
|
176
192
|
### Completed
|
193
|
+
|
177
194
|
- **Talk2BioModels**: Initial release with core capabilities for interacting with systems biology models.
|
178
195
|
|
179
196
|
### Planned
|
197
|
+
|
180
198
|
- **User Interface**: Interactive web UI for all agents.
|
181
199
|
- **Talk2Cells**: Integration of sequencing data analysis tools.
|
182
200
|
- **Talk2KnowledgeGraphs**: Interface for biological knowledge graph interaction.
|
183
|
-
- **Talk2Competitors
|
201
|
+
- **Talk2Competitors**: Interface for exploring articles
|
184
202
|
|
185
|
-
We’re excited to bring AIAgents4Pharma to the bioinformatics and pharmaceutical research community. Together, let’s make data-driven biological research more accessible and insightful.
|
203
|
+
We’re excited to bring AIAgents4Pharma to the bioinformatics and pharmaceutical research community. Together, let’s make data-driven biological research more accessible and insightful.
|
186
204
|
|
187
205
|
**Get Started** with AIAgents4Pharma today and transform the way you interact with biological data.
|
188
206
|
|
189
207
|
---
|
190
208
|
|
191
209
|
## Feedback
|
210
|
+
|
192
211
|
Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use the `Isssues` tab 😀
|
@@ -2,6 +2,9 @@
|
|
2
2
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2cells.yml)
|
3
3
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2knowledgegraphs.yml)
|
4
4
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2competitors.yml)
|
5
|
+

|
6
|
+

|
7
|
+
|
5
8
|
|
6
9
|
<h1 align="center" style="border-bottom: none;">🤖 AIAgents4Pharma</h1>
|
7
10
|
|
@@ -10,9 +13,9 @@ Welcome to **AIAgents4Pharma** – an open-source project by [Team VPE](https://
|
|
10
13
|
Our toolkit currently consists of three intelligent agents, each designed to simplify and enhance access to specialized data in biology:
|
11
14
|
|
12
15
|
- **Talk2BioModels**: Engage directly with mathematical models in systems biology.
|
13
|
-
- **Talk2Cells**
|
14
|
-
- **Talk2KnowledgeGraphs**
|
15
|
-
- **Talk2Competitors**
|
16
|
+
- **Talk2Cells** _(Work in progress)_: Query and analyze sequencing data with ease.
|
17
|
+
- **Talk2KnowledgeGraphs** _(Work in progress)_: Access and explore complex biological knowledge graphs for insightful data connections.
|
18
|
+
- **Talk2Competitors** _(Coming soon)_: Get recommendations for articles related to your choice. Download, query, and write/retrieve them to your reference manager (currently supporting Zotero).
|
16
19
|
|
17
20
|
---
|
18
21
|
|
@@ -26,15 +29,15 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
26
29
|
- Adjust parameters within the model to simulate different conditions.
|
27
30
|
- Query simulation results.
|
28
31
|
|
29
|
-
### 2. Talk2Cells
|
32
|
+
### 2. Talk2Cells _(Work in Progress)_
|
30
33
|
|
31
34
|
**Talk2Cells** is being developed to provide direct access to and analysis of sequencing data, such as RNA-Seq or DNA-Seq, using natural language.
|
32
35
|
|
33
|
-
### 3. Talk2KnowledgeGraphs
|
36
|
+
### 3. Talk2KnowledgeGraphs _(Work in Progress)_
|
34
37
|
|
35
38
|
**Talk2KnowledgeGraphs** is an agent designed to enable interaction with biological knowledge graphs (KGs). KGs integrate vast amounts of structured biological data into a format that highlights relationships between entities, such as proteins, genes, and diseases.
|
36
39
|
|
37
|
-
### 4.
|
40
|
+
### 4. Talk2Competitors _(Coming soon)_
|
38
41
|
|
39
42
|
## Getting Started
|
40
43
|
|
@@ -45,48 +48,60 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
45
48
|
- Required libraries specified in `requirements.txt`
|
46
49
|
|
47
50
|
### Installation
|
51
|
+
|
48
52
|
#### Option 1: PyPI
|
49
|
-
|
50
|
-
|
51
|
-
|
53
|
+
|
54
|
+
```bash
|
55
|
+
pip install aiagents4pharma
|
56
|
+
```
|
52
57
|
|
53
58
|
Check out the tutorials on each agent for detailed instrcutions.
|
54
59
|
|
55
60
|
#### Option 2: git
|
61
|
+
|
56
62
|
1. **Clone the repository:**
|
63
|
+
|
57
64
|
```bash
|
58
65
|
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
|
59
66
|
cd AIAgents4Pharma
|
60
67
|
```
|
61
68
|
|
62
69
|
2. **Install dependencies:**
|
70
|
+
|
63
71
|
```bash
|
64
72
|
pip install .
|
65
73
|
```
|
66
74
|
|
67
75
|
3. **Initialize OPENAI_API_KEY**
|
76
|
+
|
68
77
|
```bash
|
69
|
-
export OPENAI_API_KEY
|
78
|
+
export OPENAI_API_KEY=....
|
70
79
|
```
|
71
80
|
|
72
81
|
4. **[Optional] Set up login credentials**
|
82
|
+
|
73
83
|
```bash
|
74
84
|
vi .streamlit/secrets.toml
|
75
85
|
```
|
86
|
+
|
76
87
|
and enter
|
88
|
+
|
77
89
|
```
|
78
90
|
password='XXX'
|
79
91
|
```
|
80
|
-
|
92
|
+
|
93
|
+
Please note that the passoword will be same for all the users.
|
81
94
|
|
82
95
|
5. **[Optional] Initialize LANGSMITH_API_KEY**
|
96
|
+
|
83
97
|
```bash
|
84
98
|
export LANGCHAIN_TRACING_V2=true
|
85
99
|
export LANGCHAIN_API_KEY=<your-api-key>
|
86
100
|
```
|
87
|
-
|
88
|
-
|
89
|
-
|
101
|
+
|
102
|
+
Please note that this will create a new tracing project in your Langsmith
|
103
|
+
account with the name `<user_name>@<uuid>`, where `user_name` is the name
|
104
|
+
you provided in the previous step. If you skip the previous step, it will
|
90
105
|
default to `default`. <uuid> will be the 128 bit unique ID created for the
|
91
106
|
session.
|
92
107
|
|
@@ -118,6 +133,7 @@ We welcome contributions to AIAgents4Pharma! Here’s how you can help:
|
|
118
133
|
5. **Open a pull request**
|
119
134
|
|
120
135
|
### Current Needs
|
136
|
+
|
121
137
|
- **Beta testers** for Talk2BioModels.
|
122
138
|
- **Developers** with experience in natural language processing, bioinformatics, or knowledge graphs for contributions to AIAgents4Pharma.
|
123
139
|
|
@@ -128,19 +144,22 @@ Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
128
144
|
## Roadmap
|
129
145
|
|
130
146
|
### Completed
|
147
|
+
|
131
148
|
- **Talk2BioModels**: Initial release with core capabilities for interacting with systems biology models.
|
132
149
|
|
133
150
|
### Planned
|
151
|
+
|
134
152
|
- **User Interface**: Interactive web UI for all agents.
|
135
153
|
- **Talk2Cells**: Integration of sequencing data analysis tools.
|
136
154
|
- **Talk2KnowledgeGraphs**: Interface for biological knowledge graph interaction.
|
137
|
-
- **Talk2Competitors
|
155
|
+
- **Talk2Competitors**: Interface for exploring articles
|
138
156
|
|
139
|
-
We’re excited to bring AIAgents4Pharma to the bioinformatics and pharmaceutical research community. Together, let’s make data-driven biological research more accessible and insightful.
|
157
|
+
We’re excited to bring AIAgents4Pharma to the bioinformatics and pharmaceutical research community. Together, let’s make data-driven biological research more accessible and insightful.
|
140
158
|
|
141
159
|
**Get Started** with AIAgents4Pharma today and transform the way you interact with biological data.
|
142
160
|
|
143
161
|
---
|
144
162
|
|
145
163
|
## Feedback
|
164
|
+
|
146
165
|
Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use the `Isssues` tab 😀
|
@@ -0,0 +1,130 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
|
3
|
+
"""
|
4
|
+
Main agent for the talk2competitors app.
|
5
|
+
"""
|
6
|
+
|
7
|
+
import logging
|
8
|
+
from typing import Literal
|
9
|
+
from dotenv import load_dotenv
|
10
|
+
from langchain_core.language_models.chat_models import BaseChatModel
|
11
|
+
from langchain_core.messages import AIMessage
|
12
|
+
from langchain_openai import ChatOpenAI
|
13
|
+
from langgraph.checkpoint.memory import MemorySaver
|
14
|
+
from langgraph.graph import END, START, StateGraph
|
15
|
+
from langgraph.types import Command
|
16
|
+
from ..agents import s2_agent
|
17
|
+
from ..config.config import config
|
18
|
+
from ..state.state_talk2competitors import Talk2Competitors
|
19
|
+
|
20
|
+
logging.basicConfig(level=logging.INFO)
|
21
|
+
logger = logging.getLogger(__name__)
|
22
|
+
|
23
|
+
load_dotenv()
|
24
|
+
|
25
|
+
def make_supervisor_node(llm: BaseChatModel) -> str:
|
26
|
+
"""
|
27
|
+
Creates a supervisor node following LangGraph patterns.
|
28
|
+
|
29
|
+
Args:
|
30
|
+
llm (BaseChatModel): The language model to use for generating responses.
|
31
|
+
|
32
|
+
Returns:
|
33
|
+
str: The supervisor node function.
|
34
|
+
"""
|
35
|
+
# options = ["FINISH", "s2_agent"]
|
36
|
+
|
37
|
+
def supervisor_node(state: Talk2Competitors) -> Command[Literal["s2_agent", "__end__"]]:
|
38
|
+
"""
|
39
|
+
Supervisor node that routes to appropriate sub-agents.
|
40
|
+
|
41
|
+
Args:
|
42
|
+
state (Talk2Competitors): The current state of the conversation.
|
43
|
+
|
44
|
+
Returns:
|
45
|
+
Command[Literal["s2_agent", "__end__"]]: The command to execute next.
|
46
|
+
"""
|
47
|
+
logger.info("Supervisor node called")
|
48
|
+
|
49
|
+
messages = [{"role": "system", "content": config.MAIN_AGENT_PROMPT}] + state[
|
50
|
+
"messages"
|
51
|
+
]
|
52
|
+
response = llm.invoke(messages)
|
53
|
+
goto = (
|
54
|
+
"FINISH"
|
55
|
+
if not any(
|
56
|
+
kw in state["messages"][-1].content.lower()
|
57
|
+
for kw in ["search", "paper", "find"]
|
58
|
+
)
|
59
|
+
else "s2_agent"
|
60
|
+
)
|
61
|
+
|
62
|
+
if goto == "FINISH":
|
63
|
+
return Command(
|
64
|
+
goto=END,
|
65
|
+
update={
|
66
|
+
"messages": state["messages"]
|
67
|
+
+ [AIMessage(content=response.content)],
|
68
|
+
"is_last_step": True,
|
69
|
+
"current_agent": None,
|
70
|
+
},
|
71
|
+
)
|
72
|
+
|
73
|
+
return Command(
|
74
|
+
goto="s2_agent",
|
75
|
+
update={
|
76
|
+
"messages": state["messages"],
|
77
|
+
"is_last_step": False,
|
78
|
+
"current_agent": "s2_agent",
|
79
|
+
},
|
80
|
+
)
|
81
|
+
|
82
|
+
return supervisor_node
|
83
|
+
|
84
|
+
def get_app(thread_id: str, llm_model ='gpt-4o-mini') -> StateGraph:
|
85
|
+
"""
|
86
|
+
Returns the langraph app with hierarchical structure.
|
87
|
+
|
88
|
+
Args:
|
89
|
+
thread_id (str): The thread ID for the conversation.
|
90
|
+
|
91
|
+
Returns:
|
92
|
+
The compiled langraph app.
|
93
|
+
"""
|
94
|
+
def call_s2_agent(state: Talk2Competitors) -> Command[Literal["__end__"]]:
|
95
|
+
"""
|
96
|
+
Node for calling the S2 agent.
|
97
|
+
|
98
|
+
Args:
|
99
|
+
state (Talk2Competitors): The current state of the conversation.
|
100
|
+
|
101
|
+
Returns:
|
102
|
+
Command[Literal["__end__"]]: The command to execute next.
|
103
|
+
"""
|
104
|
+
logger.info("Calling S2 agent")
|
105
|
+
app = s2_agent.get_app(thread_id, llm_model)
|
106
|
+
response = app.invoke(state)
|
107
|
+
logger.info("S2 agent completed")
|
108
|
+
return Command(
|
109
|
+
goto=END,
|
110
|
+
update={
|
111
|
+
"messages": response["messages"],
|
112
|
+
"papers": response.get("papers", []),
|
113
|
+
"is_last_step": True,
|
114
|
+
"current_agent": "s2_agent",
|
115
|
+
},
|
116
|
+
)
|
117
|
+
llm = ChatOpenAI(model=llm_model, temperature=0)
|
118
|
+
workflow = StateGraph(Talk2Competitors)
|
119
|
+
|
120
|
+
supervisor = make_supervisor_node(llm)
|
121
|
+
workflow.add_node("supervisor", supervisor)
|
122
|
+
workflow.add_node("s2_agent", call_s2_agent)
|
123
|
+
|
124
|
+
# Define edges
|
125
|
+
workflow.add_edge(START, "supervisor")
|
126
|
+
workflow.add_edge("s2_agent", END)
|
127
|
+
|
128
|
+
app = workflow.compile(checkpointer=MemorySaver())
|
129
|
+
logger.info("Main agent workflow compiled")
|
130
|
+
return app
|
@@ -0,0 +1,75 @@
|
|
1
|
+
#/usr/bin/env python3
|
2
|
+
|
3
|
+
'''
|
4
|
+
Agent for interacting with Semantic Scholar
|
5
|
+
'''
|
6
|
+
|
7
|
+
import logging
|
8
|
+
from dotenv import load_dotenv
|
9
|
+
from langchain_openai import ChatOpenAI
|
10
|
+
from langgraph.graph import START, StateGraph
|
11
|
+
from langgraph.prebuilt import create_react_agent
|
12
|
+
from langgraph.checkpoint.memory import MemorySaver
|
13
|
+
from ..config.config import config
|
14
|
+
from ..state.state_talk2competitors import Talk2Competitors
|
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
|
20
|
+
|
21
|
+
load_dotenv()
|
22
|
+
|
23
|
+
# Initialize logger
|
24
|
+
logging.basicConfig(level=logging.INFO)
|
25
|
+
logger = logging.getLogger(__name__)
|
26
|
+
|
27
|
+
def get_app(uniq_id, llm_model='gpt-4o-mini'):
|
28
|
+
'''
|
29
|
+
This function returns the langraph app.
|
30
|
+
'''
|
31
|
+
def agent_s2_node(state: Talk2Competitors):
|
32
|
+
'''
|
33
|
+
This function calls the model.
|
34
|
+
'''
|
35
|
+
logger.log(logging.INFO, "Creating Agent_S2 node with thread_id %s", uniq_id)
|
36
|
+
response = model.invoke(state, {"configurable": {"thread_id": uniq_id}})
|
37
|
+
return response
|
38
|
+
|
39
|
+
# Define the tools
|
40
|
+
tools = [search_tool,
|
41
|
+
display_results,
|
42
|
+
get_single_paper_recommendations,
|
43
|
+
get_multi_paper_recommendations]
|
44
|
+
|
45
|
+
# Create the LLM
|
46
|
+
llm = ChatOpenAI(model=llm_model, temperature=0)
|
47
|
+
model = create_react_agent(
|
48
|
+
llm,
|
49
|
+
tools=tools,
|
50
|
+
state_schema=Talk2Competitors,
|
51
|
+
state_modifier=config.S2_AGENT_PROMPT,
|
52
|
+
checkpointer=MemorySaver()
|
53
|
+
)
|
54
|
+
|
55
|
+
# Define a new graph
|
56
|
+
workflow = StateGraph(Talk2Competitors)
|
57
|
+
|
58
|
+
# Define the two nodes we will cycle between
|
59
|
+
workflow.add_node("agent_s2", agent_s2_node)
|
60
|
+
|
61
|
+
# Set the entrypoint as `agent`
|
62
|
+
# This means that this node is the first one called
|
63
|
+
workflow.add_edge(START, "agent_s2")
|
64
|
+
|
65
|
+
# Initialize memory to persist state between graph runs
|
66
|
+
checkpointer = MemorySaver()
|
67
|
+
|
68
|
+
# Finally, we compile it!
|
69
|
+
# This compiles it into a LangChain Runnable,
|
70
|
+
# meaning you can use it as you would any other runnable.
|
71
|
+
# Note that we're (optionally) passing the memory when compiling the graph
|
72
|
+
app = workflow.compile(checkpointer=checkpointer)
|
73
|
+
logger.log(logging.INFO, "Compiled the graph")
|
74
|
+
|
75
|
+
return app
|
@@ -0,0 +1,110 @@
|
|
1
|
+
"""Configuration module for AI agents handling paper searches and recommendations."""
|
2
|
+
|
3
|
+
|
4
|
+
# pylint: disable=R0903
|
5
|
+
class Config:
|
6
|
+
"""Configuration class containing prompts for AI agents.
|
7
|
+
|
8
|
+
This class stores prompt templates used by various AI agents in the system,
|
9
|
+
particularly for academic paper searches and recommendations.
|
10
|
+
"""
|
11
|
+
|
12
|
+
MAIN_AGENT_PROMPT = (
|
13
|
+
"You are a supervisory AI agent that routes user queries to specialized tools.\n"
|
14
|
+
"Your task is to select the most appropriate tool based on the user's request.\n\n"
|
15
|
+
"Available tools and their capabilities:\n\n"
|
16
|
+
"1. semantic_scholar_agent:\n"
|
17
|
+
" - Search for academic papers and research\n"
|
18
|
+
" - Get paper recommendations\n"
|
19
|
+
" - Find similar papers\n"
|
20
|
+
" USE FOR: Any queries about finding papers, academic research, "
|
21
|
+
"or getting paper recommendations\n\n"
|
22
|
+
"ROUTING GUIDELINES:\n\n"
|
23
|
+
"ALWAYS route to semantic_scholar_agent for:\n"
|
24
|
+
"- Finding academic papers\n"
|
25
|
+
"- Searching research topics\n"
|
26
|
+
"- Getting paper recommendations\n"
|
27
|
+
"- Finding similar papers\n"
|
28
|
+
"- Any query about academic literature\n\n"
|
29
|
+
"Approach:\n"
|
30
|
+
"1. Identify the core need in the user's query\n"
|
31
|
+
"2. Select the most appropriate tool based on the guidelines above\n"
|
32
|
+
"3. If unclear, ask for clarification\n"
|
33
|
+
"4. For multi-step tasks, focus on the immediate next step\n\n"
|
34
|
+
"Remember:\n"
|
35
|
+
"- Be decisive in your tool selection\n"
|
36
|
+
"- Focus on the immediate task\n"
|
37
|
+
"- Default to semantic_scholar_agent for any paper-finding tasks\n"
|
38
|
+
"- Ask for clarification if the request is ambiguous\n\n"
|
39
|
+
"When presenting paper search results, always use this exact format:\n\n"
|
40
|
+
"Remember to:\n"
|
41
|
+
"- Always remember to add the url\n"
|
42
|
+
"- Put URLs on the title line itself as markdown\n"
|
43
|
+
"- Maintain consistent spacing and formatting"
|
44
|
+
)
|
45
|
+
|
46
|
+
S2_AGENT_PROMPT = (
|
47
|
+
"You are a specialized academic research assistant with access to the following tools:\n\n"
|
48
|
+
"1. search_papers:\n"
|
49
|
+
" USE FOR: General paper searches\n"
|
50
|
+
" - Enhances search terms automatically\n"
|
51
|
+
" - Adds relevant academic keywords\n"
|
52
|
+
" - Focuses on recent research when appropriate\n\n"
|
53
|
+
"2. get_single_paper_recommendations:\n"
|
54
|
+
" USE FOR: Finding papers similar to a specific paper\n"
|
55
|
+
" - Takes a single paper ID\n"
|
56
|
+
" - Returns related papers\n\n"
|
57
|
+
"3. get_multi_paper_recommendations:\n"
|
58
|
+
" USE FOR: Finding papers similar to multiple papers\n"
|
59
|
+
" - Takes multiple paper IDs\n"
|
60
|
+
" - Finds papers related to all inputs\n\n"
|
61
|
+
"GUIDELINES:\n\n"
|
62
|
+
"For paper searches:\n"
|
63
|
+
"- Enhance search terms with academic language\n"
|
64
|
+
"- Include field-specific terminology\n"
|
65
|
+
'- Add "recent" or "latest" when appropriate\n'
|
66
|
+
"- Keep queries focused and relevant\n\n"
|
67
|
+
"For paper recommendations:\n"
|
68
|
+
"- Identify paper IDs (40-character hexadecimal strings)\n"
|
69
|
+
"- Use single_paper_recommendations for one ID\n"
|
70
|
+
"- Use multi_paper_recommendations for multiple IDs\n\n"
|
71
|
+
"Best practices:\n"
|
72
|
+
"1. Start with a broad search if no paper IDs are provided\n"
|
73
|
+
"2. Look for paper IDs in user input\n"
|
74
|
+
"3. Enhance search terms for better results\n"
|
75
|
+
"4. Consider the academic context\n"
|
76
|
+
"5. Be prepared to refine searches based on feedback\n\n"
|
77
|
+
"Remember:\n"
|
78
|
+
"- Always select the most appropriate tool\n"
|
79
|
+
"- Enhance search queries naturally\n"
|
80
|
+
"- Consider academic context\n"
|
81
|
+
"- Focus on delivering relevant results\n\n"
|
82
|
+
"IMPORTANT GUIDELINES FOR PAPER RECOMMENDATIONS:\n\n"
|
83
|
+
"For Multiple Papers:\n"
|
84
|
+
"- When getting recommendations for multiple papers, always use "
|
85
|
+
"get_multi_paper_recommendations tool\n"
|
86
|
+
"- DO NOT call get_single_paper_recommendations multiple times\n"
|
87
|
+
"- Always pass all paper IDs in a single call to get_multi_paper_recommendations\n"
|
88
|
+
'- Use for queries like "find papers related to both/all papers" or '
|
89
|
+
'"find similar papers to these papers"\n\n'
|
90
|
+
"For Single Paper:\n"
|
91
|
+
"- Use get_single_paper_recommendations when focusing on one specific paper\n"
|
92
|
+
"- Pass only one paper ID at a time\n"
|
93
|
+
'- Use for queries like "find papers similar to this paper" or '
|
94
|
+
'"get recommendations for paper X"\n'
|
95
|
+
"- Do not use for multiple papers\n\n"
|
96
|
+
"Examples:\n"
|
97
|
+
'- For "find related papers for both papers":\n'
|
98
|
+
" ✓ Use get_multi_paper_recommendations with both paper IDs\n"
|
99
|
+
" × Don't make multiple calls to get_single_paper_recommendations\n\n"
|
100
|
+
'- For "find papers related to the first paper":\n'
|
101
|
+
" ✓ Use get_single_paper_recommendations with just that paper's ID\n"
|
102
|
+
" × Don't use get_multi_paper_recommendations\n\n"
|
103
|
+
"Remember:\n"
|
104
|
+
"- Be precise in identifying which paper ID to use for single recommendations\n"
|
105
|
+
"- Don't reuse previous paper IDs unless specifically requested\n"
|
106
|
+
"- For fresh paper recommendations, always use the original paper ID"
|
107
|
+
)
|
108
|
+
|
109
|
+
|
110
|
+
config = Config()
|