General Introduction
AgentLaboratory is an open source tool hosted on GitHub and developed by Samuel Schmidgall. It utilizes intelligent agents driven by Large Language Models (LLMs) to help researchers with the full process of scientific research, including literature review, experimental design, and report writing. The goal of this tool is to make research more efficient, not to replace human creativity. After the user enters a research idea, the tool automates repetitive tasks such as searching for papers or generating code. It is suitable for academic researchers, students and engineers. The project supports multilingual documentation and was last updated in March 2025 with the addition of the AgentRxiv framework, which allows agents to share research results with each other.
Function List
- Literature review: Automatically collects papers from databases such as arXiv and organizes related content.
- Experimental design: Generate research plans and runnable Python code.
- Report Writing: Converts study results into LaTeX format to generate a full report.
- AgentRxiv framework: Support agents to upload and access research results for collaborative progress.
- Copilot Mode: When turned on, the tool interacts with the user in real time to adjust the study.
- Multi-language support: Provides documentation and operator interface in Chinese, English and other languages.
Using Help
The installation and use of AgentLaboratory requires some basic steps, but is simple to follow. The following is a detailed description of how to install and use it, so you can get started quickly.
Installation process
- Download Project Code
Open a terminal and enter the following command to clone the code base:
git clone git@github.com:SamuelSchmidgall/AgentLaboratory.git
Once the download is complete, a AgentLaboratory
Folder.
- Creating a Python Environment
Go to the project folder and create and activate the virtual environment. Python 3.12 is officially recommended:
cd AgentLaboratory
python -m venv venv_agent_lab
source venv_agent_lab/bin/activate # Linux/Mac
venv_agent_lab\Scripts\activate # Windows
When activated, the terminal displays (venv_agent_lab)
The
- Installation of dependencies
Runs in a virtual environment:
pip install -r requirements.txt
This will install the required Python libraries. If you run into problems, check out GitHub's Issues page.
- Install pdflatex (optional)
If you need to generate reports in LaTeX format, install pdflatex:
sudo apt install pdflatex # Linux
Don't have permission? You can use the parameter <code>--compile-latex "false"</code>
Skip this step.
- Setting the API Key
Tools require OpenAI or DeepSeek the API key. Once obtained, set the environment variable:
export OPENAI_API_KEY="你的密钥" # Linux/Mac
set OPENAI_API_KEY="你的密钥" # Windows
Or specify the key directly at runtime.
operational tool
After the installation is complete, run the following command to start it:
python ai_lab_repo.py --yaml-location "experiment_configs/MATH_agentlab.yaml"
To research a specific topic, such as "machine learning optimization", enter:
python ai_lab_repo.py --api-key "sk-xxx" --llm-backend "gpt-4o" --research-topic "机器学习优化"
The tool will start processing automatically.
Main Functions
- Enter a research topic
After launching, the tool will prompt if no theme is specified:
请为 AgentLaboratory 输入一个实验想法:
Type it in and press enter, the tool starts working.
- View Literature Review
The tool collects papers from databases such as arXiv and generates results that are saved in theoutput
folder, such as<研究主题>_literature.md
. Open the file to see the contents. - Run the experiment code
tool generates Python code in a path similar tooutput/<研究主题>_code.py
. Running:
python output/机器学习优化_code.py
The results of the experiment can be viewed.
- Generating reports
When the experiment is complete, the tool generates a LaTeX file with the path as followsoutput/<研究主题>_report.tex
. If pdflatex is installed, it will be automatically compiled to PDF. - Using Copilot Mode
compiler<code>experiment_configs/MATH_agentlab.yaml</code>
file, which willcopilot-mode
set up astrue
, and then run it. The tool will ask your opinion in real time. - AgentRxiv Features
Add parameters at runtime<code>--agentrxiv "true"</code>
, the agent uploads the results to the AgentRxiv framework for use by other agents.
Tips for use
- Write detailed notes: in
<code>ai_lab_repo.py</code>
(used form a nominal expression)task_notes_LLM
Add notes in, such as experiment objectives or hardware information, to help the agent understand the requirements. - Select Model: Use of
--llm-backend
Specify the model, e.g.<code>--llm-backend="o1-mini"</code>
. Powerful models such aso1
Better results, but more costly. - Loading progress: If interrupted, it is possible to start from the
state_saves
Checkpoints before the folder is loaded. - Chinese operation: Setting in the configuration file
language: "中文"
The tool generates content in Chinese.
caveat
- Ensure that the network is working and that the tool requires access to an external database.
- The file will be saved in the
output
folder, regular cleanup is recommended. - If you encounter an error, check the API key or model settings.
With these steps, you can accomplish research tasks efficiently with AgentLaboratory.
application scenario
- Dissertation Writing
The researcher enters the topic and the tool generates a literature review and a first draft, saving access time. - experimental verification
Engineers enter experimentation goals, and tools provide code and plans to quickly test ideas. - Teamwork
With AgentRxiv, multiple researchers share results and accelerate project progress.
QA
- Programming experience required?
Not required. Just copy the commands step by step and use them. But knowing Python gives you more flexibility to tweak the code. - Is it expensive?
The project is free, but API calls may be charged, depending on the model you pick and the amount of usage. - Can it be used offline?
No. The tool requires network access to the database and API. The tool requires network access to the database and API.