Find answers from the community

Updated 2 years ago

hi is there a way to maintain context in

At a glance

The community member is asking if there is a way to maintain context in their query_engine.query() function, so that the question can refer to previous questions and answers. The comments suggest that the community member can either use a chat engine or manually manipulate the prompt templates before calling the query function each time. However, the per-LLM context limit would still apply in the latter approach, whereas the chat engine would read the chat history and write its own query to the index.

hi, is there a way to maintain context in my query_engine.query()? i.e. i want the question also to refer to the previous questions and answers
L
r
3 comments
You'll need to either use a chat engine for that, or manually manipulate the prompt templates before you call query each time
thanks! and then the per-LLM context limit applies?
Sadly yes, although the condense chat engine reads the chat after a user asks a question, and then writes its own query to the index. Whereas the latter approach would just have the chat history in the prompt for the index
Add a reply
Sign up and join the conversation on Discord