codetether_agent/search/mod.rs
1//! # Search — LLM-routed search across grep, glob, web, memory, and RLM.
2//!
3//! The router uses `codetether models` discovery (via [`ProviderRegistry`])
4//! plus a single LLM call to pick the best backend for a natural-language
5//! query, then invokes that backend and returns a normalized
6//! [`result::RouterResult`].
7//!
8//! ## Quick start
9//!
10//! ```rust,no_run
11//! # tokio::runtime::Runtime::new().unwrap().block_on(async {
12//! use std::sync::Arc;
13//! use codetether_agent::provider::ProviderRegistry;
14//! use codetether_agent::search::run_router_search;
15//! use codetether_agent::search::model::DEFAULT_ROUTER_MODEL;
16//!
17//! let registry = Arc::new(ProviderRegistry::from_vault().await.unwrap());
18//! let res = run_router_search(registry, DEFAULT_ROUTER_MODEL, "where is fn main", 1).await.unwrap();
19//! assert_eq!(res.runs.len(), 1);
20//! # });
21//! ```
22
23pub mod dispatch;
24pub mod engine;
25pub mod model;
26pub mod parse;
27pub mod prompt;
28pub mod request;
29pub mod result;
30pub mod types;
31
32pub use engine::run_router_search;
33pub use result::{BackendRun, RouterResult};
34pub use types::{Backend, BackendChoice};