feat: add Task API and Monitor API tools#8071
Conversation
Add 12 new methods to ParallelTools for deep research and continuous web tracking: Task API (deep research with citations): - run_task: synchronous deep research - create_task: async task creation - get_task_result: retrieve completed results - get_task_status: check task progress Monitor API (continuous web tracking): - create_monitor: event-stream based tracking - create_snapshot_monitor: task-output change detection - list_monitors: list all monitors - get_monitor: get monitor details - update_monitor: modify frequency/status - cancel_monitor: stop a monitor - trigger_monitor: force immediate run - get_monitor_events: retrieve detected events Requires parallel-web SDK v0.6.0+.
Add 4 cookbooks based on actual use cases from industry research: - parallel_competitive_intel.py: AI code editor market comparison - parallel_due_diligence.py: startup investment research with citations - parallel_sales_leads.py: funding announcement monitoring and lead enrichment - parallel_research_thesis.py: thesis validation with supporting/contradicting monitors Also switch from logger.* to log_* utilities per codebase convention.
Add POST /webhooks/{agent_id} endpoint that receives webhooks from
external services (Parallel Monitor, GitHub, Stripe, etc.) and invokes
the specified agent with the payload as context.
- New router: libs/agno/agno/os/routers/webhooks/
- Opt-in via enable_webhooks=True on AgentOS
- Agent runs in background, returns run_id immediately
- Cookbook: parallel_webhook_monitor.py shows full pattern
Flow: Parallel detects event → POSTs to webhook → AgentOS invokes agent
→ agent calls get_monitor_events() for details → processes events
- Remove webhook support from ParallelTools (use polling with get_monitor_events instead) - Fix SDK 0.6.0 compatibility: .monitors instead of .data, .next_cursor instead of .has_more - Fix processor options: "base" default instead of invalid "standard" - Fix frequency options: "1h", "1d", "1w", "30d" per Parallel docs - Update class docstring to match codebase patterns - Consolidate cookbooks from 9 to 3 high-value examples - Remove webhook router from AgentOS (revert app.py changes) - Delete unused webhook schema and router files
- Update all tool docstrings to match Gmail pattern - Rename cookbooks for clarity: - parallel_tools.py -> parallel_search.py - parallel_task_api.py -> parallel_task.py - parallel_monitor_api.py -> parallel_monitor.py
- parallel_news_search.py — search latest AI news - parallel_company_research.py — deep research with citations - parallel_funding_tracker.py — monitor funding announcements
…rams LLM cannot decide cost/quality tradeoffs - these are user decisions. Tools now only expose what LLM can infer from context: - run_task(input) / create_task(input) - create_monitor(query) - get_task_result(run_id) / get_task_status(run_id) Toolkit params: - default_processor: Task API processor tier - default_monitor_processor: Monitor API processor (lite/base) - default_monitor_frequency: How often monitors run - default_timeout: Task result timeout - default_output_schema: JSON schema for structured output
- Use 'Example N:' style comments - Remove 'API' language - Remove 'Uncomment to test' blocks - Show toolkit config variations as separate agents - Follow exa_tools.py / tavily_tools.py structure
SDK expects {"type": "json", "json_schema": {...}} not raw JSON schema
…Monitor - Search and Extract tools unchanged from main branch - Added Task API: run_task, create_task, get_task_result, get_task_status - Added Monitor API: create_monitor, list_monitors, get_monitor_events, cancel_monitor - New toolkit params for Task/Monitor config
- Task API: run_task, create_task, get_task_result, get_task_status - Monitor API: create_monitor, list_monitors, cancel_monitor, get_monitor_events - Error handling tests included
|
|
||
| events = [] | ||
| for event in response.events: | ||
| event_data: Dict[str, Any] = { |
There was a problem hiding this comment.
wrong, some does not exist on the parallel sdk
event_data["event_type"] = getattr(event, "type", None) # wrong: field is `event_type`
event_data["created_at"] = str(getattr(event, "created_at", "")) # wrong: field is `event_date`
if hasattr(event, "content"): # wrong: content lives under `event.output`
if hasattr(event, "citations"): # wrong: citations live under `event.output.basis`
There was a problem hiding this comment.
Should be fixed
| - Search API: AI-optimized web search that returns relevant excerpts tailored for LLMs | ||
| - Extract API: Extract content from specific URLs in clean markdown format, handling JavaScript-heavy pages and PDFs | ||
| - Task API: Deep research with structured output and citations (enable_task=True) | ||
| - Monitor API: Track topics over time and get notified of changes (enable_monitor=True) |
There was a problem hiding this comment.
The Parallel SDK exposes monitor.update (change frequency/webhook/metadata) and monitor.retrieve (get one monitor by ID)
| tools=[ | ||
| ParallelTools( | ||
| enable_task=True, | ||
| default_output_schema={ |
There was a problem hiding this comment.
as per their docs output schema can be given in different ways-
we need cookbook showing all.
docs- https://docs.parallel.ai/task-api/task-quickstart#output-schema-types

There was a problem hiding this comment.
added a cookbook
| # Task API — Deep research with structured output and citations | ||
| # ------------------------------------------------------------------------- | ||
|
|
||
| def run_task(self, input: str) -> str: |
There was a problem hiding this comment.
i think we need another look at this- https://docs.parallel.ai/task-api/task-quickstart#polling-vs-webhooks-vs-sse
looks light its async but we have implemented it in a blocking way. read the docs more, we probably need to use that polling or something.
There was a problem hiding this comment.
fixed. let's kep seprate tools so agent can control the task and also run parallel ones
| enable_task=True, | ||
| default_output_schema={ | ||
| "type": "json", | ||
| "json_schema": { |
There was a problem hiding this comment.
Skipped structured input for now. Not sure how it would at toolkit level
There was a problem hiding this comment.
added more good cookbooks
- Fix get_monitor_events to use correct SDK field names: - event.event_type (not event.type) - event.event_date (not event.created_at) - event.output.content (not event.content) - event.output.basis (not event.citations) - Fix parallel_search to use excerpts (plural) not excerpt (singular) - Extract _format_task_output helper to avoid code duplication - Add get_monitor tool (monitor.retrieve) - Add update_monitor tool (monitor.update) - Update cookbook to show all 3 output schema types (auto, json, string) - Update tests to match corrected SDK field names
- parallel_task_options.py: All output schema types (auto, json, string), processor tiers (lite, base, pro), timeout configuration - parallel_monitor_options.py: Frequency options (1h to 30d), processor tiers (lite, base), output schemas, combined configurations
…schema types
Shows the three output schema formats:
1. Auto schema: {"type": "auto"}
2. JSON schema: {"type": "json", "json_schema": {...}}
3. String schema: plain string description
Removes separate option cookbooks in favor of one focused example.
Task API: - Remove run_task() blocking method - Keep create_task(), get_task_status(), get_task_result() for agent control - Rename input param to query to avoid shadowing builtin Cookbooks: - Move to cookbook/91_tools/parallel/ folder - Add 6 focused use-case cookbooks: - output_schemas.py: All 4 output schema types - company_enrichment.py: CRM data enrichment - market_research.py: Industry analysis reports - investment_monitor.py: Track funding & M&A - competitor_tracker.py: Competitive intelligence - news_search.py: Fast web search - Add README with API overview and quick start Fixes: - Auto schema requires 'pro' processor (not 'base') Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous 300s default silently failed for pro/ultra tier tasks, which Parallel documents as taking 3-25 minutes. Also pass the same value as the httpx-level timeout so the client does not give up before the server's api_timeout deadline (httpx default is 600s). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| # ============================================================================= | ||
| # RUN | ||
| # ============================================================================= | ||
| if __name__ == "__main__": |
There was a problem hiding this comment.
https://docs.parallel.ai/monitor-api/monitor-quickstart#monitor-api-quickstart
we have not implemented the monitor api correctly, this definitely needs a webhook otherwise there is no point. We should have that capability that you can pass a webhook url too and that webhook will recieve the events from parallel, thats the main usecase otherwise rn its not really doing anything.
i pushed an update in cookbook cookbook/91_tools/parallel/competitor_tracker.py to show how we get the events via agent in polling like fashion.
The original cookbook only demonstrated create_monitor, leaving the consumer side as a "now what?". Without webhooks, polling is the only consumption path, so the example now has two phases: create monitors on first run, then re-run with `check` to list monitors and pull events. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
## Summary Updates ParallelTools documentation to cover the Task API and Monitor API tools added in agno-agi/agno#8071. **Changes:** - Expanded `tools/toolkits/search/parallel.mdx` from ~80 lines to ~225 lines - Added Task API section with processor tiers (lite/base/pro/ultra) and output schema types - Added Monitor API section with frequency options and two-phase usage pattern - Updated MCP endpoint from deprecated `search-mcp.parallel.ai` to `search.parallel.ai` - Made API key optional (keyless access is rate-limited) - Updated all example pages with current code patterns ## Files Changed | File | Description | |------|-------------| | `tools/toolkits/search/parallel.mdx` | Main toolkit documentation | | `tools/mcp/usage/parallel.mdx` | MCP server usage | | `examples/tools/parallel-tools.mdx` | Toolkit examples | | `examples/tools/mcp/parallel.mdx` | MCP example | ## Related - agno-agi/agno#8071 (feat: add Task API and Monitor API tools) - agno-agi/agno#8202 (cookbook: update Parallel MCP to use free endpoint)


Summary
Extends ParallelTools with Task API (deep research) and Monitor API (continuous web tracking):
Task API — deep research with structured output, citations, and confidence scores
run_task: synchronous research (blocks until complete)create_task: async task creation for long-running researchget_task_result: retrieve completed task resultsget_task_status: check task progressMonitor API — continuous web tracking with scheduled runs
create_monitor: create event-stream monitor for query changeslist_monitors: list all monitors with filtersget_monitor_events: retrieve detected changescancel_monitor: permanently stop a monitorToolkit-level config (user sets, LLM doesn't decide):
default_processor: Task API quality tierdefault_monitor_processor: Monitor API processor (lite/base)default_monitor_frequency: How often monitors run (1h/1d/1w/30d)default_timeout: Task result timeoutdefault_output_schema: Structured output schemaType of change
Checklist
./scripts/format.shand./scripts/validate.shpassenable_*flags,json.dumps()returns, proper error handling