How sakanaai/ai-scientist-v3 works
Agentic Scientist turns a task description into agent-driven experiments and a paper, with task drafting, iterative investigation, ablations, sealed final evaluation, and post-hoc analysis as distinct stages. The main entry point dispatches agsci run; the README documents the phase workflow and persistent run directory. The separate run inspector discovers saved runs and serves graph, detail, and performance views to a browser UI. Edges between pipeline stages follow the README; the excerpts do not expose their internal runtime wiring, so those links are documented rather than inferred from module names.
Main entry points: pipeline/cli.py Run pipeline · portable_run_storage.py Run directory · app.py Inspector API · investigation/cli.py Idea investigation
Components 20
Run orchestration
- Command dispatcher
src/agsci/main.py - Run pipeline
src/pipeline/cli.py - Run directory
src/pipeline/portable_run_storage.py
Task and investigation
- Task drafting
src/task_drafting/service.py - Idea investigation
src/investigation/cli.py - Agent runtime
src/investigation/runtime.py
Evaluation phases
- Ablations
src/variants_pipeline/pipeline.py - Final evaluation
src/final_evaluation/runner.py - Post-hoc analysis
src/posthoc_pipeline/pipeline.py
Analysis and paper
- Paper production
src/orchestrator/paper_step.py - Paper review
src/investigation/final_ai_review.py
Run inspection
- Inspector API
apps/run_inspector/backend/app.py - Run discovery
apps/run_inspector/backend/discovery.py - Run graph builder
apps/run_inspector/backend/graph_builder.py - Performance builder
apps/run_inspector/backend/performance_builder.py - Run detail views
apps/run_inspector/backend/views_builder.py - Inspector UI
apps/run_inspector/frontend/src/App.tsx - API client
apps/run_inspector/frontend/src/api/client.ts
Other components
- Researcher
- Browser user
Connections 24
- Researcher → Command dispatcher: runs command
src/agsci/main.py - Command dispatcher → Run pipeline: dispatches run
src/agsci/main.py - Run pipeline → Task drafting: runs phase
- Run pipeline → Idea investigation: runs phase
- Run pipeline → Ablations: runs phase
- Run pipeline → Final evaluation: runs phase
- Run pipeline → Post-hoc analysis: runs phase
- Run pipeline → Paper production: runs phase
- Task drafting → Run directory: writes run outputs
- Idea investigation → Agent runtime: uses agent runtime
- Idea investigation → Run directory: writes run outputs
- Ablations → Run directory: writes run outputs
- Final evaluation → Run directory: writes run outputs
- Post-hoc analysis → Run directory: writes run outputs
- Paper production → Run directory: writes manuscript
- Paper production → Paper review: optional AI review
- Browser user → Inspector UI: browses runs
- Inspector UI → API client: requests data
apps/run_inspector/frontend/src/App.tsx - API client → Inspector API: calls API
apps/run_inspector/frontend/src/api/client.ts - Inspector API → Run discovery: discovers runs
apps/run_inspector/backend/app.py - Inspector API → Run graph builder: builds graph
apps/run_inspector/backend/app.py - Inspector API → Performance builder: builds performance
apps/run_inspector/backend/app.py - Inspector API → Run detail views: builds details
apps/run_inspector/backend/app.py - Run discovery → Run directory: scans run data