Skip to content

genomoncology/biomcp-trialgpt

Repository files navigation

biomcp-trialgpt

Release Build status codecov Commit activity License

Demonstration of TrialGPT agents using BioMCP.

Getting started with your project

1. Create a New Repository

First, create a repository on GitHub with the same name as this project, and then run the following commands:

git init -b main
git add .
git commit -m "init commit"
git remote add origin git@github.com:genomoncology/biomcp-trialgpt.git
git push -u origin main

2. Set Up Your Development Environment

Then, install the environment and the pre-commit hooks with

make install

This will also generate your uv.lock file

3. Run the pre-commit hooks

Initially, the CI/CD pipeline might be failing due to formatting issues. To resolve those run:

uv run pre-commit run -a

4. Commit the changes

Lastly, commit the changes made by the two steps above to your repository.

git add .
git commit -m 'Fix formatting issues'
git push origin main

You are now ready to start development on your project! The CI/CD pipeline will be triggered when you open a pull request, merge to main, or when you create a new release.

To finalize the set-up for publishing to PyPI, see here. For activating the automatic documentation with MkDocs, see here. To enable the code coverage reports, see here.

Releasing a new version

  • Create an API Token on PyPI.
  • Add the API Token to your projects secrets with the name PYPI_TOKEN by visiting this page.
  • Create a new release on Github.
  • Create a new tag in the form *.*.*.

For more details, see here.

BioMCP TrialGPT

A demonstration of TrialGPT agents using BioMCP for clinical trial matching.

Getting Started

Prerequisites

Before running the application, ensure you have:

  1. Python 3.9 or higher installed
  2. The following API keys:
    • OPENAI_API_KEY - Required for all agent frameworks
    • ANTHROPIC_API_KEY - Required for Claude models
    • GEMINI_API_KEY - Required for Google Gemini models

Installation

  1. Clone the repository:

    git clone https://github.com/genomoncology/biomcp-trialgpt.git
    cd biomcp-trialgpt
  2. Create and activate a virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # On Windows, use: .venv\Scripts\activate
  3. Install the package and dependencies:

    pip install -e .

Running the Application

  1. Set the required API keys as environment variables:

    # On macOS/Linux
    export OPENAI_API_KEY="your-openai-api-key"
    export ANTHROPIC_API_KEY="your-anthropic-api-key"
    export GEMINI_API_KEY="your-gemini-api-key"
    
    # On Windows (Command Prompt)
    set OPENAI_API_KEY=your-openai-api-key
    set ANTHROPIC_API_KEY=your-anthropic-api-key
    set GEMINI_API_KEY=your-gemini-api-key
    
    # On Windows (PowerShell)
    $env:OPENAI_API_KEY="your-openai-api-key"
    $env:ANTHROPIC_API_KEY="your-anthropic-api-key"
    $env:GEMINI_API_KEY="your-gemini-api-key"
  2. Run the Streamlit application:

    streamlit run src/biomcp_trialgpt/streamlit_app/main.py
  3. The application will open in your default web browser at http://localhost:8501

Using the Application

  1. Enter a clinical note in the text area on the sidebar
  2. Select an extraction model (GPT, Claude, or Gemini)
  3. Configure trial filtering options (optional)
  4. Click "Submit" to process the note and find matching clinical trials
  5. View the results in the expandable sections for each step of the process

Available Agent Frameworks

The application supports multiple agent frameworks:

  • LangGraph Agent: Uses LangGraph for workflow orchestration

Troubleshooting

  • If you encounter errors about missing API keys, ensure all three keys are properly set as environment variables
  • For model-specific errors, check that you have access to the selected models in your API accounts
  • If the application fails to start, verify that all dependencies are correctly installed

Repository initiated with fpgmaas/cookiecutter-uv.

About

Demonstration of TrialGPT agents using BioMCP.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages