MCPcopy Index your code
hub / github.com/VirtualPatientEngine/AIAgents4Pharma

github.com/VirtualPatientEngine/AIAgents4Pharma @v1.49.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.49.1 ↗ · + Follow
2,285 symbols 7,449 edges 292 files 1,891 documented · 83%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Virtual Patient Engine Logo

RELEASE Python Version from PEP 621 TOML

Pages Deployment MkDocs Deploy Release Docker Build & Push

TESTS Talk2AIAgents4Pharma Talk2BioModels Talk2KnowledgeGraphs TESTS Talk2Scholars Talk2Cells

Talk2AIAgents4Pharma Pulls Talk2BioModels Pulls Talk2KnowledgeGraphs Pulls Talk2Scholars Pulls

Introduction

Welcome to AIAgents4Pharma – an open-source project by Team VPE that brings together AI-driven tools to help researchers and pharma interact seamlessly with complex biological data.

Our toolkit currently consists of the following agents:

  • Talk2BioModels (v1 released; v2 in progress): Engage directly with mathematical models in systems biology.
  • Talk2KnowledgeGraphs (v1 in progress): Access and explore complex biological knowledge graphs for insightful data connections.
  • 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).
  • Talk2Cells (v1 in progress): Query and analyze sequencing data with ease.
  • Talk2AIAgents4Pharma (v1 in progress): Converse with all the agents above (currently supports T2B and T2KG)

AIAgents4Pharma

News

  • T2B and T2KG accepted at the MLGenX workshop during ICLR #2025 in Singapore. Read More

Watch the presentation:

Watch the presentation

Getting Started

Installation

Option 1: Docker (stable-release)

We now have all the agents available on Docker Hub.

Choose your agent below for detailed Docker instructions:

Option 2: git (for developers and contributors)

Python Version from PEP 621 TOML

  1. Clone the repository:
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma && cd AIAgents4Pharma
  1. Install dependencies:

We use uv for fast and reliable dependency management. Install uv first following the official installation guide.

For developers: See docs/developer/README.md for detailed setup instructions including system prerequisites.

uv sync --extra dev --frozen

💡 Recommended: Use --frozen flag to ensure exact reproducible builds using the pinned versions from uv.lock.

  1. Initialize API Keys
export OPENAI_API_KEY=....          # Required for all agents
export NVIDIA_API_KEY=....          # Required for all agents
export ZOTERO_API_KEY=....          # Required for T2S
export ZOTERO_USER_ID=....          # Required for T2S
export LANGCHAIN_TRACING_V2=true    # Optional for all agents
export LANGCHAIN_API_KEY=...        # Optional for all agents
  1. Launch the app:

System Dependency: libmagic (for secure uploads) For accurate file MIME-type detection used by our secure upload validation, install the libmagic system library. This is recommended across all providers (OpenAI, Azure OpenAI, NVIDIA) because it runs locally in the Streamlit apps.

  • Linux (Debian/Ubuntu): sudo apt-get install libmagic1
  • macOS (Homebrew): brew install libmagic
  • Windows: Use the python-magic/python-magic-bin package; libmagic is bundled If libmagic is not available, the apps fall back to extension-based detection. For best security, keep libmagic installed.

Option A: Using UV (recommended)

uv run streamlit run app/frontend/streamlit_app_<agent>.py

Option B: Traditional approach

# Activate virtual environment
source .venv/bin/activate  # Linux/macOS
# or
.venv\Scripts\activate     # Windows

# Then run the app
streamlit run app/frontend/streamlit_app_<agent>.py

Replace <agent> with the agent name you are interested to launch:

  • talk2aiagents4pharma
  • talk2biomodels
  • talk2knowledgegraphs
  • talk2scholars
  • talk2cells

If your machine has NVIDIA GPU(s), please install the following this:

  • nvidia-cuda-toolkit
  • nvidia-container-toolkit (required for GPU support with Docker; enables containers to access NVIDIA GPUs for accelerated computing). After installing nvidia-container-toolkit, please restart Docker to ensure GPU support is enabled.

To use the Agents, you need a free NVIDIA API key. Create an account and apply for free credits here.

Talk2Biomodels supports integration with multiple LLMs: gpt-4o-mini (via OpenAI API) and open-source llama (3.1 and 3.3) models (via NVIDIA API). An OpenAI API key may be generated here. OpenAI may provide initial free credits for API calls with the API key, after which additional credits may be purchased here. More information on pricing is available here.

Talk2Scholars and Talk2KnowledgeGraphs requires Milvus to be set up as the vector database — install Milvus depending on your setup by following the official instructions for CPU or GPU. You will also need a Zotero API key, which you can generate here. (The Zotero key is only required for Talk2Scholars; all other agents do not need it.)

By default, talk2knowledgegraphs includes a small subset of the PrimeKG knowledge graph, allowing users to start interacting with it out of the box. To switch to a different knowledge graph or use your own, refer to the deployment guide. Additionally on Windows, the pcst_fast 1.0.10 library requires Microsoft Visual C++ 14.0 or greater. You can download the Microsoft C++ Build Tools here.

