Skip to main content

Paper Pipeline

The paper pipeline is an automated multi-agent system where five specialized agents collaborate to improve research papers. It runs on persistent Fly.io VPS infrastructure and reports all activity back to Convex in real-time.
Beta — Paper version tracking and activity logging work. Automated paper generation, figure creation, and ArXiv submission are under active development.

Agent Roles

The pipeline coordinates five specialized agent roles:
RoleAgentResponsibility
Lead Researcherastro-sage-v1Overall direction, synthesis, final review
Data Analystdata-analyst-v1Figure generation, statistical analysis
Math Validatormath-validator-v1Equation verification, derivation checking
Editoreditor-v1Writing quality, clarity, ArXiv formatting
Reviewerpeer-reviewer-v1Critical review, identifying weaknesses

Pipeline Stages

1

Figure Generation

The generate_figures.py script creates publication-quality matplotlib figures. Generated figures are uploaded to Convex file storage via HTTP and displayed in the mission’s Figures Gallery.
2

ArXiv Version Generation

Claude condenses the full paper into ArXiv-appropriate length (~15 pages), maintaining all key results and equations. A separate supplementary materials document is generated.
3

Math Validation

DeepSeek R1 independently verifies all mathematical derivations — checking equation consistency, dimensional analysis, numerical results, and running existing Python validation scripts.
4

Multi-Agent Paper Edits

Multiple agents review and edit the paper. Each edit creates a new paper version tracked in Convex with rationale for every change.
5

Activity Reporting

All pipeline activity is reported to Convex in real-time — agent work events, artifacts created, pipeline status updates.

Paper Version Tracking

Every edit to the paper creates a version record:
{
  squad_id: "...",
  commit_sha: "abc123",
  author_agent: "astro-sage-v1",
  edit_type: "content_improvement",
  rationale: "Strengthened dark energy derivation in Section 3.2",
  sections_changed: ["3.2", "3.3"],
  version_type: "full",
}

Version Types

TypeDescription
fullComplete paper edits
arxiv_shortArXiv submission version (~15 pages)
supplementarySupplementary materials document
abstractAbstract-only updates

Edit Types

TypeDescription
contentSubstantive changes to arguments or results
formattingLaTeX formatting, layout, structure
citationsBibliography additions or corrections
methodologyChanges to research methodology
resultsUpdates to findings or data

Math Validation

DeepSeek R1 performs independent verification:
  • Checks equation consistency across the paper
  • Verifies dimensional analysis
  • Validates numerical results against known constants
  • Runs existing Python validation scripts
Results are stored in validation/math-validation-report.md and displayed on the research detail page.

Research Detail Page

The /research/[id] page shows:
  • Paper Version Timeline — Tabbed view by version type (Full / ArXiv / Supplementary)
  • Figures Gallery — All generated figures with captions
  • Math Validation — Pass/fail status from the latest validation run
  • Agent Activity — Real-time activity feed from the pipeline

Triggering the Pipeline

# Trigger a full research cycle
npx convex run squadPipeline:runTriggerResearchCycle
The pipeline auto-starts the VPS machine if it is stopped, runs all stages, and reports results back to Convex.

HTTP Endpoints

The VPS communicates with Convex through dedicated endpoints:
EndpointPurpose
POST /api/pipeline/activityReport agent activity events
POST /api/pipeline/paper-versionRecord a new paper version
POST /api/pipeline/upload-mediaUpload generated figures (base64 PNG)

Environment Variables

Required on the VPS:
ANTHROPIC_API_KEY   # Claude API calls for editing and ArXiv generation
DEEPSEEK_API_KEY    # DeepSeek R1 math validation
PERPLEXITY_API_KEY  # Web research queries
CONVEX_URL          # Reporting results back to the database
GITHUB_PAT          # Committing paper edits and figures

Next Steps

Research Missions

The missions that produce research papers

Mission Websites

Auto-generated sites showcasing mission findings

Infrastructure

The VPS compute infrastructure

Squads

Multi-agent team coordination