Skip to content

feat(Research): add provider-specific execution guides for researcher agents#1253

Open
Kharsys wants to merge 1 commit into
danielmiessler:mainfrom
Kharsys:feat/research-real-api-execution
Open

feat(Research): add provider-specific execution guides for researcher agents#1253
Kharsys wants to merge 1 commit into
danielmiessler:mainfrom
Kharsys:feat/research-real-api-execution

Conversation

@Kharsys
Copy link
Copy Markdown

@Kharsys Kharsys commented May 13, 2026

Summary

Three of the four Researcher agents (Gemini, Grok, Perplexity) currently have no provider-specific call code anywhere in the Research skill or in the agent files. With no API/CLI wire-format defined, each non-Claude agent collapses to the same backend (built-in WebSearch under a different persona name), so "multi-model research" via Standard / Extensive mode does not actually exercise multiple models. This PR adds the missing execution layer.

What's added

A new directory Releases/v5.0.0/.claude/skills/Research/Workflows/Execution/ with four guides, one per researcher:

  • ClaudeExecution.md documents the WebSearch path (included for parity, no behavior change)
  • GeminiExecution.md documents the gemini CLI invocation with Google Search grounding
  • GrokExecution.md documents the xAI Chat Completions API call with live search enabled
  • PerplexityExecution.md documents the Perplexity Sonar Chat Completions API call

Each guide owns the provider call shape (CLI or curl with jq -n --arg for safe user-input escaping), the model selection table mapped to research modes, citation extraction rules, URL verification via curl, the file-based output JSON schema, and a fallback policy that retries once at a lower model tier then writes a stub error file. Never silently swaps providers.

Agent changes

Each of ClaudeResearcher.md, GeminiResearcher.md, GrokResearcher.md, PerplexityResearcher.md gains step 3 in its Mandatory Startup Sequence: read the sibling execution guide. Existing persona, voice, output format, Research Philosophy and Research Methodology sections are unchanged. Nothing was removed.

SKILL.md change

A new ### Agent Execution Guides subsection under ## Workflow Routing points to the four guides and states the no-silent-fallback policy at the skill level.

File-based output schema

Each Execution guide documents a shared JSON shape for ${research_dir}/<agent-slug>.json:

{
  "agent": "claude|gemini|grok|perplexity",
  "query": "...",
  "summary": ["..."],
  "sources": [{ "title": "...", "url": "...", "verified": true }],
  "confidence": 0.0,
  "full_findings": "..."
}

The schema is shared across all four researchers so a downstream synthesis step can cross-reference findings agnostic of which provider produced them. Current upstream Research workflows synthesize inline as text rather than from files; this schema is therefore forward-looking with respect to the merged tree, standardizing the contract for any future file-based synthesizer. If research_dir is not provided by the caller, each researcher returns the same payload inline and skips file writing.

Correctness property preserved

A researcher whose provider call fails writes a stub file (summary: [], error reason in full_findings) rather than substituting WebSearch. The orchestrator's decision stays explicit: it can surface the gap to the user or substitute a different researcher. Silent substitution would defeat the purpose of multi-model research.

Why no OpenAI / GPT researcher

GPT plus web search via the OpenAI Responses API is architecturally similar to the Claude plus WebSearch path (LLM-with-search, citation-after-generation). It does not add an orthogonal coverage angle that the existing four researchers do not already cover. Grok contributes live X data and STEM strength; Perplexity contributes retrieval-first architecture with citations bundled into the response; Gemini contributes Google Search grounding. Each is structurally different. If a fifth researcher pointed at GPT-4o/5 is desired later, it can be added with the same Execution-guide pattern.

Smoke test recipe

Local setup expects ~/.claude/.env with XAI_API_KEY, PERPLEXITY_API_KEY, and GEMINI_API_KEY populated, plus the gemini CLI installed (validated against v0.39.1).

# Gemini
gemini -m gemini-2.5-flash -p "what is Bun JavaScript runtime" --grounding google_search

# xAI Grok
source ~/.claude/.env
BODY=$(jq -n --arg q "what is Bun JavaScript runtime" \
  '{model:"grok-3", messages:[{role:"system",content:"Research assistant. Cite sources."},{role:"user",content:$q}], search_parameters:{mode:"on"}, max_tokens:512}')
curl -sS -H "Authorization: Bearer $XAI_API_KEY" -H "Content-Type: application/json" \
  -d "$BODY" https://api.x.ai/v1/chat/completions | jq '.choices[0].message.content, .citations'

# Perplexity Sonar
BODY=$(jq -n --arg q "what is Bun JavaScript runtime" \
  '{model:"sonar", messages:[{role:"system",content:"Research assistant. Cite sources."},{role:"user",content:$q}], max_tokens:512, return_citations:true}')
curl -sS -H "Authorization: Bearer $PERPLEXITY_API_KEY" -H "Content-Type: application/json" \
  -d "$BODY" https://api.perplexity.ai/chat/completions | jq '.choices[0].message.content, .citations'

Expected: response content plus at least one citation URL. Missing-key scenarios should produce auth errors that each agent maps to the stub error file documented in the corresponding execution guide.

Diff stat

9 files changed, 583 insertions(+), 4 deletions(-)

… agents

Add four execution guides under skills/Research/Workflows/Execution/ that
own the wire-format details for the four Researcher agents:

  - ClaudeExecution.md      (built-in WebSearch tool)
  - GeminiExecution.md      (gemini CLI with Google Search grounding)
  - GrokExecution.md        (xAI Chat Completions API with live search)
  - PerplexityExecution.md  (Perplexity Sonar Chat Completions API)

Each guide documents the provider call shape, model selection table by
research mode (Quick / Standard / Extensive / Deep), citation extraction
rules, URL verification via curl, file-based output JSON schema, and a
no-silent-fallback policy: a researcher whose provider fails returns a
structured error rather than swapping to a different provider.

Each Researcher agent now reads its sibling execution guide as the third
step of its startup sequence (after voice notification and Context load),
so the agent files stay focused on persona, voice, and output format while
the wire-format detail lives with the Research skill that delegates to them.

The SKILL.md gains an Agent Execution Guides section under Workflow
Routing that points to the four guides.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant