One tool call per question: how to route spreadsheet QA across chat files vs knowledge base

Jason-Ping · reddit · 2026-10-16

A developer building a chat agent with two tools—analyzespreadsheet (pandas code over chat attachments, with a layout map to skip title/totals rows) and searchknowledge (RAG over shared org files)—faces a design problem: spreadsheets are becoming persistent knowledge, and questions about them need code execution, not passage search. Constraints: one tool call per question, the UI card must say "knowledge base", and RAG behavior must stay unchanged. He weighs three options: (A) a new analyzeknowledgespreadsheet tool with an inner agent that gets layout, runs code up to 3 times and returns figures—his pick, plus use/don't-use description lines and a 20-prompt routing test; (B) a mode on searchknowledge—rejected since search and code execution are different jobs and substring matching could hit the wrong file; (C) a knowledge source on analyzespreadsheet—rejected because fetching layout either bloats the prompt or breaks the one-call constraint. He asks whether a fourth approach exists and how others handle same-capability, different-source tool routing.

Original post →

More from coding & agent

coding & agent channel →