FlowiseAI / Flowise

Drag & drop UI to build your customized LLM flow
https://flowiseai.com
Apache License 2.0
30.21k stars 15.61k forks source link

Is there any configuration that could be used to make the chat history limitation when calling the LLM? #2685

Closed quzhixue-Kimi closed 3 months ago

quzhixue-Kimi commented 3 months ago

hi there,

There has been one flowise chatbot I configured with upstash redis-backed chat memory. And, langsmith has been added to track the whole process and parameters. (It is just a chat bot flow with memory, no vector store and record manager)

I found that when I talked to my LLM, all the histories of chat message will be added as 'chat_history' parameter.

image

It will cost the LLM's token a lot. Even, some content of the chat history has no relation with my current topic.

It is appreciated that you may help and guide me to make some configuration about the 'chat_history' limitation to reduce the LLM's token cost.

BR Kimi

toi500 commented 3 months ago

Are u the only user that uses this chatbot?

quzhixue-Kimi commented 3 months ago

Hi there,

I would like to publish the chatbot for registered users. So, there might be a number of users who will use the chatbot.

BR Kimi

HenryHengZJ commented 3 months ago

There are different ways to help with that, have a look at the docs: https://docs.flowiseai.com/integrations/langchain/memory/buffer-window-memory https://docs.flowiseai.com/integrations/langchain/memory/conversation-summary-memory https://docs.flowiseai.com/integrations/langchain/memory/conversation-summary-buffer-memory

quzhixue-Kimi commented 3 months ago

hi Henry,

Thank you for your reply. I am using the upstash redis-backed chat memory in my chatbot. It seems that there is no configuration about it.

image

What I want to do is to record each user's chat history in upstash redis, and the session id in redis is just the unique user name.

BR Kimi

HenryHengZJ commented 3 months ago

I'm afraid for now you'll have to use one of the memory nodes mentioned above, it's similar to upstash. Messages are stored with session if into your Flowise database

quzhixue-Kimi commented 3 months ago

Hi there,

Thank you for your kind help.

BR Kimi