Weave documentation
Rust referenceweave-browser-engine

weave-browser-engine · research

Source declarations, signatures and documentation for research.

Reviewed implementation boundary: The serve path warns but still binds when WEAVE_API_KEY is absent; the authentication check then allows requests. Configure and verify authorization before exposing a server. See /libraries/weave-browser-engine/research-server.

Source: sigil/weave/libs/weave-browser-engine/src/research.rs. SHA-256: df6f3d112c217aa1f72f2fae152b3e56333ec1eae83b1d3d186ab6459b2190a9.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

research::ResearchConfig

Configuration for a research session.

#[derive(Debug, Clone)]
pub struct ResearchConfig {
/// The topic or question to research.

pub topic: String,
/// How many iterations of search-fetch-extract to perform (1..=5).

pub depth: u8,
/// Maximum number of sources to consult per iteration.

pub max_sources: usize,
/// Whether to cross-verify claims across sources.

pub verify: bool,
/// Search engine name (passed to [`search::search`]).

pub engine: String
}

Source line: 24.

research::ResearchConfig::new

Create a new research configuration.

pub fn new(topic: impl Into<String>) -> Self;

Source line: 39.

research::ResearchConfig::depth

Set the research depth (clamped to 1..=5).

pub fn depth(mut self, depth: u8) -> Self;

Source line: 50.

research::ResearchConfig::max_sources

Set the maximum sources per iteration.

pub fn max_sources(mut self, max: usize) -> Self;

Source line: 56.

research::ResearchConfig::verify

Enable or disable cross-verification.

pub fn verify(mut self, verify: bool) -> Self;

Source line: 62.

research::ResearchConfig::engine

Set the search engine name.

pub fn engine(mut self, engine: impl Into<String>) -> Self;

Source line: 68.

research::research

Run the deep research loop and return structured results.

This is the main entry point for the research engine. Uses the default DuckDuckGo search backend.

pub async fn research(config: &ResearchConfig) -> BrowserResult<Value>;

Source line: 91.

research::research_with_engine

Run the deep research loop with a custom search engine.

pub async fn research_with_engine(
    config: &ResearchConfig,
    _custom_engine: Option<&dyn SearchEngine>,
) -> BrowserResult<Value>;

Source line: 96.

On this page