|
a |
|
b/docs/index.md |
|
|
1 |
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2biomodels.yml) |
|
|
2 |
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2cells.yml) |
|
|
3 |
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2knowledgegraphs.yml) |
|
|
4 |
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2scholars.yml) |
|
|
5 |
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2aiagents4pharma.yml) |
|
|
6 |
 |
|
|
7 |
 |
|
|
8 |
 |
|
|
9 |
|
|
|
10 |
## Introduction |
|
|
11 |
|
|
|
12 |
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. |
|
|
13 |
|
|
|
14 |
Our toolkit currently consists of the following agents: |
|
|
15 |
|
|
|
16 |
- **Talk2BioModels** _(v1 released; v2 in progress)_: Engage directly with mathematical models in systems biology. |
|
|
17 |
- **Talk2KnowledgeGraphs** _(v1 in progress)_: Access and explore complex biological knowledge graphs for insightful data connections. |
|
|
18 |
- **Talk2Scholars** _(v1 in progress)_: Get recommendations for articles related to your choice. Download, query, and write/retrieve them to your reference manager (currently supporting Zotero). |
|
|
19 |
- **Talk2Cells** _(v1 in progress)_: Query and analyze sequencing data with ease. |
|
|
20 |
- **Talk2AIAgents4Pharma** _(v1 in progress)_: Converse with all the agents above (currently supports T2B and T2KG) |
|
|
21 |
|
|
|
22 |
 |
|
|
23 |
|
|
|
24 |
## Getting Started |
|
|
25 |
|
|
|
26 |
 |
|
|
27 |
|
|
|
28 |
### Installation |
|
|
29 |
|
|
|
30 |
_Please use version 1.26.2 or later for better support with NVIDIA NIM models._ |
|
|
31 |
|
|
|
32 |
#### Option 1: PyPI |
|
|
33 |
|
|
|
34 |
 |
