Skip to main content

Module search

Module search 

Source
Expand description

§Search — LLM-routed search across grep, glob, web, memory, and RLM.

The router uses codetether models discovery (via [ProviderRegistry]) plus a single LLM call to pick the best backend for a natural-language query, then invokes that backend and returns a normalized result::RouterResult.

§Quick start

use std::sync::Arc;
use codetether_agent::provider::ProviderRegistry;
use codetether_agent::search::run_router_search;
use codetether_agent::search::model::DEFAULT_ROUTER_MODEL;

let registry = Arc::new(ProviderRegistry::from_vault().await.unwrap());
let res = run_router_search(registry, DEFAULT_ROUTER_MODEL, "where is fn main", 1).await.unwrap();
assert_eq!(res.runs.len(), 1);

Re-exports§

pub use result::BackendRun;
pub use result::RouterResult;
pub use types::Backend;
pub use types::BackendChoice;

Modules§

dispatch
Dispatch a BackendChoice to the underlying tool implementation and return its ToolResult. Each backend is invoked inline so the router does not require access to the full ToolRegistry.
engine
End-to-end: resolve model → ask router → run chosen backends → collect.
model
Resolve a router provider/model string against the live ProviderRegistry.
parse
JSON parser for the router LLM response.
prompt
Prompt builder for the LLM-based search router.
request
Build the CompletionRequest used to ask the router model for a plan.
result
Normalized result type produced by the router and consumed by the CLI.
types
Types shared between the search router, its backends, and the CLI.