How snap-stanford/biodiscoveryagent works
Main Components
• CLI/Entry Point: The primary execution script (research_assistant.py) parses arguments (task type, model selection, dataset name, run name, etc.).
• LLM Interface: The LLM.py module is responsible for interacting with external LLM APIs (Claude, GPT) and handling messaging.
• Tools Module: A collection of scripts that enrich the agent’s capability:
• achilles.py, baseline.py, gene.py, get_gene_summary.py, get_lit_review.py, and tools.py provide various functions including gene searching, summary generation, literature reviews, and additional analysis.
• Datasets Management: The datasets directory contains ground truth CSVs, JSON task prompt definitions, and NumPy arrays (topmovers) for experiment data. This is the backbone for experiment configuration and evaluation.
• Analysis: The analyze.py script handles evaluation of predictions (calculating hit rates and overall performance).
• External Resources/Dependencies:
• API integrations (Claude, possibly OpenAI) are key for enabling the closed-loop design.
• Additional external tools (e.g., Reactome pathway search) and literature search services.
• Utilities and Configuration:
Visualizing Relationships and Interactions
• Research Assistant as the central orchestrator, accepting inputs via the CLI.
• Separate modules (gene.py, get_gene_summary.py, get_lit_review.py, tools.py) as “Tools” that feed into and augment the responses from the LLM. These tools interact with the agent to provide critiques, gene insights, and literature support.
• Datasets repository as a data source and endpoint:
• Analysis module (analyze.py) receiving processed outputs to evaluate prediction quality and hit rates.
• External interactions:
Architectural Patterns and Design Principles
• Modular design: Each Python script acts as a stand-alone component and can be updated/replaced independently.
• Command-Line Driven Workflow: The application’s interaction model is based on CLI arguments, which trigger specific modules or tool integrations.
• Extensibility: The clear separation between core orchestration, dataset management, and analytical tools makes it easier to add new functionalities (or plug in new models/APIs).