AGENT 01 / 07
Researcher
A general-purpose worker for the fleet. It gathers context, inspects sources and code, and returns cited findings that any downstream task can use; web research is one mission among many.
researcher · autonomous
01What it does
One loop, built to gather truth
The agent loop
LLM → tools → repeat, up to 50 iterations per agent — with true token streaming: text deltas arrive live, tool calls are assembled from stream fragments, and a broken stream falls back to a plain completion instead of failing.
Mission workflow, codified
A worker can compose a fixed arc: discover context → gather and inspect sources → verify key details → persist structured outputs. Research is one use case; the same loop supports code, operations, and knowledge work.
Hierarchical fan-out
spawn_agent grows a tree of sub-agents up to max_depth, with explicit context handoff and inherited token budgets. Background mode detaches a child and delivers its result later as a notice — the parent keeps working.
Cite or it did not happen
A source-quality hierarchy ranks academic above official above news above blogs above forums. Every finding records its URL; sources.md dedupes citations across the whole fleet.
Multi-format intake
web_fetch and web_crawl for pages, web_feed for RSS / Atom / sitemaps, analyze_image for screenshots and documents, pdf_extract for filings, code_symbols + repo_map for codebases.
Untrusted by design
Fetched pages are framed as untrusted data and scanned for prompt-injection patterns before entering context; the SSRF guard blocks internal IPs on every fetch and every redirect hop.
02How it works
From mission to durable findings
Plan
The coordinator decomposes the request into non-overlapping subtasks and persists them; each task receives explicit context, limits, and review requirements.
Fan out
Each subtask becomes a role-aware worker — an in-process JoinSet task or an isolated OS worker process — with its share of the session token budget.
Worker loop
Inspect → transform → verify → record, with tools selected for the mission. Children spawn via spawn_agent up to max_depth; background children report back as notices.
Reflect
Goal Mode’s LLM judge compares the work with the original goal and can request bounded gap-filling rounds until the goal is covered.
Hand off
Budget-capped summaries, structured findings, and deduped sources flow into synthesis and memory — reusable context for any downstream operation.
03Under the hood
The runtime underneath
| agent loop | LLM → tool calls → repeat, max_iterations default 50; steering messages and background notices injected at turn boundaries |
| streaming | stream: true — live text deltas, tool calls assembled from fragments, automatic non-streaming fallback on broken or empty streams |
| spawn_agent | hierarchy up to max_depth (default 2); roles researcher / analyst / verifier / writer; explicit context handoff; background mode |
| fan-out | coordinator splits the query into 2–5 subtasks; JoinSet or OS-process workers (use_multiprocess); max_agents 20 |
| budgets | session_token_limit split across each batch (floor 4,096 tokens); children inherit what is left of the parent’s cap |
| doom loop | 3 identical tool calls in a row → first offense nudges the agent, second offense stops it |
| goal mode | LLM judge compares results with the goal; up to replan_rounds (default 1) gap-filling rounds, at most 3 new subtasks each |
| fetch safety | 2 MiB body cap, 50,000-char text truncation, injection scan, SSRF guard with ≤ 5 redirects re-validated per hop |
| prompt | 3 cache tiers (stable / context / volatile) for prefix-cache hits; memory digest injected at depth 0 |
| stall guard | no progress for 450s → warning; 1200s → the agent is cancelled |
04Tools
What the Researcher can call
Feeds downstream workers
Cited findings become reusable context
Everything the Researcher gathers is reusable context: cited facts, source URLs, code references, and structured outputs with provenance. Findings persist to memory so an outreach, coding, or operations worker can act on the same evidence without starting from zero.
finding #7 person: Jane Doe — CTO, Acme
email [email protected] [verified: MX + SMTP 250]
sources acme.com/team · news: "Acme closes Series B"
signal hiring 6 platform engineers (posted Aug 3)
status saved to contacts → CRM (dedup by crm_id)