# LabOS: AI-XR Co-Scientist for Biomedical Research
This skill operationalizes the LabOS framework to enable AI agents to function as co-scientists. It integrates self-evolving computational reasoning for biomedical discovery (e.g., target identification, literature analysis) with a framework for monitoring and guiding physical lab execution using multimodal inputs.
## Quick reference
| User Goal | Jump to Step |
| --- | --- |
| Identify/Rank drug targets from CRISPR screen data | Step 1: Digital Reasoning |
| Generate/Validate mechanistic hypotheses | Step 1: Digital Reasoning |
| Analyze patient survival data (TCGA) | Step 2: Computational Validation |
| Generate or guide a physical lab protocol | Step 3: Physical Lab Guidance |
| Analyze/Verify experiment video (VLM task) | Step 4: Multimodal Verification |
## Workflow
### Step 1: Digital Reasoning (Self-Evolving Agent)
**Input:** Research objective (text), screening dataset (e.g., CSV counts), prior knowledge.
**Output:** Ranked list of candidates, reasoning trajectory, validation plan.
The LabOS digital agent functions as a multi-agent system (Manager, Developer, Critic) to iteratively refine hypotheses. Use this process to analyze biological data and rank targets like CEACAM6 or ITSN1.
1. **Planning (Manager Agent):** Decompose the user's objective into structured modules:
* Data preprocessing (normalization, batch correction).
* Statistical analysis (differential expression, enrichment).
* External knowledge retrieval (PubMed, pathways).
2. **Execution (Developer Agent):** Write and execute Python code to perform the analysis. Prioritize tools that allow for iterative refinement.
```python
# Pseudocode for LabOS-style target re-ranking
import pandas as pd
import scipy.stats as stats
# Load screen data (e.g., CRISPRa log-fold changes)
screen_data = pd.read_csv('user_screen_results.csv')
# 1. Perform differential analysis between treated (e.g., +NK) and control
# LabOS emphasizes dynamic re-ranking based on enrichment
treated = screen_data[screen_data['condition'] == 'NK_treated']
control = screen_data[screen_data['condition'] == 'Control']
# Simple fold-change calculation for illustration
# In practice, use DESeq2 or edgeR wrappers
merged = treated.merge(control, on='gene_id', suffixes=('_nk', '_ctrl'))
merged['log2fc'] = merged['logfc_nk'] - merged['logfc_ctrl']
merged['p_value'] = stats.ttest_ind(treated['logfc'], control['logfc'])[1]
# 2. Re-ranking based on biological priors (Tool Creation behavior)
# Filter for specific pathways (e.g., Cell Surface markers for immunotherapy)
# LabOS identified CEACAM6 by filtering for surfaceome/negative regulators
top_candidates = merged[merged['log2fc'] > 1.0].sort_values('p_value')
# Output candidates for Critic evaluation
print(top_candidates[['gene_id', 'log2fc', 'p_value']].to_string())
- Critique & Refinement (Critic Agent): Evaluate the intermediate results. If the list is too broad, refine the parameters (e.g., filter for "Cell Surface" annotations in UniProt) and re-run.
Step 2: Computational Validation (Patient Data)
Input: Gene of interest (e.g., CEACAM6), clinical dataset (e.g., TCGA).
Output: Survival plots, hazard ratios, statistical significance report.
Before moving to the wet lab, validate the clinical relevance of the target using bioinformatics. This mimics the LabOS "Evidence Generation" phase.
# Python code snippet for survival analysis (requires lifelines library)
# pip install lifelines
import pandas as pd
from lifelines import KaplanMeierFitter
from lifelines.statistics import multivariate_logrank_test
# Assume user provides TCGA data or we access it via API
tcga_data = pd.read_csv('TCGA_survival_data.csv')
# Binarize expression based on median (High vs Low)
gene_expr_col = 'CEACAM6_expression'
tcga_data['group'] = tcga_data[gene_expr_col] > tcga_data[gene_expr_col].median()
# Fit Kaplan-Meier curve
kmf = KaplanMeierFitter()
kmf.fit(tcga_data[tcga_data['group'] == True]['OS_time'], event_observed=tcga_data[tcga_data['group'] == True]['OS_event'], label='High Expression')
ax = kmf.plot_survival_function()
kmf.fit(tcga_data[tcga_data['group'] == False]['OS_time'], event_observed=tcga_data[tcga_data['group'] == False]['OS_event'], label='Low Expression')
kmf.plot_survival_function(ax=ax)
# Perform Log-Rank Test
results = multivariate_logrank_test(tcga_data['OS_time'], tcga_data['group'], tcga_data['OS_event'])
print(f"P-value for survival difference: {results.p_value:.4f}")
Check: A p-value < 0.05 suggests the candidate is clinically relevant and warrants physical validation (e.g., knocking out the gene in cell lines).
Step 3: Physical Lab Guidance (Protocol Generation)
Input: Experiment name (e.g., "CRISPRa activation of CEACAM6"), cell line (A375), target gene. Output: Step-by-step protocol with parameter constraints (timing, volume).
If the user requests guidance on performing the experiment, generate a detailed protocol similar to how LabOS guides researchers through lentiviral transduction or cell engineering.
# Protocol Template: CRISPRa Activation in A375 Cells
# Generated by LabOS Agent
1. Seeding
- Day 0: Seed A375 cells at 30% confluency in 6-well plates.
- Volume: 2 mL/well of complete DMEM.
2. Transduction (Day 1)
- Reagent: Lentiviral particles for CRISPRa system targeting [GENE].
- Add Polybrene to final concentration 8 ug/mL.
- CRITICAL STEP: Gently swirl plate. Do not shake vigorously to preserve cell integrity.
- Incubation: 24 hours.
3. Selection (Day 2+)
- Replace medium with fresh DMEM + Puromycin (1 ug/mL).
- Maintain selection for 72 hours.
4. Validation (Day 5)
- Harvest cells for qPCR or Western Blot to confirm overexpression.
Step 4: Multimodal Verification (VLM Analysis)
Input: Video file (MP4/AVI) of experiment, reference protocol (text). Output: Step alignment report, list of detected errors (sterility breaches, timing).
If the user provides a video of their experiment (e.g., from a phone or smart glasses), perform a visual reasoning check. This simulates the LabOS VLM capability.
- Protocol Alignment: Compare the visual input against the reference protocol steps.
- Error Detection: Look for specific deviations:
- Did the user pipette the correct reagent?
- Was the incubation time exceeded?
- Was the sterile field breached (e.g., touching non-sterile surfaces)?
# Conceptual VLM invocation logic
# Note: In a real deployment, this calls a fine-tuned VLM like LabOS-VLM (7B+)
def verify_lab_video(video_path, protocol_steps):
# Analyze video in 5-10 second chunks
analysis_results = vlm_agent.analyze(video_path, context=protocol_steps)
detected_steps = [r['step_id'] for r in analysis_results if r['confidence'] > 0.9]
errors = [r for r in analysis_results if r['is_error']]
return {
"status": "PASS" if not errors else "NEEDS_CORRECTION",
"detected_steps": detected_steps,
"errors": errors
}
Feedback Example: "At 00:45, you touched the pipette tip to the bench surface. Please discard and restart this step to maintain sterility."
Best practices
- Iterative Tooling: When analyzing data, don't just run a standard pipeline. The LabOS methodology relies on creating/finding tools specific to the problem (e.g., specifically looking for "Cell Surface" markers for immunotherapy targets, not just differentially expressed genes).
- Spatio-Temporal Context: When generating protocols, be specific about where (spatial location in the lab) and when (duration) actions occur.
- Re-ranking: Initial bioinformatics hits should be re-ranked based on biological relevance (pathways, literature) before wet lab validation.
Limitations
- Physical Robot Control: This skill defines the reasoning and monitoring logic. Direct control of robotic arms (xArm, cobots) requires hardware-specific APIs not covered in this text-based skill.
- VLM Access: The video verification step assumes access to a Vision-Language Model capable of scientific reasoning. Standard generic models (GPT-4o/Claude without vision) cannot perform the video analysis steps and must rely on user descriptions.
- Data Requirements: Survival analysis requires clinical datasets (e.g., TCGA). If the user cannot provide this, the validation step must be skipped or replaced with literature review.