Proposal: opt-in turn-0 tool selection (BM25F + embeddings)
Author: CjS77Created Sep 27, 2026Updated Sep 27, 2026
Summary
When a conversation starts, use its first user message to predict which tools it will need. Rank candidates with hybrid BM25F + embedding scoring. Then:
- Advertise only the predicted tools, plus the four discovery bridges (
tool_search,tool_describe,tool_call,result_read) and an operator-configured floor. - Freeze that
toolsarray for the rest of the conversation. - Everything else, including today's core tools, stays reachable through
tool_searchthentool_call.
The mode is off by default (REBORN_TOOL_PREFETCH=off).
Why
- Round trips. Resolves Step 7 of #7405 ("how much latency remains after removing the describe round trip"). After #7410, a non-core tool still costs one extra model round trip.
tool_searchitself is local BM25F and cheap, but 1 model call is spent spent on deciding to search + the call that reads the results. This approach lets us call tools directly on the first turn. - Tokens. Advertising a handful of predicted schemas instead of the 29 core tools plus the promoted set makes the prefix of every request smaller.
- Prompt cache. Fully compatible with #6986 and #6987. The array is chosen once and never changes, and promotion is turned off in this mode.
Concerns addressed up front
- Who owns the core set. #7405 says the core set and profile pins belong to the profile/policy owner. This mode does not change that: it is opt-in.
- Prompt text naming tools. Any prompt text that names a tool is rendered only when that tool is advertised See #7836.
- Retained core tools. Operators can override the set of tools to always keep in the turn 0 array
- Topic drift. The model is told to use
tool_searchfor anything outside the advertised set, and to suggest a new conversation when the topic changes entirely. - Confidentiality. The first user message is sent to the embedding endpoint. We recommend a local endpoint, and the query is never logged.
Prior work
- #5972 — the same idea for v1. It was closed only because of the Reborn rewrite, with an invitation to do a Reborn version. This is that version.
- #7405 — step 7 above. BM25F stays the relevance authority: we fuse embedding scores with it, we do not replace it.
- #7411 — swappable retrieval provider. This proposal is its "first alternate provider", and we would adopt it with the review findings fixed.
- #6986 / #6987 — cache stability.
- #7836 — the availability rule, applied here to selection candidates as well.
- #6942 — why embeddings come back: this is a real consumer for them.
Benchmark plan
We will publish numbers before asking for a merge:
- Baseline: current behaviour (core tools + promotion + search).
- Selection arms: lexical-only, embedding-only, and hybrid selection.
- Scale: each arm at 100, 500 and 1,000 installed tools.
Measured for each run:
- model round trips per task;
- time to the first correct tool call;
- advertised schema tokens per request;
- selection hit rate (did the needed tool appear in the advertised set);
- cache-signature stability across the conversation;
- task accuracy.
Source: nearai/ironclaw