|
|
35 |
|
|
|
36 |
```bash |
|
|
37 |
pip install aiagents4pharma |
|
|
38 |
``` |
|
|
39 |
|
|
|
40 |
Check out the tutorials on each agent for detailed instructions. |
|
|
41 |
|
|
|
42 |
#### Option 2: Docker Hub |
|
|
43 |
|
|
|
44 |
_We now have `Talk2AIAgents4Pharma`, `Talk2Biomodels`, and `Talk2Scholars` available on Docker Hub._ |
|
|
45 |
|
|
|
46 |
##### **Run Talk2AIAgents4Pharma and Talk2KnowledgeGraphs** |
|
|
47 |
|
|
|
48 |
Talk2AIAgents4Pharma and Talk2KnowledgeGraphs require Ollama for embedding models, so Docker Compose is used to run both containers in the same network. |
|
|
49 |
|
|
|
50 |
###### **Setup Environment Variables** |
|
|
51 |
|
|
|
52 |
1. Choose the app you want to use: |
|
|
53 |
|
|
|
54 |
```sh |
|
|
55 |
# Navigate to the correct directory before setting up environment variables. |
|
|
56 |
# Use one of the following commands based on the agent you want to use: |
|
|
57 |
cd AIAgents4Pharma/aiagents4pharma/talk2aiagents4pharma |
|
|
58 |
cd AIAgents4Pharma/aiagents4pharma/talk2knowledgegraphs |
|
|
59 |
``` |
|
|
60 |
|
|
|
61 |
2. Copy the `.env.example` file and rename it to `.env`: |
|
|
62 |
```sh |
|
|
63 |
cp .env.example .env |
|
|
64 |
``` |
|
|
65 |
3. Open the `.env` file and add your API keys: |
|
|
66 |
|
|
|
67 |
```plaintext |
|
|
68 |
OPENAI_API_KEY=your_openai_api_key |
|
|
69 |
NVIDIA_API_KEY=your_nvidia_api_key |
|
|
70 |
OLLAMA_HOST=http://ollama:11434 |
|
|
71 |
LANGCHAIN_TRACING_V2=true |
|
|
72 |
LANGCHAIN_API_KEY=your_langchain_api_key_here |
|
|
73 |
# Notes: |
|
|
74 |
# The API endpoint for Ollama is already set in env.example. |
|
|
75 |
# Both API keys (OPENAI_API_KEY and NVIDIA_API_KEY) are required for Talk2AIAgents4Pharma. |
|
|
76 |
# If using Talk2KnowledgeGraphs separately, only the OPENAI_API_KEY is needed. |
|
|
77 |
# Langsmith API for tracing is optional for both, set it in env.example if required. |
|
|
78 |
``` |
|
|
79 |
|
|
|
80 |
4. Save the file. |
|
|
81 |
|
|
|
82 |
To start the containers, run the following command: |
|
|
83 |
|
|
|
84 |
```sh |
|
|
85 |
docker compose --profile cpu up # for CPU mode |
|
|
86 |
docker compose --profile nvidia up # for GPU mode |
|
|
87 |
docker compose --profile amd up # for AMD mode |
|
|
88 |
``` |
|
|
89 |
|
|
|
90 |
This will: |
|
|
91 |
|
|
|
92 |
- Pull the latest images if they are not already available. |
|
|
93 |
- Start both Talk2AIAgents4Pharma or Talk2KnowledgeGraphs and Ollama containers in the same network. |
|
|
94 |
- Ensure Ollama is running first before launching Talk2AIAgents4Pharma or Talk2KnowledgeGraphs. |
|
|
95 |
|
|
|
96 |
To Access the web app, open your browser and go to: |
|
|
97 |
|
|
|
98 |
``` |
|
|
99 |
http://localhost:8501 |
|
|
100 |
``` |
|
|
101 |
|
|
|
102 |
To stop the containers, run: |
|
|
103 |
|
|
|
104 |
```sh |
|
|
105 |
docker compose down |
|
|
106 |
``` |
|
|
107 |
|
|
|
108 |
##### **Run Talk2Biomodels and Talk2Scholars** |
|
|
109 |
|
|
|
110 |
1. **Run the containers** |
|
|
111 |
|
|
|
112 |
```bash |
|
|
113 |
docker run -d \ |
|
|
114 |
--name talk2biomodels \ |
|
|
115 |
-e OPENAI_API_KEY=<your_openai_api_key> \ |
|
|
116 |
-e NVIDIA_API_KEY=<your_nvidia_api_key> \ |
|
|
117 |
-p 8501:8501 \ |
|
|
118 |
virtualpatientengine/talk2biomodels |
|
|
119 |
``` |
|
|
120 |
|
|
|
121 |
```bash |
|
|
122 |
docker run -d \ |
|
|
123 |
--name talk2scholars \ |
|
|
124 |
-e OPENAI_API_KEY=<your_openai_api_key> \ |
|
|
125 |
-e ZOTERO_API_KEY=<your_zotero_api_key> \ |
|
|
126 |
-e ZOTERO_USER_ID=<your_zotero_user_id> \ |
|
|
127 |
-p 8501:8501 \ |
|
|
128 |
virtualpatientengine/talk2scholars |
|
|
129 |
``` |
|
|
130 |
|
|
|
131 |
2. **Access the Web App** |
|
|
132 |
Open your browser and go to: |
|
|
133 |
|
|
|
134 |
``` |
|
|
135 |
http://localhost:8501 |
|
|
136 |
``` |
|
|
137 |
|
|
|
138 |
_You can create a free account at NVIDIA and apply for their |
|
|
139 |
free credits [here](https://build.nvidia.com/explore/discover)._ |
|
|
140 |
|
|
|
141 |
#### **Notes** |
|
|
142 |
|
|
|
143 |
- Ensure you **replace `<your_openai_api_key>`, `<your_nvidia_api_key>`, `<your_zotero_api_key>`, and `<your_zotero_user_id>`** with your actual credentials. |
|
|
144 |
- Both applications use **port `8501`**, so run them on different ports if needed: |
|
|
145 |
```bash |
|
|
146 |
docker run -d -e OPENAI_API_KEY=<your_openai_api_key> -p 8501:8501 virtualpatientengine/talk2scholars |
|
|
147 |
``` |
|
|
148 |
Then, access it via `http://localhost:8501`. |
|
|
149 |
|
|
|
150 |
#### Option 3: git |
|
|
151 |
|
|
|
152 |
 |
|
|
153 |
|
|
|
154 |
1. **Clone the repository:** |
|
|
155 |
```bash |
|
|
156 |
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma |
|
|
157 |
cd AIAgents4Pharma |
|
|
158 |
``` |
|
|
159 |
2. **Install dependencies:** |
|
|
160 |
|
|
|
161 |
```bash |
|
|
162 |
pip install -r requirements.txt |
|
|
163 |
``` |
|
|
164 |
|
|
|
165 |
⚠️ The current version of T2KG requires additional Ollama library to be installed. |
|
|
166 |
|
|
|
167 |
Ollama can be easily downloaded and installed from the following link: [https://ollama.com/download](https://ollama.com/download) |
|
|
168 |
|
|
|
169 |
As an alternative, use the following commands to install the library using terminal and to pull necessary model: |
|
|
170 |
|
|
|
171 |
- Ubuntu: |
|
|
172 |
``` |
|
|
173 |
curl -fsSL https://ollama.com/install.sh | sh |
|
|
174 |
ollama pull nomic-embed-text |
|
|
175 |
``` |
|
|
176 |
- Windows: |
|
|
177 |
``` |
|
|
178 |
curl -L https://ollama.com/download/ollama-windows-amd64.zip -o ollama-windows-amd64.zip |
|
|
179 |
tar -xzf .\ollama-windows-amd64.zip |
|
|
180 |
start ollama serve |
|
|
181 |
ollama pull nomic-embed-text |
|
|
182 |
``` |
|
|
183 |
- macOS: |
|
|
184 |
``` |
|
|
185 |
brew install ollama |
|
|
186 |
ollama pull nomic-embed-text |
|
|
187 |
``` |
|
|
188 |
A list of pulled Ollama models can be checked using the following command: |
|
|
189 |
|
|
|
190 |
``` |
|
|
191 |
ollama list |
|
|
192 |
``` |
|
|
193 |
|
|
|
194 |
⚠️ `pcst_fast 1.0.10` library requires `Microsoft Visual C++ 14.0` or greater to be installed. |
|
|
195 |
You can download `Microsoft C++ Build Tools` from [here](https://visualstudio.microsoft.com/visual-cpp-build-tools/). |
|
|
196 |
|
|
|
197 |
3. **Initialize OPENAI_API_KEY and NVIDIA_API_KEY** |
|
|
198 |
|
|
|
199 |
```bash |
|
|
200 |
export OPENAI_API_KEY=.... |
|
|
201 |
export NVIDIA_API_KEY=.... |
|
|
202 |
``` |
|
|
203 |
|
|
|
204 |
_You can create a free account at NVIDIA and apply for their |
|
|
205 |
free credits [here](https://build.nvidia.com/explore/discover)._ |
|
|
206 |
|
|
|
207 |
4. **Initialize ZOTERO_API_KEY and ZOTERO_USER_ID** |
|
|
208 |
|
|
|
209 |
```bash |
|
|
210 |
export ZOTERO_API_KEY=.... |
|
|
211 |
export ZOTERO_USER_ID=.... |
|
|
212 |
``` |
|
|
213 |
|
|
|
214 |
_Please note that ZOTERO keys are requried only if you want to launch Talk2Scholars. For all the other agents, please ignore this step._ |
|
|
215 |
|
|
|
216 |
5. **[Optional] Initialize LANGSMITH_API_KEY** |
|
|
217 |
|
|
|
218 |
```bash |
|
|
219 |
export LANGCHAIN_TRACING_V2=true |
|
|
220 |
export LANGCHAIN_API_KEY=<your-api-key> |
|
|
221 |
``` |
|
|
222 |
|
|
|
223 |
_Please note that this will create a new tracing project in your Langsmith |
|
|
224 |
account with the name `T2X-xxxx`, where `X` can be `AA4P` (Main Agent), |
|
|
225 |
`B` (Biomodels), `S` (Scholars), `KG` (KnowledgeGraphs), or `C` (Cells). |
|
|
226 |
If you skip the previous step, it will default to the name `default`. |
|
|
227 |
`xxxx` will be the 4-digit ID created for the session._ |
|
|
228 |
|
|
|
229 |
6. **Launch the app:** |
|
|
230 |
```bash |
|
|
231 |
streamlit run app/frontend/streamlit_app_<agent>.py |
|
|
232 |
``` |
|
|
233 |
_Replace <agent> with the agent name you are interested to launch._ |
|
|
234 |
|
|
|
235 |
For detailed instructions on each agent, please refer to their respective modules. |
|
|
236 |
|
|
|
237 |
--- |
|
|
238 |
|
|
|
239 |
## Contributing |
|
|
240 |
|
|
|
241 |
We welcome contributions to AIAgents4Pharma! Here’s how you can help: |
|
|
242 |
|
|
|
243 |
1. **Fork the repository** |
|
|
244 |
2. **Create a new branch** for your feature (`git checkout -b feat/feature-name`) |
|
|
245 |
3. **Commit your changes** (`git commit -m 'feat: Add new feature'`) |
|
|
246 |
4. **Push to the branch** (`git push origin feat/feature-name`) |
|
|
247 |
5. **Open a pull request** and reach out to any one of us below via Discussions: |
|
|
248 |
|
|
|
249 |
_Note: We welcome all contributions, not just programming-related ones. Feel free to open bug reports, suggest new features, or participate as a beta tester. Your support is greatly appreciated!_ |
|
|
250 |
|
|
|
251 |
- **Talk2Biomodels/Talk2Cells**: [@gurdeep330](https://github.com/gurdeep330) [@lilijap](https://github.com/lilijap) [@dmccloskey](https://github.com/dmccloskey) |
|
|
252 |
- **Talk2KnowledgeGraphs**: [@awmulyadi](https://github.com/awmulyadi) [@dmccloskey](https://github.com/dmccloskey) |
|
|
253 |
- **Talk2Scholars**: [@ansh-info](https://github.com/ansh-info) [@gurdeep330](https://github.com/gurdeep330) [@dmccloskey](https://github.com/dmccloskey) |
|
|
254 |
|
|
|
255 |
### Current Needs |
|
|
256 |
|
|
|
257 |
- **Beta testers** for Talk2BioModels and Talk2Scholars. |
|
|
258 |
- **Developers** with experience in Python and Bioinformatics and/or knowledge graphs for contributions to AIAgents4Pharma. |
|
|
259 |
|
|
|
260 |
Feel free to reach out to us via Discussions. |
|
|
261 |
|
|
|
262 |
Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information. |
|
|
263 |
|
|
|
264 |
--- |
|
|
265 |
|
|
|
266 |
## Feedback |
|
|
267 |
|
|
|
268 |
Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use `Issues` or `Discussions` 😀 |