A minimal “deep research” pipeline built with TypeScript + Bun + OpenAI API + SerpAPI.
-
Create
.envfrom.env.exampleand fill keys. -
Install deps:
bun install- Run:
bun run research "Explain the current state of solid-state batteries and commercialization challenges"Output lands in out/report.md.
It also writes out/report.state.json with the full intermediate state (plan/searches/sources/evidence/logs).
- Plans sub-questions + queries (OpenAI)
- Searches via SerpAPI
- Fetches pages and extracts text
- Extracts evidence items per source (OpenAI)
- Synthesizes a cited Markdown report (OpenAI)
bun run research "..." --out out/report.md --max-urls 12 --timeout-ms 120000 --engine google --model gpt-5-miniIncrease timeout (useful for slower models):
bun run research "..." --timeout-ms 180000Disable caching:
bun run research "..." --no-cache- Looking for Chinese docs? See
README.zh-CN.md.