Implementing an LLM Router Agent-Based RAG: An 8-Tool Design and 5 Traps Hit on Cloudflare Workers + Azure OpenAI
A record of adding a Router Agent — in which the LLM looks at the question and automatically picks the right tool — to a vector-search RAG over a corpus of classical documents in TEI/XML. It covers the design of the 8-tool setup, the complementarity of structured data and vector search, and the 5 traps hit during implementation (Cloudflare Workers' 3 MiB limit, the Azure OpenAI URL pattern, a blind spot in JSON_CONTAINS, the multi-turn problem with reasoning models, and the TPM bottleneck).
ragllmagenttool-calling