Skip to content

Add "deep search" — multi-step iterative research mode #66

Description

@nazim117

Problem

The web-search toggle added recently (POST /chat's web_search flag) does one search, folds the top results into the prompt, and answers in a single LLM call. That's fine for a quick lookup, but a real research/study task ("give me a thorough rundown of X") often needs multiple rounds: search, read a few of the most promising pages in full, decide what's still missing, search again, then synthesize.

Proposal

A "deep search" mode as a heavier alternative to the existing toggle:

  1. Initial web_search call(s) to survey the topic.
  2. Use mcp-server's existing web_fetch tool (already implemented in internal/tools/web.go, but never called from chat-agent — same gap the basic web_search toggle had before this session) to pull full content from the most relevant results.
  3. Let the LLM iterate — identify gaps, issue follow-up searches — bounded to a fixed number of rounds to keep cost/latency predictable.
  4. Produce a longer, structured synthesis with citations back to every source used, reusing the existing citation mechanism.

Relationship to other issues

Pairs well with #65 (cross-source synthesis) but is specifically about the web rather than ingested documents. Should stay a distinct, explicit mode (not the default toggle) given the extra latency/cost of multiple search+fetch round-trips.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions