Skip to content

[AI] Tool selection at scale — pre-filter tools before LLM #20

Description

@pluginslab

Problem

The ReAct agent currently sends ALL registered tool descriptions to the LLM on every request. At 14 tools (~2K tokens) this works fine. At 30+ tools, the tool list alone eats most of the 4096-token context window, leaving no room for reasoning.

Goal

Implement a pre-filtering layer that narrows 30+ tools to the 3-5 most relevant before passing them to the LLM.

Proposed Approach (RLM-inspired)

  1. Phase 1: Use existing keyword matching + ability descriptions to score and rank candidate tools (no LLM cost, instant)
  2. Phase 2: Inject only selected tool schemas into the ReAct system prompt
  3. Phase 3: Add a search-tools meta-ability so the LLM can request additional tools mid-loop if needed

Key Files

  • src/extensions/services/message-router.js — existing keyword matching
  • src/extensions/services/react-agent.js — system prompt construction
  • src/extensions/services/chat-orchestrator.js — tool list building

Context

Skills needed

AI/ML, JS

Activity

  1. pluginslab commented on Mar 20, 2026

    @pluginslab
    OwnerAuthor

    Issue #37 proposes the concrete implementation for this: contextual skill loading with progressive disclosure. Skills group abilities by domain, agent sees a compact index by default, and loads full tool definitions on demand via load_skill.

    See #37 for the full architecture and implementation plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-mlAI/ML and LLM workhackathonCloudFest Hackathon 2026

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions