How nimbleway/webrouter works
WebRouter is a Python interface for agent web access: callers use one typed API across multiple search, extraction, answer, research, live-data, and browser providers. The primary workflow normalizes a request, selects or routes it to a provider, and returns a provider-independent response; auto routing can fall back when a provider fails. Separate capabilities expose vendor APIs, MCP tools, agent-framework integrations, and benchmarking/evaluation. The graph follows README-documented behavior and sampled/indexed relationships; several capability implementations were not sampled, so their internal links are omitted.
Main entry points: client.py Router Facade · routing Request Routing · client_search.py Search · client_live_data.py Live Data
Components 20
Client API
- Router Facade
src/web_router/client.py - Search
src/web_router/client_search.py - Live Data
src/web_router/client_live_data.py - Prompt Planning
src/web_router/client_plan.py
Routing and Types
- Request Routing
src/web_router/routing - Provider Registry
src/web_router/registry.py - Typed Models
src/web_router/types.py - Decision Types
src/web_router/types_decision.py - Error Types
src/web_router/exceptions.py
Provider Access
- Provider Contract
src/web_router/providers/base.py - Provider Backends
src/web_router/providers - Live Data Sources
src/web_router/live_data_backends.py - Vendor APIs
src/web_router/vendors
Agent Interfaces
- MCP Server
src/web_router/mcp/server.py - MCP Tools
src/web_router/mcp/tools.py - Agent Integrations
src/web_router/integrations - Command Line
src/web_router/cli/commands.py
Evaluation
- Benchmarking
src/web_router/client_benchmark.py - Evaluation
src/web_router/evals/run.py
Other components
- Application
Connections 25
- Application → Router Facade: calls
- Router Facade → Search: offers search
src/web_router/client.py - Router Facade → Live Data: offers live data
src/web_router/client.py - Router Facade → Prompt Planning: offers planning
src/web_router/client.py - Router Facade → Request Routing: routes requests
src/web_router/client.py - Router Facade → Provider Registry: resolves providers
src/web_router/client.py - Search → Request Routing: dispatches calls
src/web_router/client_search.py - Search → Typed Models: returns models
src/web_router/client_search.py - Live Data → Typed Models: returns models
src/web_router/client_live_data.py - Request Routing → Provider Registry: selects backends
src/web_router/registry.py - Request Routing → Decision Types: records decisions
src/web_router/routing/contract.py - Request Routing → Provider Contract: invokes providers
src/web_router/providers/base.py - Provider Contract → Typed Models: normalizes responses
src/web_router/providers/base.py - Provider Registry → Provider Backends: loads providers
src/web_router/registry.py - Live Data → Live Data Sources: selects sources
src/web_router/client_live_data.py - Router Facade → Vendor APIs: supports vendor calls
- Router Facade → Benchmarking: offers benchmarks
src/web_router/client.py - Benchmarking → Provider Backends: compares providers
src/web_router/client_benchmark.py - Benchmarking → Evaluation: scores results
src/web_router/client_benchmark.py - Application → MCP Server: connects via MCP
- MCP Server → MCP Tools: dispatches tools
src/web_router/mcp/server.py - MCP Tools → Router Facade: uses router API
- Application → Agent Integrations: uses agent tools
- Agent Integrations → Router Facade: wraps router
src/web_router/integrations/langchain.py - Application → Command Line: runs commands