How vahini-1/ai_scientist works
AI Scientist is a scientific experiment-planning workstation. A researcher submits a hypothesis and constraints, the backend gathers literature, supplier, and expert-memory context, then generates a structured experiment plan for review, chat, and export. The frontend also archives reports locally for later reopening. The graph preserves the documented report sections and the sampled backend orchestration; some frontend wiring and unsampled subsystems are represented only where the README supports them.
Main entry points: index.ts API routes · ReportView.tsx Experiment report · env.ts Backend config · App.tsx Application shell
Components 21
Research workstation
- Application shell
frontend/src/App.tsx - Hypothesis input
frontend/src/components/workstation/PromptInterface.tsx - Experiment report
frontend/src/components/workstation/ReportView.tsx - Review controls
frontend/src/components/workstation/EditableText.tsx - Report library
frontend/src/components/workstation/LibraryView.tsx - Report chat
frontend/src/components/workstation/PromptInterface.tsx - Report export
frontend/src/lib/export.ts
Plan generation
- API routes
backend/src/index.ts - Plan schema
backend/src/schema.ts - Plan generation
backend/src/azure.ts
Research grounding
- Novelty search
backend/src/researchAgent.ts - Grounding searches
backend/src/tavily.ts
External services
- Backend config
backend/src/env.ts - Semantic Scholar
- Tavily search
- Azure OpenAI
- Supabase
- Browser local storage
Memory and archive
- Workstation state
frontend/src/context/workstation-context.tsx - Expert memory
backend/src/supabase.ts
Other components
- Researcher
Connections 27
- Researcher → Application shell: opens workstation
- Application shell → Workstation state: provides state
frontend/src/App.tsx - Application shell → Experiment report: routes to
frontend/src/App.tsx - Researcher → Hypothesis input: submits hypothesis
README.md - Hypothesis input → API routes: requests plan
README.md - API routes → Plan schema: validates input
backend/src/index.ts - API routes → Novelty search: checks novelty
backend/src/index.ts - API routes → Grounding searches: gathers context
backend/src/index.ts - API routes → Expert memory: loads corrections
backend/src/index.ts - API routes → Plan generation: generates plan
backend/src/index.ts - Plan generation → Plan schema: parses output
backend/src/azure.ts - Novelty search → Semantic Scholar: queries papers
backend/src/researchAgent.ts - Novelty search → Tavily search: searches suppliers
backend/src/researchAgent.ts - Grounding searches → Tavily search: runs searches
backend/src/tavily.ts - Plan generation → Azure OpenAI: calls model
backend/src/azure.ts - Expert memory → Supabase: reads and writes
backend/src/supabase.ts - Experiment report → Review controls: renders edits
frontend/src/components/workstation/ReportView.tsx - Researcher → Experiment report: reviews plan
README.md - Researcher → Report chat: asks questions
README.md - Report chat → API routes: requests report chat
README.md - Experiment report → Report export: exports report
README.md - Workstation state → Browser local storage: persists reports
README.md - Report library → Workstation state: reopens archives
README.md - API routes → Expert memory: saves review
backend/src/index.ts - Backend config → Azure OpenAI: configures access
- Backend config → Tavily search: configures access
- Backend config → Supabase: configures access