[Question]: What context does the assistant (RagFlow chat) use when answering the question(s)
Self Checks
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (Language Policy).
- [x] Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
- [x] Please do not modify this template :) and fill in all the required fields.
Describe your problem
How can I see which context the assistant (RagFlow Chat) uses when answering the question(s) - only the current question or all the questions that were in the current session?
RagFlow Chat uses the entire conversation history from the current session as context when answering questions, not just the most recent question. All previous messages in the session (except system messages) are included and sent to the language model, as long as the total length does not exceed the model's context window size. This means the assistant's responses are based on the full session history, allowing for context-aware answers and multi-turn conversations. This behavior is consistent regardless of whether the "multi-turn optimization" feature is enabled; that feature only rewrites the current question for clarity, but all message history is always included in the context sent to the model reference reference.
If you want to see exactly what context was sent to the model for a specific answer, you can use the light bulb icon above the latest successful dialogue in the UI, which shows the prompt and context sent to the model reference.
To reply, just mention my name @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
The entire chat history will be sent to LLM.
This can easly cross LLM context window and thats why i think i am getting ERROR: INVALID_REQUEST - Error code: 400 - {'object': 'error', 'message': 'max_tokens must be at least 1, got -817.', 'type': 'BadRequestError', 'param': None, 'code': 400} after couple of messages. Seems chunks are increasing context window