Find answers from the community

Updated last month

Preventing an AI from using chat memory to answer questions

At a glance
Hi, I have a question on using tool calling. I found that when I add tools the AI first makes the decision properly, calling one or another tools according to the prompt. But, after several questions, it stops calling a tool and answers on its own. My guess is at some point, AI starts using the chat memory which has previously asked questions and answers and gets data from there. Am I right? If so, is there any way to prevent looking the answer in the memory? I thought the passing the empty chat memory could be a solution but unfortunately, I can't do it as it may have the specific information from user that my chatbot should be aware of. The forcing to use a tool doesn't work either because it's based solely when the condition described in the prompt, met. Thanks!
L
Z
5 comments
Yea that assumption on behaviour is right. If it has enough info in the chat history it might not call a tool again

The best way to control this is to adjust your system prompt and tool names/descriptions
Hi, thanks for reply. My prompt is super clear "If a user query is in French language, call the Agent_FR. If a user query is in English language, call the Agent_EN". Agent_FR and Agent_EN are 2 tool names. Each has the corresponding description like "Answers all the questions in language X" - but the AI, after getting some information in its memory stop calling them. How can I change the prompt and description to make AI more obedient?
Is that the system prompt?
ooc, why do you need two tools for this? Shouldn't the agent be able to juggle the language properly through basic prompting?

But in any case, my take on this would be to improve the tool names/descriptions if thats already you system prompt

Plain Text
def french_response(input: str) -> str:
  """Utile pour aider à répondre aux utilisateurs français. Si l'utilisateur parle français, cet outil doit être utilisé."""
  ....

def english_response(input: str) -> str:
  """Useful for responding in english. If the user is speaking english, you should use this tool."""
  ...
I need 2 tools because each tool is connected to its own data source and they can read only their own data. If I use one tool, I can't control the access. Let me play with names/descriptions, thanks!
Add a reply
Sign up and join the conversation on Discord