Combine the fetching query pipeline and chat pipeline into one pipeline, with the query pipeline converted into a tool passed to GPT.
With the tool available to gpt and set to always use, gpt is aware of context (prev user messages and its own replies) and it can construct its own queries and uses that to get results relevant to the user's query
Experimental Approach ⚠️
Combine the fetching query pipeline and chat pipeline into one pipeline, with the query pipeline converted into a tool passed to GPT.
With the tool available to gpt and set to always use, gpt is aware of context (prev user messages and its own replies) and it can construct its own queries and uses that to get results relevant to the user's query