aiagents4pharma 1.16.0__py3-none-any.whl → 1.17.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aiagents4pharma/__init__.py +0 -1
- aiagents4pharma/talk2biomodels/__init__.py +1 -0
- aiagents4pharma/talk2biomodels/agents/t2b_agent.py +3 -3
- aiagents4pharma/{configs/talk2biomodels → talk2biomodels/configs}/agents/t2b_agent/default.yaml +1 -1
- aiagents4pharma/{configs/talk2biomodels → talk2biomodels/configs}/tools/ask_question/default.yaml +1 -1
- aiagents4pharma/{configs/talk2biomodels → talk2biomodels/configs}/tools/get_annotation/default.yaml +1 -1
- aiagents4pharma/talk2biomodels/tools/ask_question.py +5 -4
- aiagents4pharma/talk2biomodels/tools/get_annotation.py +3 -3
- aiagents4pharma/talk2biomodels/tools/search_models.py +1 -1
- aiagents4pharma/talk2scholars/__init__.py +1 -1
- aiagents4pharma/talk2scholars/agents/main_agent.py +36 -15
- aiagents4pharma/talk2scholars/agents/s2_agent.py +38 -29
- aiagents4pharma/talk2scholars/{config → configs}/__init__.py +3 -1
- aiagents4pharma/{configs → talk2scholars/configs/agents}/__init__.py +3 -3
- aiagents4pharma/talk2scholars/configs/agents/talk2scholars/__init__.py +6 -0
- aiagents4pharma/talk2scholars/configs/agents/talk2scholars/main_agent/__init__.py +3 -0
- aiagents4pharma/talk2scholars/configs/agents/talk2scholars/main_agent/default.yaml +39 -0
- aiagents4pharma/talk2scholars/configs/agents/talk2scholars/s2_agent/__init__.py +3 -0
- aiagents4pharma/talk2scholars/configs/agents/talk2scholars/s2_agent/default.yaml +68 -0
- aiagents4pharma/talk2scholars/configs/app/__init__.py +5 -0
- aiagents4pharma/talk2scholars/configs/app/frontend/__init__.py +3 -0
- aiagents4pharma/talk2scholars/configs/app/frontend/default.yaml +33 -0
- aiagents4pharma/talk2scholars/configs/config.yaml +8 -0
- aiagents4pharma/talk2scholars/configs/tools/__init__.py +7 -0
- aiagents4pharma/talk2scholars/configs/tools/multi_paper_recommendation/__init__.py +3 -0
- aiagents4pharma/talk2scholars/configs/tools/multi_paper_recommendation/default.yaml +19 -0
- aiagents4pharma/talk2scholars/configs/tools/search/__init__.py +3 -0
- aiagents4pharma/talk2scholars/configs/tools/search/default.yaml +19 -0
- aiagents4pharma/talk2scholars/configs/tools/single_paper_recommendation/__init__.py +3 -0
- aiagents4pharma/talk2scholars/configs/tools/single_paper_recommendation/default.yaml +20 -0
- aiagents4pharma/talk2scholars/tests/test_langgraph.py +71 -54
- aiagents4pharma/talk2scholars/tools/s2/multi_paper_rec.py +13 -5
- aiagents4pharma/talk2scholars/tools/s2/search.py +9 -3
- aiagents4pharma/talk2scholars/tools/s2/single_paper_rec.py +13 -7
- aiagents4pharma-1.17.1.dist-info/METADATA +150 -0
- {aiagents4pharma-1.16.0.dist-info → aiagents4pharma-1.17.1.dist-info}/RECORD +45 -31
- aiagents4pharma/configs/config.yaml +0 -5
- aiagents4pharma/talk2scholars/config/config.py +0 -110
- aiagents4pharma-1.16.0.dist-info/METADATA +0 -212
- /aiagents4pharma/{configs/talk2biomodels → talk2biomodels/configs}/__init__.py +0 -0
- /aiagents4pharma/{configs/talk2biomodels → talk2biomodels/configs}/agents/__init__.py +0 -0
- /aiagents4pharma/{configs/talk2biomodels → talk2biomodels/configs}/agents/t2b_agent/__init__.py +0 -0
- /aiagents4pharma/{configs/talk2biomodels → talk2biomodels/configs}/tools/__init__.py +0 -0
- /aiagents4pharma/{configs/talk2biomodels → talk2biomodels/configs}/tools/ask_question/__init__.py +0 -0
- /aiagents4pharma/{configs/talk2biomodels → talk2biomodels/configs}/tools/get_annotation/__init__.py +0 -0
- {aiagents4pharma-1.16.0.dist-info → aiagents4pharma-1.17.1.dist-info}/LICENSE +0 -0
- {aiagents4pharma-1.16.0.dist-info → aiagents4pharma-1.17.1.dist-info}/WHEEL +0 -0
- {aiagents4pharma-1.16.0.dist-info → aiagents4pharma-1.17.1.dist-info}/top_level.txt +0 -0
@@ -1,110 +0,0 @@
|
|
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()
|
@@ -1,212 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.2
|
2
|
-
Name: aiagents4pharma
|
3
|
-
Version: 1.16.0
|
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
|
-
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2biomodels.yml)
|
51
|
-
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2cells.yml)
|
52
|
-
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2knowledgegraphs.yml)
|
53
|
-
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2scholars.yml)
|
54
|
-

