A small CLI that takes a question, researches it on the web, and writes a cited Markdown report.
Two reasons:
- Port Open Deep Research from LangChain to the Vercel AI SDK. The original is a great example of multi-agent research orchestration. This is a from-scratch reimplementation on top of the Vercel AI SDK to see how the same ideas translate.
- Practice Matt Pocock's Claude skills. The skills under
.claude/skills/(tdd,grill-with-docs,to-prd,to-issues,setup-matt-pocock-skills) were used throughout to plan, document, and implement features.
One run goes through these phases:
- Clarify — optionally ask one follow-up question to sharpen the input.
- Brief — turn the question into a precise research target.
- Plan — split the brief into sub-topics.
- Research — run one researcher per sub-topic in parallel. Each does a bounded web-search loop and returns compressed findings with sources.
- Gap-fill — at most one extra round to cover anything missing.
- Write — produce the final Markdown report with numbered citations.
Each run is saved under reports/<timestamp>/ as state.json plus report.md.
See CONTEXT.md for the full vocabulary and docs/adr/ for design decisions.
Requires pnpm and an Vercel AI Gateway API key.
pnpm install
export AI_GATEWAY_API_KEY=...
pnpm research "What are the tradeoffs of SQLite vs Postgres for small SaaS apps?"
Options:
--no-clarify— skip the clarification turn--max-parallel <n>— cap concurrent researchers (default 4, max 32)--out-dir <path>— override the output directory--from-state <path>— resume from a savedstate.json--debug— verbose logs
pnpm research "<question>"— run the CLIpnpm test— run testspnpm test:live— live smoke test (needsRUN_LIVE=1andAI_GATEWAY_API_KEY)pnpm typecheck— type checkpnpm lint/pnpm format— eslint / prettier
- Scripts run via
node --strip-types— no build step. - Tests live next to source files (
foo.ts/foo.spec.ts).