Skip to main content

Module classifier

Module classifier 

Source
Expand description

§ICE Classifier / Router

Implements the Interpreter-Classifier-Executor cognitive architecture inspired by OpenAgent’s cortex design.

§Overview

Before sending a large prompt to the LLM, the classifier:

  1. Interprets the user’s intent from their message
  2. Classifies the task type (coding, research, file ops, etc.)
  3. Routes only the relevant tools into the LLM context

This reduces token usage and prevents “tool overload” where having too many tools degrades LLM performance.

§Architecture

User Input
    │
    ▼
┌──────────────┐
│ Interpreter  │  Extract intent + entities
└──────┬───────┘
       │
       ▼
┌──────────────┐
│ Classifier   │  Map intent → task category
└──────┬───────┘
       │
       ▼
┌──────────────┐
│ Router       │  Filter tools for category
└──────────────┘

§Example

use bob_runtime::classifier::{Classifier, HeuristicClassifier};

let classifier = HeuristicClassifier::new();
let routing = classifier.classify("read the file src/main.rs", &tools).await;
// routing.filtered_tools only contains file-related tools

Structs§

ClassificationResult
Classification result with confidence and routing information.
HeuristicClassifier
Heuristic keyword-based classifier.
PassThroughClassifier
No-op classifier that returns all tools without filtering.

Enums§

TaskCategory
Task categories for classification.

Traits§

Classifier
Trait for task classifiers.