Find answers from the community

s
F
Y
a
P
Updated 7 months ago

I noticed that my Agent has been using

I noticed that my Agent has been using the same tool in the same way repeatedly in one single chain-of-thought, probably due to the LLM being feeble and its context window being small.

How do implement a sort of "memoization" feature such that when I detect that this happens, instead of calling the tool, the code tells the LLM (perhaps as an appended System Message) saying that "you've tried this no long ago. Try something else."?

I can do this comfortably in vanilla Python (by implementing a decorator that wraps around the Python functions that I called to_tool for), but I wonder if there's a more conventional way to do this, esp. with the 0.10.x overhaul?
V
1 comment
The repetitive pattern can be really noticeable:
Attachment
Screenshot_2024-03-18_at_23.20.09.png
Add a reply
Sign up and join the conversation on Discord