LangSmith support is optional. To enable it, create an API key here.

Please note that this will create a new tracing project in your Langsmith account with the name T2X-xxxx, where X can be AA4P (Main Agent), B (Biomodels), S (Scholars), KG (KnowledgeGraphs), or C (Cells). If you skip the previous step, it will default to the name default. xxxx will be the 4-digit ID created for the session.

Option 3: pip (beta-release)

Python Version from PEP 621 TOML

# Install the package from PyPI
uv add aiagents4pharma

# Or using pip
pip install aiagents4pharma

Check out the tutorials on each agent for detailed instructions.

Contributing

We welcome your support to make AIAgents4Pharma even better. All types of contributions are appreciated — whether you're fixing bugs, adding features, improving documentation, or helping with testing, every contribution is valuable.

Development Setup

For contributors and developers, we have comprehensive documentation:

How to contribute

  1. Star this repository to show your support.
  2. Fork the repository.
  3. Create a new branch for your work:
git checkout -b feat/your-feature-name
  1. Set up your development environment:
uv sync --extra dev --frozen  # Install development dependencies
uv run pre-commit install    # Set up code quality hooks
  1. Make your changes and run quality checks:
uv run ruff check --fix .  # Lint and fix code
uv run ruff format .  # Format code
uv run pre-commit run --all-files  # Run all checks (linting, formatting, security)

# Run submodule-specific checks (pylint configuration in pyproject.toml)
uv run pylint aiagents4pharma/talk2biomodels/
uv run coverage run --include="aiagents4pharma/talk2biomodels/*" -m pytest --cache-clear aiagents4pharma/talk2biomodels/tests/ && uv run coverage report

uv run pylint aiagents4pharma/talk2knowledgegraphs/
uv run coverage run --include="aiagents4pharma/talk2knowledgegraphs/*" -m pytest --cache-clear aiagents4pharma/talk2knowledgegraphs/tests/ && uv run coverage report

uv run pylint aiagents4pharma/talk2scholars/
uv run coverage run --include="aiagents4pharma/talk2scholars/*" -m pytest --cache-clear aiagents4pharma/talk2scholars/tests/ && uv run coverage report
  1. Commit and push your changes:
git commit -m "feat: add a brief description of your change"
git push origin feat/your-feature-name
  1. Open a Pull Request.

Areas where you can help

  • Beta testing for Talk2BioModels and Talk2Scholars.
  • Development work related to Python, bioinformatics, or knowledge graphs.

Contacts for contributions

Please refer to our CONTRIBUTING.md and developer documentation for detailed contribution guidelines and setup instruction

Core symbols most depended-on inside this repo

run
called by 56
aiagents4pharma/talk2knowledgegraphs/milvus_data_dump.py
_to_list
called by 23
aiagents4pharma/talk2knowledgegraphs/milvus_data_dump.py
get_app
called by 20
aiagents4pharma/talk2scholars/agents/s2_agent.py
download_pdf_to_temp
called by 15
aiagents4pharma/talk2scholars/tools/paper_download/utils/biorxiv_downloader.py
find_or_create_collection
called by 13
aiagents4pharma/talk2scholars/tools/zotero/utils/zotero_path.py
get_app
called by 12
aiagents4pharma/talk2biomodels/agents/t2b_agent.py
ensure_connection
called by 10
aiagents4pharma/talk2knowledgegraphs/utils/database/milvus_connection_manager.py
load_biomodel
called by 9
aiagents4pharma/talk2biomodels/tools/load_biomodel.py

Shape

Method 1,084
Function 729
Class 301
Route 171

Languages

Python100%

Modules by API surface

aiagents4pharma/talk2scholars/tests/test_utils_pubmed_downloader.py114 symbols
aiagents4pharma/talk2knowledgegraphs/tests/test_tools_milvus_multimodal_subgraph_extraction.py112 symbols
aiagents4pharma/talk2knowledgegraphs/tests/test_utils_database_milvus_connection_manager.py87 symbols
aiagents4pharma/talk2knowledgegraphs/tests/test_utils_extractions_milvus_multimodal_pcst.py74 symbols
aiagents4pharma/talk2scholars/tests/test_tools_paper_downloader.py56 symbols
aiagents4pharma/talk2scholars/tests/test_utils_base_paper_downloader.py48 symbols
aiagents4pharma/talk2scholars/tests/test_utils_biorxiv_downloader.py46 symbols
aiagents4pharma/talk2scholars/tests/test_utils_s2_utils_ext_ids.py44 symbols
aiagents4pharma/talk2knowledgegraphs/tests/test_tools_subgraph_extraction.py41 symbols
aiagents4pharma/talk2scholars/tests/test_utils_medrxiv_downloader.py40 symbols
aiagents4pharma/talk2scholars/tests/test_utils_arxiv_downloader.py40 symbols
app/frontend/utils/streamlit_utils.py37 symbols

Datastores touched

primekgDatabase · 1 repos
dbXDatabase · 1 repos
dbYDatabase · 1 repos

For agents

$ claude mcp add AIAgents4Pharma \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page