infiniflow / ragflow

RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine based on deep document understanding.
https://ragflow.io
Apache License 2.0
16.42k stars 1.67k forks source link

[Question]: RAG-Graph Generate-Answer with history message in chat api #1472

Open SG-XM opened 1 month ago

SG-XM commented 1 month ago

Describe your problem

"I have a very complex graph model, and in one of the processes, I connect an answer generation component with a human-computer interaction component. In this stage, I need to continuously ask the user questions, and each conversation requires the complete history of the dialogue to ensure that the next question does not repeat previous ones. Therefore, I want to know how many past conversations are appended with each API call? And whether any summarization is performed? Additionally, how can I append historical information? My prompt works fine with GPT-4o and can complete multi-turn questioning as required. However, in the ragglow-graph, after several rounds of dialogue, it starts asking repetitive questions. I am also using the GPT-4o model, but I cannot see the detailed OpenAPI POST body, so I cannot determine where the problem is."

KevinHuSh commented 1 month ago

Could you paste the picture of canvas here?

SG-XM commented 1 month ago
image

here is my canvas,in this loop gpt-4o where ask about 21 questions,but after 10+ conversation,model begin to repeat previous question,but with the same prompt in chat.openai.com,gpt-4o, it works well.

SG-XM commented 1 month ago
image

I use this "history" param to append history message,but in fact this editabe text is prompt rather than previous conversation list.

KevinHuSh commented 1 month ago

image I use this "history" param to append history message,but in fact this editabe text is prompt rather than previous conversation list.

It's useless to add history parameter. "回答时请考虑聊天历史" that's enough.

This is about enlarge hisotry window size. We will fixed it later.|

It's meaningless to add ’message‘(人机交互) after ’begin‘ since 'begin' has already include one piece of message.

SG-XM commented 1 month ago

thanks,i have added "回答时请考虑聊天历史" . Could you please add a 'number of previous messages included' setting, similar to other GPT conversation tools (e.g., NextChat)?

It's useless to add history parameter. "回答时请考虑聊天历史" that's enough. This is about enlarge hisotry window size. We will fixed it later.|

SG-XM commented 1 month ago

its still has problem after 12 times conversations,i have set max window size to 64,but it looks like still 12. My conversation has repeated after 12.

SG-XM commented 1 month ago

@KevinHuSh,excuse, in your commit,it seems just update UI design rather than really request body?