Dropping the vector DB from agent tool selection: same recall, cost basically gone
BenefitGrand8752 · reddit · 2026-09-18
A developer running a self-hosted personal assistant (local Gemma planner, 96 tools, Telegram + HTTP) removed the embedding model from tool selection entirely — recall didn't move, and cost basically disappeared.
The approach
- Old: embed tool descriptions + query (BGE-M3, ONNX), nearest-neighbor top-k
- New: token overlap over tool names plus four typed rules; pure CPU, 17ms, no model loaded
- Key insight: tool names follow a closed compositional grammar (verbobject[qualifier], 23 verbs × 21 objects, e.g. readfilespdf), so query and tool tokens share a small lexicon and plain overlap is already strong — embedding becomes redundant
- Rules: path/extension boosts, query-pattern boosts, verb→producer-family compatibility, rare-token-unmatched penalty
Numbers
- Benchmark: 96 real tools, 234 organic queries, frozen corpus, deterministic, ground truth = actual production calls
- Production config: Recall@5 0.786, Recall@1 0.487, 10ms mean; token-flat tied the dense baseline at every catalog size
Context
- Lexical beating dense is already documented: BM25 NDCG@5 0.853 vs 0.834 dense on ToolBench (arXiv:2502.15526); tool-name fragility in arXiv:2505.18135; best practice remains hybrid retrieval
- The novel framing: deliberately engineering a closed vocabulary so retrieval doesn't need to solve fuzzy semantics. Benchmark is public and reproducible.
A compelling 'less is more' datapoint for agent tool orchestration: if embeddings buy nothing, they just cost money on low-power boxes.
More from coding & agent
- 3 Engineers Share 10 GrokBot Prompts They Used to Build a Money-Making Company — msharmas · 2026-09-18
- Why LLMs write docs about deleted code: "the past is always stored in git" — ZeroStateReflex · 2026-09-18
- New plugin brings Apple's 20B on-device Foundation Models into OpenClaw — film_girl · 2026-09-18
- Parley launches self-serve legal software built agent-first, with live-updating case data — ycombinator · 2026-09-18
- Hydro merges Verus-checked commutativity proofs for distributed systems with zero hand-written specs — ShadajL · 2026-09-18
- 5 Code Review Skills Tested Across 30 Sessions: Vercel's Wins Overall — bootstrapper-919 · 2026-09-18