AI Scientist is a research-planning assistant that turns a rough scientific idea into a structured experiment plan. The app helps a scientist move from an initial question to a reviewed hypothesis, a literature-aware protocol, materials, timeline, validation plan, and a feedback loop that improves the next run.
The product is built around two phases:
- Idea phase: a scientist enters a question, the system rewrites it into research-ready language, surfaces ambiguity, and asks for human confirmation.
- Planning phase: once the question is approved, the pipeline generates literature QC, protocol steps, materials, timeline, and validation guidance.
The scientist can then edit the generated plan in the UI. Those edits are saved as structured feedback and reused later through the Cognee learning loop.
The frontend lives in frontend/ and is built with Next.js and React. It provides the review interface where the scientist:
- enters the initial scientific question,
- validates the model's interpretation,
- reviews the generated plan,
- edits protocol, materials, and timeline sections,
- saves feedback back into the system.
The backend API lives in backend/server.js and acts as the single application entry point. It:
- receives requests from the frontend,
- validates payloads,
- calls the Python pipeline when a full plan is needed,
- saves feedback and local memory,
- returns merged JSON responses to the UI.
The planning pipeline lives in backend/app/agents/graph.py and is executed through backend/run_generate_plan.py. It runs the main planning stages:
- Parse the hypothesis.
- Run literature quality control.
- Design the protocol.
- Build materials and timeline outputs.
- Add validation logic.
- Synthesize the final plan.
The project includes a lightweight learning loop called Cognee.
- Scientist corrections are saved locally as structured records.
- Similar past corrections are retrieved for future runs.
- Those corrections are injected as feedback into the next generation.
This means the system becomes more useful over time without requiring a full re-design of the prompting flow.
- Frontend: Next.js, React, TypeScript, Lucide
- Backend API: Node.js
- Planning engine: Python, LangGraph
- LLM access: NVIDIA NIM through an OpenAI-compatible client
- Search and retrieval: Tavily, Semantic Scholar, PubMed-style retrieval utilities, Qdrant hooks
.
|-- frontend/ # Next.js scientist review UI
|-- backend/
| |-- server.js # Node API layer
| |-- run_generate_plan.py # Python entry point used by the Node API
| |-- app/
| | |-- agents/ # LangGraph planning agents
| | |-- models/ # Pydantic response models
| | |-- services/ # LLM and tracing helpers
| | `-- database/ # Local feedback store helpers
| `-- data/ # Local memory and feedback files
|-- docker-compose.yml
|-- frontend/Dockerfile
`-- backend/Dockerfile
At the root:
npm installFrontend dependencies:
npm --prefix frontend installBackend dependencies:
npm --prefix backend install
python -m pip install -r backend/requirements.txtCreate backend/.env.local from backend/.env.example and fill in the keys you want to use.
The most important variables are:
NVIDIA_API_KEYNVIDIA_BASE_URLNVIDIA_MODELTAVILY_API_KEY
Run the backend:
npm run dev:backendIn another terminal, run the frontend:
npm run dev:frontendDefault local URLs:
- Frontend:
http://127.0.0.1:3001 - Backend:
http://127.0.0.1:4000
The Docker setup is split into two services:
backend: Node API plus the Python LangGraph pipelinefrontend: Next.js UI
Create backend/.env.local from backend/.env.example.
docker compose up --build- Frontend:
http://localhost:3001 - Backend health check:
http://localhost:4000/health
docker compose downThe main request path is:
- The frontend sends a request to the Node backend.
- The backend validates the request and decides which workflow to run.
- For full plan generation, the backend spawns
run_generate_plan.py. - The Python pipeline runs the LangGraph workflow and returns structured JSON.
- The backend merges supporting metadata and returns the final response to the frontend.
POST /api/idea-phase: refine an initial scientific questionPOST /api/idea-phase/validate: save scientist validationPOST /api/lqc-plan: generate the literature QC plus experiment planPOST /api/feedback: save scientist edits for future reuseGET /health: basic backend health check
If you are using this repository for a demo or portfolio, the easiest structure is:
- Put the architecture diagram near the top of the README.
- Add the demo video right after the project summary.
- Keep the "How the system is organized" section because it explains the image in words.
- Keep the "Docker" section because it gives reviewers a fast path to run the project.
- Runtime memory is stored locally in
backend/data/*.local.json. - The Node server is the single API surface for the UI.
- The Python layer is not exposed directly to the frontend.
- The frontend expects the backend API on port
4000by default.