3.7 KiB
Phase 7 — Orchestration / Conversation (the CI-expert subagent)
Build last; sits atop
04/05(and06for the ongoing mode). The multi-agent chat runtime (deepagents, subagent dispatch, streaming, citation middleware) is shipped. Net-new here = one builtin subagent + its tools + its prompt. Locate code by symbol/grep.
Objective
Ship the intelligence_agent — a builtin CI/scraper-expert subagent that delivers the product through
plain conversation: understand intent, compose scraper verbs (04), answer in plain language, and hand
standing needs to the ongoing "keep watching" mode (06). It reasons over chat history to report what's
new vs prior tool outputs already in context.
The subagent
New builtin subagents/builtins/intelligence_agent/, peer to research/deliverables, packed via
pack_subagent. Files follow the existing pattern: agent.py (build_subagent), tools/index.py
(NAME · RULESET · load_tools), description.md (router one-liner), system_prompt.md (the playbook).
The main agent delegates CI-/scraping-flavored requests to it via description.md.
The playbook (system_prompt.md)
- Intent routing — one-shot ("compare/find/what is") → compose verbs & answer; standing concern
("watch/track/notify when/weekly") → hand to
06; ambiguous → ask one question ("just once, or keep watching?"). - Verb composition — chains
web.discover → web.scrapeandmaps.search → maps.place → maps.reviews; infer URLs/queries/locations from context. - "What changed" — re-invoke the verb and compare against prior tool outputs in the chat history, summarizing what's new.
The toolset (load_tools)
| Tool | Wraps | Billing |
|---|---|---|
capability verbs (web.scrape, web.discover, maps.search, maps.place, maps.reviews) |
04 executors (direct-return) |
03c turn accumulator (as scrape_webpage does) |
start_watch(intent) (deferred) |
hands off to 06 |
per re-invocation (design with 06) |
Capability verbs are a shared, registry-generated tool module (04) that research can also load; the
intelligence_agent adds the CI prompt and the 06 handoff.
Boundaries
- The subagent drives the
04verbs via tools; fetch/bypass/clean logic stays in Acquisition +04, callable headless. - Humans get the agent; REST/MCP callers call
04verbs directly, skipping this subagent.
Work items
- Subagent scaffold:
subagents/builtins/intelligence_agent/(agent.py/tools/index.py/description.md/system_prompt.md), packed viapack_subagent. - CI playbook prompt: intent routing (one clarifying question), verb chains, "what changed" reasoning.
- Shared verb tool module: registry-backed (
04), reusable byresearch. start_watchseam to06(wired when06is designed).- Router registration:
description.mdfor main-agent delegation.
Tests
- A CI-/scraping-flavored request routes to
intelligence_agent; a non-CI request does not. - "compare X and Y" composes verbs and answers in plain language, persisting nothing.
- "reviews for the top 3 coffee shops near me" chains
maps.search → maps.place → maps.reviews. - A follow-up re-invokes the verb and reports new items vs prior in-context outputs.
- "watch this weekly" routes to the ongoing mode, not a one-shot answer.
Out of scope
- Verbs, doors →
04/05. Ongoing/periodic mechanism →06. - Richer multi-step playbooks, proactive suggestions, cross-topic synthesis.
- Frontend CI surfaces → frontend umbrella.
Open questions
- Whether CI one-shot scraping stays in
researchor theintelligence_agentowns all CI-flavored calls. - The
start_watchhandoff shape (settled with06).