The context chat engine just retrieves context on every query, and puts it in the system prompt. It can chose to use that information or answer without it by default. A more strict system prompt will change that behaviour
Yes I understand the core idea of ContextChatEngine, very attractive actually. But I prefer to use OpenAIAgent for a few reasons.
For example the user input is, "Hi My name is Rendy, and know about the Russo-Ukraine War, what do you know about that event?"
ContextChatEngine will use the whole input as input for QueryEngine,
While OpenAIAgent will only use the "Russo-Ukraine War" as input.
So if you have a system that show the source_nodes as UI element, it because doesn't make sense to user eye. Because they don't know if that sources_nodes actually used to generate the response or not.
For OpenAIAgent, if the agent decided to not use the QueryEngineTool, the source_nodes from response object remain empty. So user immediately know.