background_agents.research_agent module

Research agent – multi-step research with tool usage.

Performs comprehensive research by: 1. Creating a research plan 2. Executing each step (web search, scraping, etc.) 3. Synthesising findings into a structured report

Designed to be invoked from the research_tool or directly.

async background_agents.research_agent.run_research(query, openrouter, redis=None, task_id='')[source]

Execute a full research workflow and return the report.

Parameters:
  • query (str) – The research question.

  • openrouter (Any) – An OpenRouterClient instance (provides .chat()).

  • redis (Any | None) – Optional async Redis client for progress updates.

  • task_id (str) – Optional identifier for progress tracking in Redis.

Return type:

dict[str, Any]