Skip to content

tpan6/BioMarathon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

256 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BioPLEASE Logo

Join Slack Follow on X Follow on LinkedIn Paper

BioPLEASE: A General-Purpose Biomedical AI Agent

Overview

BioPLEASE is a general-purpose biomedical AI agent designed to autonomously execute a wide range of research tasks across diverse biomedical subfields. By integrating cutting-edge large language model (LLM) reasoning with retrieval-augmented planning and code-based execution, BioPLEASE helps scientists dramatically enhance research productivity and generate testable hypotheses.

Quick Start

Installation

Our software environment is massive and we provide a single setup.sh script to setup. Follow this file to setup the env first.

Then activate the environment E1:

conda activate bioplease_e1

then install the bioplease official pip package:

pip install bioplease --upgrade

For the latest update, install from the github source version, or do:

pip install git+https://github.com/snap-stanford/BioPLEASE.git@main

Lastly, configure your API keys using one of the following methods:

Click to expand

Option 1: Using .env file (Recommended)

Create a .env file in your project directory:

# Copy the example file
cp .env.example .env

# Edit the .env file with your actual API keys

Your .env file should look like:

# Required: Anthropic API Key for Claude models
ANTHROPIC_API_KEY=your_anthropic_api_key_here

# Optional: OpenAI API Key (if using OpenAI models)
OPENAI_API_KEY=your_openai_api_key_here

# Optional: Azure OpenAI API Key (if using Azure OpenAI models)
OPENAI_API_KEY=your_azure_openai_api_key
OPENAI_ENDPOINT=https://your-resource-name.openai.azure.com/

# Optional: AI Studio Gemini API Key (if using Gemini models)
GEMINI_API_KEY=your_gemini_api_key_here

# Optional: groq API Key (if using groq as model provider)
GROQ_API_KEY=your_groq_api_key_here

# Optional: Set the source of your LLM for example:
#"OpenAI", "AzureOpenAI", "Anthropic", "Ollama", "Gemini", "Bedrock", "Groq", "Custom"
LLM_SOURCE=your_LLM_source_here

# Optional: AWS Bedrock Configuration (if using AWS Bedrock models)
AWS_BEARER_TOKEN_BEDROCK=your_bedrock_api_key_here
AWS_REGION=us-east-1

# Optional: Custom model serving configuration
# CUSTOM_MODEL_BASE_URL=http://localhost:8000/v1
# CUSTOM_MODEL_API_KEY=your_custom_api_key_here

# Optional: BioPLEASE data path (defaults to ./data)
# BIOPLEASE_DATA_PATH=/path/to/your/data

# Optional: Timeout settings (defaults to 600 seconds)
# BIOPLEASE_TIMEOUT_SECONDS=600

Option 2: Using shell environment variables

Alternatively, configure your API keys in bash profile ~/.bashrc:

export ANTHROPIC_API_KEY="YOUR_API_KEY"
export OPENAI_API_KEY="YOUR_API_KEY" # optional if you just use Claude
export OPENAI_ENDPOINT="https://your-resource-name.openai.azure.com/" # optional unless you are using Azure
export AWS_BEARER_TOKEN_BEDROCK="YOUR_BEDROCK_API_KEY" # optional for AWS Bedrock models
export AWS_REGION="us-east-1" # optional, defaults to us-east-1 for Bedrock
export GEMINI_API_KEY="YOUR_GEMINI_API_KEY" #optional if you want to use a gemini model
export GROQ_API_KEY="YOUR_GROQ_API_KEY" # Optional: set this to use models served by Groq
export LLM_SOURCE="Groq" # Optional: set this to use models served by Groq

⚠️ Known Package Conflicts

Some Python packages are not installed by default in the BioPLEASE environment due to dependency conflicts. If you need these features, you must install the packages manually and may need to uncomment relevant code in the codebase. See the up-to-date list and details in docs/known_conflicts.md.

Basic Usage

Once inside the environment, you can start using BioPLEASE:

from bioplease.agent import A1

# Initialize the agent with data path, Data lake will be automatically downloaded on first run (~11GB)
agent = A1(path='./data', llm='claude-sonnet-4-20250514')

# Execute biomedical tasks using natural language
agent.go("Plan a CRISPR screen to identify genes that regulate T cell exhaustion, generate 32 genes that maximize the perturbation effect.")
agent.go("Perform scRNA-seq annotation at [PATH] and generate meaningful hypothesis")
agent.go("Predict ADMET properties for this compound: CC(C)CC1=CC=C(C=C1)C(C)C(=O)O")

If you plan on using Azure for your model, always prefix the model name with azure- (e.g. llm='azure-gpt-4o').

MCP (Model Context Protocol) Support

BioPLEASE supports MCP servers for external tool integration:

from bioplease.agent import A1

agent = A1()
agent.add_mcp(config_path="./mcp_config.yaml")
agent.go("Find FDA active ingredient information for ibuprofen")

Built-in MCP Servers: For usage and implementation details, see the MCP Integration Documentation and examples in tutorials/examples/add_mcp_server/ and tutorials/examples/expose_bioplease_server/.

🤝 Contributing to BioPLEASE

BioPLEASE is an open-science initiative that thrives on community contributions. We welcome:

  • 🔧 New Tools: Specialized analysis functions and algorithms
  • 📊 Datasets: Curated biomedical data and knowledge bases
  • 💻 Software: Integration of existing biomedical software packages
  • 📋 Benchmarks: Evaluation datasets and performance metrics
  • 📚 Misc: Tutorials, examples, and use cases
  • 🔧 Update existing tools: many current tools are not optimized - fix and replacements are welcome!

Check out this Contributing Guide on how to contribute to the BioPLEASE ecosystem.

If you have particular tool/database/software in mind that you want to add, you can also submit to this form and the bioplease team will implement them.

🔬 Call for Contributors: Help Build BioPLEASE-E2

BioPLEASE-E1 only scratches the surface of what’s possible in the biomedical action space.

Now, we’re building BioPLEASE-E2 — a next-generation environment developed with and for the community.

We believe that by collaboratively defining and curating a shared library of standard biomedical actions, we can accelerate science for everyone.

Join us in shaping the future of biomedical AI agent.

  • Contributors with significant impact (e.g., 10+ significant & integrated tool contributions or equivalent) will be invited as co-authors on our upcoming paper in a top-tier journal or conference.
  • All contributors will be acknowledged in our publications.
  • More contributor perks...

Let’s build it together.

Tutorials and Examples

BioPLEASE 101 - Basic concepts and first steps

Memory System Demo - Efficient memory management for long conversations

More to come!

📝 Documentation

Core Documentation

Key Features: Enhanced Memory System

BioPLEASE now includes an intelligent memory management system that dramatically reduces token usage:

  • Two-tier memory: Recent messages kept verbatim + compressed summaries of older messages
  • Token savings: 75-90% reduction in long conversations
  • Automatic: No code changes required - works out of the box
  • Configurable: Fine-tune for your specific use case
  • Persistent: Save/load memory across sessions
from bioplease.agent.a1 import A1

# Memory is automatic!
agent = A1(path="./data", llm="gpt-4o-mini")
result = agent.go("Your task here")

# Optional: Configure for your needs
agent.configure_memory(
    short_window=4,        # Keep fewer messages
    compression_ratio=0.2  # More aggressive compression
)

# Monitor usage
stats = agent.get_memory_stats(state)
print(f"Using ~{stats['estimated_tokens']} tokens")

See MEMORY_SYSTEM_SUMMARY.md for complete implementation details.

Release schedule

  • 8 Real-world research task benchmark/leaderboard release
  • A tutorial on how to contribute to BioPLEASE
  • A tutorial on baseline agents
  • MCP support
  • BioPLEASE A1+E1 release

Important Note

  • Security warning: Currently, BioPLEASE executes LLM-generated code with full system privileges. If you want to use it in production, please use in isolated/sandboxed environments. The agent can access files, network, and system commands. Be careful with sensitive data or credentials.
  • This release was frozen as of April 15 2025, so it differs from the current web platform.
  • BioPLEASE itself is Apache 2.0-licensed, but certain integrated tools, databases, or software may carry more restrictive commercial licenses. Review each component carefully before any commercial use.

Cite Us

@article{huang2025bioplease,
  title={BioPLEASE: A General-Purpose Biomedical AI Agent},
  author={Huang, Kexin and Zhang, Serena and Wang, Hanchen and Qu, Yuanhao and Lu, Yingzhou and Roohani, Yusuf and Li, Ryan and Qiu, Lin and Zhang, Junze and Di, Yin and others},
  journal={bioRxiv},
  pages={2025--05},
  year={2025},
  publisher={Cold Spring Harbor Laboratory}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors