# PaperOrchestra

> A multi-agent pipeline from Google Cloud AI Research that turns an idea summary and an experimental log into a submission-ready LaTeX paper

- Category: Science & Biomedical AI / Scientific Workflow Orchestration
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/google-research/paper-orchestra
- Website: https://yiwen-song.github.io/paper_orchestra/
- Canonical page: https://ai-tldr.dev/tools/paper-orchestra/

## In short

PaperOrchestra is a multi-agent framework for writing AI research papers. It sits in the Scientific Workflow Orchestration category of the Science & Biomedical AI tools and is open-source, written in Python and licensed Apache-2.0. To get started: clone and install.

## Overview

PaperOrchestra is a multi-agent framework for writing AI research papers. It starts from unstructured pre-writing material — an idea summary and an experimental log — plus a conference LaTeX template and its guidelines, and produces a full LaTeX manuscript with a literature review, citations and generated figures. The code comes from Google Cloud AI Research, accompanies the arXiv preprint 2604.05018, and is released under Apache-2.0; the README notes it is not an officially supported Google product.

The work is split across specialised agents. An Outline agent reads the raw materials and writes a JSON outline containing a visualization plan, a research graph and a writing plan. Two branches then run from that outline: a Plotting agent (built on PaperBanana) generates plots and diagrams, while a Literature Review agent finds related work through web search and verifies each candidate with the Semantic Scholar API, emitting the introduction and related-work sections plus a citation bank in `.bib`. A Section Writing agent assembles the full draft, and a Content Refinement agent iterates on it against an AgentReview evaluator, keeping a revision when the reviewer score rises (or holds with its sub-scores no worse) and reverting to the previous draft and stopping when it drops.

Everything is driven from one Python CLI, `paper_writing_cli.py`, which takes a raw-materials folder, a template folder and an output folder; the writer, reflection, plotting and image models are each selectable by flag, with Gemini models as the defaults and OpenAI models supported through their API key. The repository ships CVPR 2025 and ICLR 2025 templates (add your own as a new folder under `templates/`), automated raters for literature-review and paper quality under `autoraters/`, and a Streamlit front end that launches the pipeline in the background.

The project page reports a side-by-side human evaluation on PaperWritingBench — raw materials reverse-engineered from 100 CVPR 2025 and 100 ICLR 2025 papers — in which eleven AI researchers preferred PaperOrchestra over a single-agent pipeline and AI Scientist-v2 by an absolute win-rate margin of 50–68% on literature review quality and 14–38% on overall manuscript quality, while a gap to the human-written papers remained. The benchmark dataset is not in the code repository; the README says it will be released separately.

## What it does

- Five cooperating agents — Outline, Plotting, Literature Review, Section Writing and Content Refinement — run end to end from raw materials to a LaTeX manuscript
- Literature review that discovers papers by web search and verifies them against the Semantic Scholar API before they enter the citation bank
- Optional plotting workflow (`--use_plotting true`) that generates figures from code, with a critic loop capped by `--plotting_max_critic_rounds`
- Iterative refinement against an AgentReview evaluator: a revision that lowers the score is reverted and the loop stops
- Conference templates for CVPR 2025 and ICLR 2025, extendable by adding a folder under `templates/`
- Separately configurable writer, reflection, plotting and image models, plus a `--research_cutoff` month for the literature search
- Bundled autoraters for citation F1, literature-review quality and side-by-side paper quality
- A Streamlit demo that starts and monitors the writing pipeline from the browser

## Getting started

PaperOrchestra runs from source in a Python 3.11 environment. You need an API key for the models you plan to use (Gemini through GEMINI_API_KEY or Vertex AI, or OpenAI) and a Semantic Scholar API key for the literature review, plus a folder holding your idea and experimental log.

1. Clone and install

```bash
git clone https://github.com/google-research/paper-orchestra.git
cd paper-orchestra

conda create -n paper_orchestra python=3.11
conda activate paper_orchestra
pip install -r requirements.txt
```

2. Add your API keys

   Create a .env file in the project root. Fill in only the providers you use — for Gemini, either VERTEX_AI_PROJECT and VERTEX_AI_LOCATION or GEMINI_API_KEY; for OpenAI models, OPENAI_API_KEY.

```bash
SEMANTIC_SCHOLAR_API_KEY=your_semantic_scholar_api_key
OPENAI_API_KEY=your_openai_api_key
VERTEX_AI_PROJECT=your_vertex_ai_project
VERTEX_AI_LOCATION=your_vertex_ai_location
GEMINI_API_KEY=your_gemini_api_key
```

3. Prepare your raw materials

   Put the idea document and the experimental log in one folder. By default the CLI looks for idea_sparse.md and experimental_log.md; --idea_filename and --experimental_log_filename override those names. Pick a template folder such as templates/cvpr2025 or templates/iclr2025.

4. Write the paper

   --use_plotting true turns on the plotting agent; --writer_model_name and --reflection_model_name choose the LLMs. If --output_dir is omitted, a timestamped folder is created.

```bash
python paper_writing_cli.py \
  --raw_materials_dir /path_to_your_raw_materials/ \
  --latex_template_dir templates/cvpr2025 \
  --output_dir /path_to_your_output_folder/ \
  --use_plotting true
```

5. Or drive it from the browser

   The Streamlit demo launches paper_writing_cli.py as a background process; open the URL it prints (usually http://localhost:8501). Ctrl+C in the terminal stops the pipeline on Linux; otherwise pkill -f paper_writing_cli.py cleans up.

```bash
streamlit run frontend/app.py
```

## When to use it

- Reach for it when the experiments are done and you want a first full LaTeX draft in a conference template, generated from your notes and logs
- Reach for it when you want a related-work section whose citations are checked against Semantic Scholar rather than taken on an LLM's word
- Reach for it when you are studying automated paper writing and need a multi-agent baseline with its own quality autoraters
- Reach for it when your figures still need plotting and you want an agent to produce them from the experimental log
