Session
ZZZ REUSAR - Stop Sending Every Tool on Every Call
Your agent has a big toolbox. Every call sends the description of every tool, whether the user asks about the weather or a hotel room. You pay for all of them, every time.
Send only the tools that fit the question. Embed each tool description once, embed the question, keep the closest few, and a hook swaps them in before the agent runs. Learn this semantic tool selection in Python, see the token counts side by side, and the risk to watch: a tool filtered out cannot be called.
What you'll learn:
• A way to measure what your tool descriptions cost on every model call
• Python code for a hook that keeps only the closest tools per request
• A long-lived agent whose memory survives the trimming
• A check that the right tool still makes the cut
• Tips for tool descriptions that embeddings can tell apart
Outline:
• Every call sends every tool
• Pick the closest tools with embeddings
• A hook that sends only those tools
• Keep the conversation across turns and restarts
• When the right tool gets filtered out
• Resources and Q&A
Elizabeth Fuentes Leone
Developer Advocate
San Francisco, California, United States
Links
Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.
Jump to top