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 innexo-coreandsrc/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
WebSearchProvidertrait — 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
languagedirective and the# LINK CONTEXTblock: 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_prometheusstitches into the exposition response. - types
- Public input/output types.