A multi-agent research engine that turns a one-line research goal into tournament-ranked, stress-tested, citation-grounded hypotheses.
Created by Quang Bui
β Try the live demo β no account, no API key
Type a research question. A team of specialised agents generate competing
hypotheses, debate and Elo-rank them, evolve the best across several rounds,
adversarially stress-test the top 3, then write a final proposal with inline
[n] citations grounded in real papers. Watch every step β including the agents'
reasoning β stream live in the chat.
- Elo tournament of pairwise hypothesis debates
- Recurring self-critique β the engine re-questions its own leaderboard for flaws and weak citations
- Stress-testing the top 3 β contradicting-evidence search, citation verification, feasibility + a prototype-scale experiment, then fixes and a re-rank
- Multi-round evolution of the leading ideas
- HIGH RISK mode β a toggle for bold, contrarian, non-derivative hypotheses
- Real citations, no key β OpenAlex / PubMed / arXiv / Europe PMC, each verified, with a numbered
## Referencessection - Runs in the browser with no setup, or self-host for a server-side key
An open-source re-implementation of Google's AI co-scientist (Gottweis et al., "Accelerating scientific discovery with Co-Scientist," Nature, 2026). Six specialised agents collaborate through an Elo tournament, then an adversarial stress-test stage pressure-tests the finalists, to turn a natural-language goal into a ranked, citation-grounded research proposal.
Independent project β not affiliated with Google or the paper's authors.
A single run walks through these stages β all of it streaming live in the chat, including the agents' own reasoning:
- Generate competing hypotheses from a literature review and multi-agent debate.
- Reflect β review each for novelty, correctness, and testability.
- Rank in an Elo tournament of pairwise debates.
- Evolve the leaderboard's best ideas across multiple rounds (combine, simplify, out-of-the-box) β shown as distinct steps.
- Self-critique, recurring β the meta-review agent re-questions its own leaderboard: are these really the best hypotheses? what are the flaws, the wrong conclusions, the suspect citations? Its thinking shows in the feed.
- Stress-test the top 3 β the headline stage. Each finalist is adversarially probed: search for contradicting evidence, verify every citation, run a feasibility check, and design a prototype-scale experiment. Surviving weaknesses are fixed, then the finalists are re-ranked head-to-head.
- Meta-review β synthesise the final proposal with inline
[n]citations and a numbered## Referencessection.
Steps 3β5 repeat each round until the leaderboard is stable or the token budget is spent; step 6 runs once, at finalize.
| Agent | Role |
|---|---|
| Generation | Proposes hypotheses via literature review and debate |
| Reflection | Reviews novelty, correctness, testability |
| Ranking | Elo tournament with pairwise debates |
| Evolution | Combines and refines top hypotheses across rounds |
| Proximity | Clusters hypotheses for dedup and matchmaking |
| Meta-review | Recurring self-critique and the final research overview |
A dedicated stress-test stage (config [run] stress_test_top_k, default 3)
runs the adversarial probe on the finalists at the end of a run.
Flip the High risk toggle on the composer to push every agent toward bold,
contrarian, non-derivative hypotheses instead of safe, incremental ones
(config [run] high_risk). Sessions run this way are badged so you can tell them
apart.
The landing composer's Effort picker has three modes controlling how many
parallel generation agents run (RUN_PRESETS in
frontend/src/types.ts; token budget and wall-clock
limit scale up with depth):
| Mode | Initial hypotheses | When to use |
|---|---|---|
| Quick | 5 | Fast sanity check of an idea |
| Standard (default) | 15 | Balanced breadth vs. runtime |
| Deep | 50 | Exhaustive exploration of a goal |
All three runtimes β the in-browser simulator, the webapp Python simulator,
and the real engine β accept up to 50 parallel hypotheses.
Every session is a chat thread. Follow-up messages
(POST /api/sessions/{id}/chat) are routed by intent:
-
Questions about the output β a grounded answer with a compact table and hypothesis chips as illustrations.
-
Tweak / update / fix requests β the engine reruns as a new session whose research goal is exactly:
ORIGINAL IDEA: {idea} FEEDBACK / CHANGE WANTED: {user input (extended, if necessary, by the agent)} Suggest a new method based on the original idea and the feedback / change wanted.The reply links to the new run.
-
Out-of-scope requests β the reply "Currently, Co-Scientist is unable to do this."
To steer a session while it's still running, the feedback endpoint
(POST /api/sessions/{id}/feedback) still accepts directives, preferences,
and per-hypothesis pin/reject.
Agents ground their claims in real literature through four keyless public
APIs that are always on: openalex_search, pubmed_search, arxiv_search, and
europe_pmc_search β giving real papers with resolving DOIs out of the box.
General web_search auto-activates only when you supply a TAVILY_API_KEY or
BRAVE_API_KEY.
Every proposal ends with a numbered ## References section, and inline [n]
markers throughout the text link to it. The real engine builds that list only
from papers actually fetched during literature search (CitedPaper records),
verifies each one, and marks any entry the citation verifier couldn't confirm as
(unverified). Browser-run proposals β simulated or generated by an in-browser
LLM β include well-formed references too.
- Visit the live site β duckyquang.github.io/Co-Scientist
β it opens on a landing page; click Launch the demo to reach the chat
composer (
/chat) - Pick an Effort β Quick (5), Standard (15, default), or Deep (50 initial hypotheses) β and optionally flip High risk on
- Type your research question and send
No account. No API key. No configuration β for the visitor. Type a prompt and
the agents generate, debate, and Elo-rank hypotheses, evolve the best across
rounds, self-critique, and adversarially stress-test the top 3 β then write a
final proposal with Β§-numbered sections, inline [n] citations, and a
## References list, rendered visually with Mermaid diagrams, KaTeX math, and
charts. Every finished proposal also has a shareable microsite view
(View as website, /s/<id>/site) with print-to-PDF export. When it's done,
ask follow-up questions or request changes right in the session thread.
The UI is an academic "graph-paper" design inspired by
GEML: serif typography, mono
micro-labels, a paper-and-grid background, flat 1px-rule cards, and a
red/blue/green accent system. Light and dark follow your OS setting
(prefers-color-scheme) unless you flip the sidebar toggle, and the hypothesis
drawer slides in from the right.
How the live site answers prompts depends on the build (all knobs documented
in frontend/.env.example):
- Prompt-aware simulation (default, no setup). With no credential, the site runs a clearly-labeled in-browser simulation that actually reads your prompt: it extracts the key terms, infers the domain (transport, energy, education, biomedicine, β¦), and generates on-topic hypotheses locally β nothing leaves your device. It reflects the prompt but isn't a live model's reasoning.
- Live reasoning via a baked credential (recommended). Add a free
Groq key as a
GROQ_API_KEYrepo secret β the deploy workflow bakes it into the build (VITE_GROQ_API_KEY) and every prompt is answered for real by Llama 3.3 70B, with nothing for the visitor to enter. A registered Pollinations token (VITE_POLLINATIONS_TOKEN) works as a keyless-style alternative.β οΈ A credential baked into a static site is publicly visible, so use a free, rotatable one you can revoke β never a paid key. (Browsers can't call these providers anonymously, which is why a baked credential enables live reasoning.) - Bring your own key. Any visitor can switch Settings β Your own API key and
paste a Groq key β it stays in the browser's
localStorageand powers live in-browser reasoning on the spot (Groq only in-browser; other providers need a hosted backend).
Prefer a server-side key (not exposed) and richer, web-search-grounded agents? Self-host or point the site at your own backend via
VITE_API_URL.
Want to run your own instance (private data, custom models, no rate limits)?
git clone https://github.com/duckyquang/Co-Scientist.git
cd Co-Scientist
python3.12 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"Groq β free tier, recommended
echo "GROQ_API_KEY=gsk_..." >> .envAnthropic / OpenAI / OpenRouter
echo "ANTHROPIC_API_KEY=sk-ant-..." >> .env
# or OPENAI_API_KEY / OPENROUTER_API_KEYOllama β fully local, no API key
ollama pull llama3.3:70b
# Then set provider = "ollama" in co-scientist.tomlLiterature grounding β no key needed. The openalex_search, pubmed_search,
arxiv_search, and europe_pmc_search tools query keyless public APIs and are always
available, giving agents real papers with resolving DOIs out of the box. General
web_search auto-activates only when you set TAVILY_API_KEY or BRAVE_API_KEY.
cd frontend && npm install && npm run build && cd ..
python -m webapp.server --port 8080Open http://localhost:8080 β full dashboard, live agent updates.
Dev mode (hot-reload):
# Terminal 1
python -m webapp.server --port 8080
# Terminal 2
cd frontend && npm run dev # proxies API β :8080docker compose up --build
# β http://localhost:8080Host your own public instance at $0/month:
| Service | What it hosts | Cost |
|---|---|---|
| Groq | AI inference (Llama 3.3 70B) | Free tier |
| Oracle Cloud Always Free | Python backend (ARM VM) | Free forever |
| Vercel / GitHub Pages | React frontend | Free |
Full guide: deploy/oracle/README.md
Quick steps:
- Create an Ubuntu ARM instance on Oracle Cloud Always Free (
VM.Standard.A1.Flex) - SSH in and run:
curl -fsSL https://raw.githubusercontent.com/duckyquang/Co-Scientist/main/deploy/oracle/setup.sh | bash - Set
VITE_API_URL=https://api.yourdomain.comin your Vercel/GitHub Actions env vars - Deploy the frontend β done
User goal (browser)
β
βΌ
ββββββββββββββββββββββββββββββββββββββββ
β Python backend (webapp/server.py) β
β SQLite Β· SSE live stream Β· REST API β
ββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββ Simulator / real engine βββ
Generate hypotheses (literature review + debate)
β
βΌ
Reflect (novelty Β· correctness Β· testability)
β
βΌ β
Elo tournament β loop each round
β β until the board
βΌ β is stable or the
Evolve top ideas β token budget is
(multi-round) β spent
β β
βΌ β
Self-critique β
β
βΌ
Stress-test the TOP 3 βββ the headline stage
Β· search for contradicting evidence
Β· verify every citation
Β· feasibility + prototype-scale experiment
β
βΌ
Apply fixes β final head-to-head re-rank
β
βΌ
Meta-review proposal
(inline [n] citations + numbered References)
Proximity clustering runs throughout for dedup and matchmaking.
Layered config: config/default.toml β ~/.co-scientist/config.toml β ./co-scientist.toml
| Provider | Env var | Free tier |
|---|---|---|
groq |
GROQ_API_KEY |
β Yes β Llama 3.3 70B |
gemini |
GEMINI_API_KEY |
β Yes β Flash 1M tokens/day |
anthropic |
ANTHROPIC_API_KEY |
β Paid |
openai |
OPENAI_API_KEY |
β Paid |
openrouter |
OPENROUTER_API_KEY |
Varies |
ollama |
(none) | β Local |
co-scientist run "Identify hypotheses about microbiome-driven inflammation" --n 3
co-scientist serve # web dashboard (recommended)
co-scientist report <id>co_scientist/ # Python engine β agents, LLM, storage
frontend/ # React 18 + Vite + Tailwind dashboard
webapp/ # Stdlib HTTP server, simulator, seeder
config/ # default.toml + agent prompts
deploy/ # Oracle Cloud & Docker setup scripts
| Target | Command / workflow |
|---|---|
| GitHub Pages (static) | .github/workflows/deploy-pages.yml |
| Oracle Cloud (full backend) | deploy/oracle/README.md |
| Docker (local / VPS) | docker compose up |
Apache-2.0 β see LICENSE.