๐ฌ NanoResearch
May 12, 2026 ยท View on GitHub
๐ฌ NanoResearch
A tri-level co-evolving multi-agent research automation system.
Re-implementation of NanoResearch (arXiv:2605.10813) with a ChatGPT-style web UI and field-agnostic prompts.
๐ Documentation ยท ๐ Architecture ยท ๐ Quickstart ยท ๐ Original paper
"Automation for whom? Researchers operate under different resource configurations, hold different methodological preferences, and target different output formats. A system that produces uniform outputs regardless of these differences will systematically under-serve every individual user."
โ NanoResearch (Xu et al., 2026)
NanoResearch takes a one-line research idea โ in any scholarly field โ and rides it through ideation, planning, experimentation, analysis, writing, and review to produce a downloadable LaTeX paper, while learning your preferences so the next run feels more like you.
โจ Highlights
- ๐ฌ Single chat surface. No buttons. Tell it your field and a topic; it narrates the pipeline back to you and pauses for feedback at every stage.
- ๐ Field-agnostic. Biology, social sciences, engineering, mathematics, computer science โ prompts adapt to the field's conventions (regressions vs. proofs vs. case studies vs. ablations).
- ๐ง Tri-level co-evolution. Per-user Skill Bank (procedural rules), Memory Module (project-specific facts), and a planner adapter trained via SDPO from your free-form feedback.
- ๐ฌ Real artefacts. Generates and runs a Python project for empirical fields, parses results, then assembles a section-by-section LaTeX paper that compiles to PDF (when
pdflatexis installed). - ๐ Azure AD auth. Talks to your private GPT-5.1 deployment via
DefaultAzureCredentialโ no API keys in.env.
Pipeline at a glance
flowchart LR T[Topic] --> O((Orchestrator)) O -->|retrieve| SB[(Skill Bank ๐ฎ)] O -->|retrieve| MM[(Memory Module โณ)] O --> I[Ideation]:::s1 I --> P[Planning]:::s1 P --> C[Coding +<br/>Execution]:::s2 C --> A[Analysis]:::s2 A --> W[Writing]:::s3 W --> R[Review]:::s3 R --> Paper[paper.pdf] W -.->|distil| SB W -.->|distil| MM I -.->|narrations| U[Chat] P -.-> U C -.-> U A -.-> U W -.-> U U -.->|feedback โฑ| O classDef s1 fill:#1e3a8a,stroke:#3b82f6,color:#fff classDef s2 fill:#92400e,stroke:#f59e0b,color:#fff classDef s3 fill:#065f46,stroke:#10b981,color:#fff
๐ What's in the box
| Component | Folder | Purpose |
|---|---|---|
| ๐ง Backend (Python) | src/nanoresearch/ | Multi-agent pipeline, FastAPI server, Skill/Memory stores, SDPO trainer |
| ๐ฌ Frontend (React + Vite) | ui/ | Chat-first UI with assistant-uiโstyle bubbles and live SSE narrations |
| ๐ Documentation site | docs/ | Jekyll-friendly markdown; deployed to GitHub Pages |
| ๐ผ Diagrams | docs/assets/diagrams/ | Mermaid sources + rendered PNGs |
| ๐งช Tests | tests/ | 61 unit + integration tests, offline-runnable |
๐ Quickstart
Prerequisites
- Python 3.11+ (3.12 tested)
- Node 18+ (Vite + assistant-ui)
- An Azure OpenAI / Foundry deployment of GPT-5.1 (or a compatible reasoning model)
az loginperformed locally; your account needs the Cognitive Services OpenAI User role- (optional)
pdflatexortectonicfor PDF compilation โ otherwise the paper ships as.tex - (optional) Apple-Silicon Mac with 32 GB+ unified RAM for the local Qwen planner (SDPO)
Setup
# 1. Clone + venv
git clone https://github.com/saadmsft/nanoresearch.git
cd nanoresearch
python3.12 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
# 2. Configure Azure (AAD auth โ no API keys)
cp .env.example .env
# edit AZURE_OPENAI_ENDPOINT + AZURE_OPENAI_DEPLOYMENT
az login
# 3. Backend
nanoresearch serve # http://127.0.0.1:8000
# 4. Frontend (separate terminal)
cd ui && npm install && npm run dev # http://localhost:5173
Open http://localhost:5173 and say hi.
Optional: local SDPO planner
pip install -e ".[local]" # torch, transformers, peft, accelerate
huggingface-cli download Qwen/Qwen2.5-7B-Instruct \
--local-dir data/models/Qwen2.5-7B-Instruct
๐ฌ What it looks like
You โธ I'm Mia, an ecologist. I prefer field studies, 6-month timeline.
Start a run on canopy cover and breeding-bird richness in city parks.
NanoResearch โธ Nice to meet you, Mia. Starting on canopy cover + bird richness.
NanoResearch โธ ๐ Searching scholarly databasesโฆ
NanoResearch โธ ๐ Done. 12 papers.
NanoResearch โธ ๐ก Drafted hypotheses (n=6). Checking novelty next.
NanoResearch โธ ๐ฏ Going with: Canopy ร heterogeneity interaction predicts richness.
NanoResearch โธ โธ Paused at ideation โ what should I emphasise or change?
You โธ Keep the design simple and proceed.
NanoResearch โธ ๐ Drafting an experiment blueprintโฆ
NanoResearch โธ ๐ Running an internal peer review of the blueprintโฆ
NanoResearch โธ ๐งช Writing a small experiment project to test the planโฆ
NanoResearch โธ โถ๏ธ Running the experimentโฆ
NanoResearch โธ ๐ Run finished (ok=True exit=0 dur=3.2s).
NanoResearch โธ ๐ Analysing resultsโฆ
NanoResearch โธ โ๏ธ Drafting the introduction / method / experiments / โฆ sections.
NanoResearch โธ ๐ Reviewing the paper draft.
NanoResearch โธ ๐ Paper compiled. [Download PDF] โ or the [LaTeX source].
๐ Architecture
NanoResearch is a stage pipeline orchestrated around two persistent stores and one trainable planner.
flowchart TB
subgraph User["๐ค User"]
Chat["๐ฌ Chat UI"]
end
subgraph API["โก FastAPI"]
Intent["/api/intent<br/>NL โ action"]
RunMgr["RunManager<br/>background thread"]
Narr["Narrator<br/>event โ English"]
SSE["SSE /stream<br/>+ narration"]
Files["paper.pdf<br/>paper.tex"]
end
subgraph Pipe["๐ฌ Pipeline (Orchestrator)"]
direction LR
I[Ideation] --> P[Planning]
P --> C[Coding]
C --> An[Analysis]
An --> W[Writing]
end
subgraph Stores["๐พ Per-User Stores"]
Profile[(Profile)]
Skill[(Skill Bank ๐ฎ)]
Mem[(Memory โณ)]
LoRA[(LoRA adapter)]
end
subgraph LLMs["๐ค Models"]
Azure[Azure OpenAI<br/>GPT-5.1]
Qwen[Qwen2.5-7B<br/>local ยท planner only]
end
Chat <-->|HTTP| Intent
Chat <-->|EventSource| SSE
Chat -->|download| Files
Intent --> RunMgr
RunMgr --> Pipe
Pipe --> Narr --> SSE
Pipe <-->|retrieve / distil| Stores
Pipe -->|complete| Azure
Pipe -->|plan| Qwen
Qwen <-->|SDPO LoRA| LoRA
๐ Full architecture deep-dive: docs/architecture.md ยท paper ยง3 mapping ยท SDPO math
๐งช Testing
pytest -m "not azure and not local_model" # 61 offline tests
pytest -m azure # AAD smoke
pytest -m local_model # Qwen MPS smoke
| Suite | Tests |
|---|---|
| Config + manifest + router | 9 |
| Stores (schemas, retrieval, distill) | 18 |
| Orchestrator | 8 |
| Stage I (literature + ideation + planning) | 9 |
| Stage II + III (sandbox, narrator, TeX, schemas) | 9 |
| HTTP API | 7 |
| SDPO (gradient + LoRA) | 3 (opt-in) |
| Azure / local smoke | 2 (opt-in) |
๐ Repository layout
nanoresearch/
โโโ src/nanoresearch/
โ โโโ agents/ # Stage I-III stage controllers + prompts + artefacts
โ โโโ api/ # FastAPI app, RunManager, intent classifier, narrator
โ โโโ cli/ # `nanoresearch serve`, `health`, `settings`
โ โโโ config/ # pydantic-settings
โ โโโ literature/ # OpenAlex client + evidence extraction
โ โโโ llm/ # Azure (AAD) + local Qwen backends, agent-role router
โ โโโ logging/ # structlog + per-run JSONL manifest
โ โโโ orchestrator/ # Retrieve โ Plan โ Dispatch โ Reflect โ Update
โ โโโ planner/ # Qwen wrapper + LoRA + SDPO trainer (Eq. 14-15)
โ โโโ schemas/ # Profile / Skill / Memory pydantic models
โ โโโ stores/ # SkillBank + MemoryStore + Profile (JSON-backed)
โโโ ui/ # React + TypeScript + Tailwind chat
โโโ docs/ # Jekyll site (GitHub Pages)
โโโ tests/ # Pytest suite
โโโ runs/ # โ created at runtime (event logs + papers/<run>/paper.tex)
โโโ data/users/<id>/ # โ created at runtime (profile, skills, memories, lora)
๐บ Roadmap
- Phase 0โ4 โ bootstrap, stores, planner+SDPO, orchestrator, Stage I (Ideation + Planning)
- Phase 5 โ Stage II (Coding + sandboxed exec + debug loop) + Analysis
- Phase 6 โ Stage III (Writing + Reviewer + LaTeX/PDF)
- FastAPI + React/Vite UI with live SSE narrations
- Phase 7 โ Compliance/Novelty/Writing judges (paper ยง8โ10) + 20-topic benchmark harness
- Phase 8 โ CLI ergonomics (
nanoresearch run,nanoresearch eval) - Docker sandbox upgrade for Stage II
- Per-section figure generation + bibliography auto-fill
๐ Citation
If this implementation is useful in your research, please cite the original paper:
@misc{xu2026nanoresearch,
title = {NanoResearch: Co-Evolving Skills, Memory, and Policy for Personalized Research Automation},
author = {Xu, Jinhang and Zhu, Qiyuan and Wu, Yujun and Wang, Zirui and Zhang, Dongxu and others},
year = {2026},
eprint = {2605.10813},
archivePrefix = {arXiv},
primaryClass = {cs.AI},
url = {https://arxiv.org/abs/2605.10813}
}
๐ License
Apache 2.0 โ see LICENSE.
Original NanoResearch paper ยฉ Xu et al., 2026.
This implementation is independent and not affiliated with the original authors.