|
55
|
-

|
56
|
-
|
57
|
-
<h1 align="center" style="border-bottom: none;">🤖 AIAgents4Pharma</h1>
|
58
|
-
|
59
|
-
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.
|
60
|
-
|
61
|
-
Our toolkit currently consists of three intelligent agents, each designed to simplify and enhance access to specialized data in biology:
|
62
|
-
|
63
|
-
- **Talk2BioModels**: Engage directly with mathematical models in systems biology.
|
64
|
-
- **Talk2Cells** _(Work in progress)_: Query and analyze sequencing data with ease.
|
65
|
-
- **Talk2KnowledgeGraphs** _(Work in progress)_: Access and explore complex biological knowledge graphs for insightful data connections.
|
66
|
-
- **Talk2Scholars** _(Coming soon)_: Get recommendations for articles related to your choice. Download, query, and write/retrieve them to your reference manager (currently supporting Zotero).
|
67
|
-
|
68
|
-
---
|
69
|
-
|
70
|
-
## Overview of Agents
|
71
|
-
|
72
|
-
### 1. Talk2BioModels
|
73
|
-
|
74
|
-
**Talk2BioModels** is an AI agent designed to facilitate interaction with mathematical models in systems biology. Systems biology models are critical in understanding complex biological mechanisms, but they’re often inaccessible to those without coding or mathematical expertise. Talk2BioModels simplifies this, enabling researchers to focus on analysis and interpretation rather than on programming. With Talk2BioModels, users can interact directly with these models through natural language. By simply asking questions or making requests, users can:
|
75
|
-
|
76
|
-
- Forward simulation of both internal and open-source models (BioModels).
|
77
|
-
- Adjust parameters within the model to simulate different conditions.
|
78
|
-
- Query simulation results.
|
79
|
-
- Extract model information such as species, parameters, units and description.
|
80
|
-
|
81
|
-
### 2. Talk2Cells _(Work in Progress)_
|
82
|
-
|
83
|
-
**Talk2Cells** is being developed to provide direct access to and analysis of sequencing data, such as RNA-Seq or DNA-Seq, using natural language.
|
84
|
-
|
85
|
-
### 3. Talk2KnowledgeGraphs _(Work in Progress)_
|
86
|
-
|
87
|
-
**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.
|
88
|
-
|
89
|
-
### 4. Talk2Scholars _(Work in Progress)_
|
90
|
-
|
91
|
-
Talk2Scholars is an AI-powered hierarchical agent system designed to revolutionize academic paper search and analysis. Through intelligent conversation, users can discover, analyze, and receive recommendations for academic papers using state-of-the-art natural language processing.
|
92
|
-
|
93
|
-
## Getting Started
|
94
|
-
|
95
|
-

