The Problem

Scientific research automation is typically either rigid pipeline orchestration or single-agent assistants that cannot sustain multi-step investigation. Researchers need a system that can generate hypotheses, run experiments, analyze results, and produce a manuscript without constant human intervention—while remaining adaptable to their specific domain.

What This Does

freephdlabor is a multiagent framework that automates the research lifecycle end-to-end. The core package (freephdlabor/) implements specialized agents—manager_agent, ideation_agent, experimentation_agent, writeup_agent, and others—that coordinate through a supervision layer. The external_tools/run_experiment_tool/ directory contains a separate, more experimental tree-search-based scientist that performs experiments and produces LaTeX papers directly.

The system ships with toolkits for web browsing, arXiv fetching, file editing, knowledge-base management, and LaTeX compilation. It supports two usage modes: out-of-the-box operation with a single task prompt, or domain customization by defining domain-specific tools.

How It Is Wired

Execution starts at launch_multiagent.py, which routes through freephdlabor/agents/manager_agent.py. That agent coordinates specialized agents via freephdlabor/supervision/supervision_manager.py. The most-connected module is freephdlabor/toolkits/model_utils.py (23 modules import it), making it the highest-blast-radius file for changes. The agent layer has an import cycle involving manager_agent, ideation_agent, and utils.py—changing any of these risks breaking the others.

The writeup pipeline routes through writeup_agent.py, which calls compile_latex and search heavily (8 call sites each). The external_tools/run_experiment_tool/ai_scientist/treesearch/agent_manager.py entry point (run) reaches 85 functions and performs filesystem writes via notes_dir.mkdir. The system makes outbound network calls (14 functions), reads/writes files (46 functions), calls models for inference (22 functions), and runs external commands (12 functions).

The mdconvert.py file in text_web_browser is the most heavily routed file (38 functions, 19 classes, called from 6 files), handling HTML-to-markdown conversion for web research.

How To Use It

git clone https://github.com/moses-y/freephdlabor
cd freephdlabor
conda env create -f environment.yml
conda activate freephdlabor
# Edit .env with your API keys (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.)
python launch_multiagent.py --task "Your research idea here"

Configuration lives in .llm_config.yaml for model selection and .env for API keys. The external_tools/run_experiment_tool/ has its own config (bfts_config.yaml) and requirements.

Real-World Use

A materials science lab could define custom tools for crystallographic data analysis, then run:

python launch_multiagent.py --task "Investigate the effect of annealing temperature on grain boundary migration in nickel superalloys"

The system would search literature, design experiments, execute simulations, and draft a paper—with the lab reviewing outputs at each stage.

Code Health & Issues

Static analysis found 125 issues (38 high, 86 medium, 1 low) across 8 categories. The high-severity findings are:

  • Import cycle (5 files): utils.py, ideation_agent.py, manager_agent.py participate in circular dependencies.
  • Deep nesting (34 instances): base_research_agent.py has indentation depth of 8.
  • Oversized files (3): vlm_document_analysis_tool.py (798 lines), latex_compiler_tool.py, parallel_agent.py.
  • Duplicated code: 46 files share 1004 repeated 6-line blocks.

Medium findings include broad exception handling (12 instances), a hub module (model_utils.py), and high branching density in file_editing_tools.py.

The code health audit confirms: a .env file is committed despite being gitignored (rotate credentials), no test suite exists, no CI workflow, and assets/preview.mp4 (6.1MB) exceeds the 5MB threshold. Dependencies are declared without a lockfile.

The Bottom Line

This is a serious research-automation framework with real breadth, but it's early-stage code: no tests, no CI, and a committed .env that needs immediate attention. Researchers wanting to automate their lab's workflow will find value, but should budget time for hardening before production use.