Skip to main content

Crate nexo_web_search

Crate nexo_web_search 

Source
Expand description

Multi-provider web search.

Native built-in tool that an agent can call as web_search(query, ...). The runtime selects a provider (Brave / Tavily / DuckDuckGo / Perplexity), consults a shared SQLite cache, runs the call through a circuit breaker, sanitises the output, and (optionally) expands top hits via the [LinkExtractor].

Boundary:

  • This crate owns the trait, the router, the cache, the providers, and the result types.
  • It does not know about [nexo_core::AgentContext], the LLM tool registry, or YAML loading. Wiring lives in nexo-core and src/main.rs.

Re-exports§

pub use cache::CacheStats;
pub use cache::WebSearchCache;
pub use provider::WebSearchProvider;
pub use router::ProviderState;
pub use router::WebSearchRouter;
pub use types::Freshness;
pub use types::WebSearchArgs;
pub use types::WebSearchError;
pub use types::WebSearchHit;
pub use types::WebSearchResult;

Modules§

cache
SQLite-backed cache. One table, one connection pool. Shared across every agent in the process.
provider
WebSearchProvider trait — every backend implements this.
providers
router
Provider selection + cache + breaker glue.
sanitise
Defense-in-depth scrubber for SERP text before it lands in the prompt. Same philosophy as the language directive and the # LINK CONTEXT block: SERPs are attacker-controlled input.
telemetry
Prometheus telemetry for the web-search router. Exposes counters, histogram, and a render block that nexo_core::telemetry::render_prometheus stitches into the exposition response.
types
Public input/output types.