Gemini tool retrieval + Code Mode cuts agent input tokens from 564K to 30K on the same task
Prompt Engineering · youtube · 2026-11-30
A walkthrough of combining Gemini API tool retrieval (toolsearch, deferloading) with Code Mode (executing code against MCP tools so raw results stay out of the context window), plus file slicing for PDFs and spreadsheets. The author's demo agent dropped input tokens from 564,000 to 30,000 with the same correct answer, and guidance is given on when to use retrieval vs code mode. Demo code is open-sourced; the author discloses they recently joined Google.
More from coding & agent
- iamtrask: Shapley values plus LoRA partitions could crack LLM knowledge attribution — iamtrask · 2026-12-01
- Vertical AI agent moat: freight agent founder shares his blueprint openly — MatthewChang · 2026-12-01
- Decrypting iOS apps without jailbreak: one ipsw command on Apple Silicon or Linux — dyn___ · 2026-12-01
- Community test: adapter stack cuts agent task time another 27%, passes 10/10 tests — yb2698 · 2026-12-01
- Step 5 API goes live with agent harness support and OpenAI-compatible endpoints — StepFun_ai · 2026-12-01
- Open-source JobFinderOS runs Claude Code agents to hunt jobs across Greenhouse, Ashby and Lever — adnan_hashmi · 2026-12-01