I would like to know if there is any way to force the execution of a tool by the Agent.
similar to the documentation below
To force the model to always call one or more functions, you can set tool_choice: "required". The model will then always select one or more function(s) to call. This is useful for example if you want the model to pick between multiple actions to perform next.
To force the model to call a specific function, you can set tool_choice: {"type": "function", "function": {"name": "my_function"}}.
To disable function calling and force the model to only generate a user-facing message, you can either provide no tools, or set tool_choice: "none".
However, sometimes the agent doesn’t execute the tool to fetch “context” from my vector storage, especially for generic questions like “How to open our webmail?”
When the agent already has a (generic) answer, it doesn’t execute the tool. For now, I’m retrieving the context beforehand and sending everything to the agent.
With AI a lot matters. A slight change in prompt can result in a totally different answer. Am pretty sure in your case you will get the generic response. Why? You have not instructed your AI not to give you generic responses
That is a generic question and so a general answer will be given
Try this in the prompt
Always respond with data from our database. If you dont know the answer, never make one up,instead, respond back to the user asking for more context