Skip to content

Latest commit

 

History

History
154 lines (103 loc) · 4.78 KB

File metadata and controls

154 lines (103 loc) · 4.78 KB

Talk2AIAgents4Pharma

Installation

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.

Docker (stable-release)

This agent is available on Docker Hub.


1. Download files

Choose the appropriate version of the docker-compose.yml file based on your system:

For GPU:

wget https://raw.githubusercontent.com/VirtualPatientEngine/AIAgents4Pharma/main/aiagents4pharma/talk2aiagents4pharma/docker-compose/gpu/docker-compose.yml \
     https://raw.githubusercontent.com/VirtualPatientEngine/AIAgents4Pharma/main/aiagents4pharma/talk2aiagents4pharma/docker-compose/gpu/.env.example

For CPU:

wget https://raw.githubusercontent.com/VirtualPatientEngine/AIAgents4Pharma/main/aiagents4pharma/talk2aiagents4pharma/docker-compose/cpu/docker-compose.yml \
     https://raw.githubusercontent.com/VirtualPatientEngine/AIAgents4Pharma/main/aiagents4pharma/talk2aiagents4pharma/docker-compose/cpu/.env.example

2. Setup environment variables

cp .env.example .env

Edit .env with your API keys:

# .env.example (DO NOT put actual API keys here, read the README.md)

# OPENAI API KEY
OPENAI_API_KEY=your_openai_api_key_here

# LangSmith API KEY
LANGCHAIN_TRACING_V2=true
LANGCHAIN_API_KEY=your_langchain_api_key_here

# NVIDIA API KEY
NVIDIA_API_KEY=your_nvidia_api_key_here

# Set environment variables for data loader
MILVUS_HOST=milvus-standalone
MILVUS_PORT=19530
MILVUS_USER=root
MILVUS_PASSWORD=Milvus
MILVUS_DATABASE=t2kg_primekg

# Specify the data directory for multimodal data to your own data directory
# DATA_DIR=/your_absolute_path_to_your_data_dir/

BATCH_SIZE=500

3. Start the agent

docker compose up -d

Access the Web UI

Once started, open:

http://localhost:8501

In the background, the BioBridge multimodal embeddings will be inserted into the Milvus database, and the talk2aiagents4pharma service will start. Once the data is fully inserted, the application will be in a healthy state and accessible at the above address.

You can monitor the process using:

docker logs -f talk2aiagents4pharma

Get Key

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 KG (KnowledgeGraphs). If you skip the previous step, it will default to the name default. xxxx will be the 4-digit ID created for the session.


Notes for Windows Users

If you are using Windows, it is recommended to install Git Bash for a smoother experience when running the bash commands in this guide.

  • For applications that use Docker Compose, Git Bash is required.
  • For applications that use docker run manually, Git Bash is optional, but recommended for consistency.

You can download Git Bash here: Git for Windows.

When using Docker on Windows, make sure you run Docker with administrative privileges if you face permission issues.

To resolve permission issues, you can:


Build Images Locally

If you prefer to build the images yourself:

git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma.git
cd AIAgents4Pharma

GPU build (overwrites the latest-gpu tag locally)

docker build --platform=linux/amd64 \
  -t vpatientengine/talk2aiagents4pharma:latest-gpu \
  -f aiagents4pharma/talk2aiagents4pharma/Dockerfile \
  --build-arg INSTALL_CUDA=true \
  .

CPU build (overwrites the latest-cpu tag locally)

docker build --platform=linux/amd64 \
  -t vpatientengine/talk2aiagents4pharma:latest-cpu \
  -f aiagents4pharma/talk2aiagents4pharma/Dockerfile \
  --build-arg INSTALL_CUDA=false \
  .