1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! The initial text router for Noema.
//!
//! Plain-text user requests are routed before any reasoning model runs.
//! [`NeedleRouter`] uses Needle 2 to decide whether a request is a simple,
//! deterministic application action — "open my flashcards", "go to
//! settings" — or whether it needs the full model:
//!
//! ```text
//! User request
//! ↓
//! NeedleRouter (Needle 2)
//! ├── simple action → RoutedAction (model never runs)
//! └── not recognised → Escalate → Gemma 4
//! ```
//!
//! The actions come from an [`ActionRegistry`] (defaulting to the six simple
//! Agora actions from the plan); each action is exposed to Needle as a tool
//! with a name and description, so the router needs no custom prompts to
//! stay on-schema.
//!
//! # Usage
//!
//! ```no_run
//! use noema_core::Noema;
//! use noema_router::NeedleRouter;
//!
//! # async fn example() -> noema_core::Result<()> {
//! let router = NeedleRouter::from_default()?;
//! let noema = Noema::builder()
//! .with_router(router)
//! // .with_model(gemma) // handles escalated requests
//! .build()
//! .await?;
//! # Ok(())
//! # }
//! ```
pub use ;
pub use NeedleToolFormatter;
pub use NeedleRouter;