|
96
|
-
|
97
|
-
### Installation
|
98
|
-
|
99
|
-
#### Option 1: PyPI
|
100
|
-
|
101
|
-
```bash
|
102
|
-
pip install aiagents4pharma
|
103
|
-
```
|
104
|
-
|
105
|
-
Check out the tutorials on each agent for detailed instrcutions.
|
106
|
-
|
107
|
-
#### Option 2: git
|
108
|
-
|
109
|
-
1. **Clone the repository:**
|
110
|
-
|
111
|
-
```bash
|
112
|
-
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
|
113
|
-
cd AIAgents4Pharma
|
114
|
-
```
|
115
|
-
|
116
|
-
2. **Install dependencies:**
|
117
|
-
|
118
|
-
```bash
|
119
|
-
pip install .
|
120
|
-
```
|
121
|
-
|
122
|
-
3. **Initialize OPENAI_API_KEY**
|
123
|
-
|
124
|
-
```bash
|
125
|
-
export OPENAI_API_KEY=....
|
126
|
-
```
|
127
|
-
|
128
|
-
4. **[Optional] Set up login credentials**
|
129
|
-
|
130
|
-
```bash
|
131
|
-
vi .streamlit/secrets.toml
|
132
|
-
```
|
133
|
-
|
134
|
-
and enter
|
135
|
-
|
136
|
-
```
|
137
|
-
password='XXX'
|
138
|
-
```
|
139
|
-
|
140
|
-
Please note that the passoword will be same for all the users.
|
141
|
-
|
142
|
-
5. **[Optional] Initialize LANGSMITH_API_KEY**
|
143
|
-
|
144
|
-
```bash
|
145
|
-
export LANGCHAIN_TRACING_V2=true
|
146
|
-
export LANGCHAIN_API_KEY=<your-api-key>
|
147
|
-
```
|
148
|
-
|
149
|
-
Please note that this will create a new tracing project in your Langsmith
|
150
|
-
account with the name `<user_name>@<uuid>`, where `user_name` is the name
|
151
|
-
you provided in the previous step. If you skip the previous step, it will
|
152
|
-
default to `default`. <uuid> will be the 128 bit unique ID created for the
|
153
|
-
session.
|
154
|
-
|
155
|
-
6. **Launch the app:**
|
156
|
-
```bash
|
157
|
-
streamlit run app/frontend/streamlit_app.py
|
158
|
-
```
|
159
|
-
|
160
|
-
For detailed instructions on each agent, please refer to their respective folders.
|
161
|
-
|
162
|
-
---
|
163
|
-
|
164
|
-
## Usage
|
165
|
-
|
166
|
-
**Talk2BioModels** currently provides an interactive console where you can enter natural language queries to simulate models, adjust parameters, and query the simulated results.
|
167
|
-
|
168
|
-
More detailed usage examples, including sample data for Talk2Cells and Talk2KnowledgeGraphs, will be provided as development progresses.
|
169
|
-
|
170
|
-
---
|
171
|
-
|
172
|
-
## Contributing
|
173
|
-
|
174
|
-
We welcome contributions to AIAgents4Pharma! Here’s how you can help:
|
175
|
-
|
176
|
-
1. **Fork the repository**
|
177
|
-
2. **Create a new branch** for your feature (`git checkout -b feat/feature-name`)
|
178
|
-
3. **Commit your changes** (`git commit -m 'feat: Add new feature'`)
|
179
|
-
4. **Push to the branch** (`git push origin feat/feature-name`)
|
180
|
-
5. **Open a pull request**
|
181
|
-
|
182
|
-
### Current Needs
|
183
|
-
|
184
|
-
- **Beta testers** for Talk2BioModels.
|
185
|
-
- **Developers** with experience in natural language processing, bioinformatics, or knowledge graphs for contributions to AIAgents4Pharma.
|
186
|
-
|
187
|
-
Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
188
|
-
|
189
|
-
---
|
190
|
-
|
191
|
-
## Roadmap
|
192
|
-
|
193
|
-
### Completed
|
194
|
-
|
195
|
-
- **Talk2BioModels**: Initial release with core capabilities for interacting with systems biology models.
|
196
|
-
|
197
|
-
### Planned
|
198
|
-
|
199
|
-
- **User Interface**: Interactive web UI for all agents.
|
200
|
-
- **Talk2Cells**: Integration of sequencing data analysis tools.
|
201
|
-
- **Talk2KnowledgeGraphs**: Interface for biological knowledge graph interaction.
|
202
|
-
- **Talk2Scholars**: Interface for exploring articles
|
203
|
-
|
204
|
-
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.
|
205
|
-
|
206
|
-
**Get Started** with AIAgents4Pharma today and transform the way you interact with biological data.
|
207
|
-
|
208
|
-
---
|
209
|
-
|
210
|
-
## Feedback
|
211
|
-
|
212
|
-
Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use the `Isssues` tab 😀
|
File without changes
|
File without changes
|
/aiagents4pharma/{configs/talk2biomodels → talk2biomodels/configs}/agents/t2b_agent/__init__.py
RENAMED
File without changes
|
File without changes
|
/aiagents4pharma/{configs/talk2biomodels → talk2biomodels/configs}/tools/ask_question/__init__.py
RENAMED
File without changes
|
/aiagents4pharma/{configs/talk2biomodels → talk2biomodels/configs}/tools/get_annotation/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|