1. Agent Initialization
The A1 class is the primary interface for biomni:
```python
from biomni.agent import A1
from biomni.config import default_config
# Basic initialization
agent = A1(
path='./data', # Path to data lake (~11GB downloaded on first use)
llm='claude-sonnet-4-20250514' # LLM model selection
)
# Advanced configuration
default_config.llm = "gpt-4"
default_config.timeout_seconds = 1200
default_config.max_iterations = 50
```
Supported LLM Providers:
- Anthropic Claude (recommended):
claude-sonnet-4-20250514, claude-opus-4-20250514 - OpenAI:
gpt-4, gpt-4-turbo - Azure OpenAI: via Azure configuration
- Google Gemini:
gemini-2.0-flash-exp - Groq:
llama-3.3-70b-versatile - AWS Bedrock: Various models via Bedrock API
See references/llm_providers.md for detailed LLM configuration instructions.
2. Task Execution Workflow
Biomni follows an autonomous agent workflow:
```python
# Step 1: Initialize agent
agent = A1(path='./data', llm='claude-sonnet-4-20250514')
# Step 2: Execute task with natural language query
result = agent.go("""
Design a CRISPR screen to identify genes regulating autophagy in
HEK293 cells. Prioritize genes based on essentiality and pathway
relevance.
""")
# Step 3: Review generated code and analysis
# Agent autonomously:
# - Decomposes task into sub-steps
# - Retrieves relevant biological knowledge
# - Generates and executes analysis code
# - Interprets results and provides insights
# Step 4: Save results
agent.save_conversation_history("autophagy_screen_report.pdf")
```
3. Common Task Patterns
#### CRISPR Screening Design
```python
agent.go("""
Design a genome-wide CRISPR knockout screen for identifying genes
affecting [phenotype] in [cell type]. Include:
- sgRNA library design
- Gene prioritization criteria
- Expected hit genes based on pathway analysis
""")
```
#### Single-Cell RNA-seq Analysis
```python
agent.go("""
Analyze this single-cell RNA-seq dataset:
- Perform quality control and filtering
- Identify cell populations via clustering
- Annotate cell types using marker genes
- Conduct differential expression between conditions
File path: [path/to/data.h5ad]
""")
```
#### Drug ADMET Prediction
```python
agent.go("""
Predict ADMET properties for these drug candidates:
[SMILES strings or compound IDs]
Focus on:
- Absorption (Caco-2 permeability, HIA)
- Distribution (plasma protein binding, BBB penetration)
- Metabolism (CYP450 interaction)
- Excretion (clearance)
- Toxicity (hERG liability, hepatotoxicity)
""")
```
#### GWAS Variant Interpretation
```python
agent.go("""
Interpret GWAS results for [trait/disease]:
- Identify genome-wide significant variants
- Map variants to causal genes
- Perform pathway enrichment analysis
- Predict functional consequences
Summary statistics file: [path/to/gwas_summary.txt]
""")
```
See references/use_cases.md for comprehensive task examples across all biomedical domains.
4. Data Integration
Biomni integrates ~11GB of biomedical knowledge sources:
- Gene databases - Ensembl, NCBI Gene, UniProt
- Protein structures - PDB, AlphaFold
- Clinical datasets - ClinVar, OMIM, HPO
- Literature indices - PubMed abstracts, biomedical ontologies
- Pathway databases - KEGG, Reactome, GO
Data is automatically downloaded to the specified path on first use.
5. MCP Server Integration
Extend biomni with external tools via Model Context Protocol:
```python
# MCP servers can provide:
# - FDA drug databases
# - Web search for literature
# - Custom biomedical APIs
# - Laboratory equipment interfaces
# Configure MCP servers in .biomni/mcp_config.json
```
6. Evaluation Framework
Benchmark agent performance on biomedical tasks:
```python
from biomni.eval import BiomniEval1
evaluator = BiomniEval1()
# Evaluate on specific task types
score = evaluator.evaluate(
task_type='crispr_design',
instance_id='test_001',
answer=agent_output
)
# Access evaluation dataset
dataset = evaluator.load_dataset()
```