Flowise icon indicating copy to clipboard operation
Flowise copied to clipboard

Feature/Add prepend messages to memory

Open HenryHengZJ opened this issue 1 year ago • 6 comments

  • users can prepend messages like:
{
   "question": "hihi! tell me my name",
   "history": [
        {
            "role": "apiMessage",
            "content": "Hello, how can I help?"
        },
        {
            "role": "userMessage",
            "content": "Hey my name is Henry"
        }
    ]
}

HenryHengZJ avatar May 15 '24 01:05 HenryHengZJ

@HenryHengZJ is this identical to how it worked before it was removed?

(i.e. won't need to make any changes to my bots that worked prior to the removal).

snailbrainx avatar May 17 '24 21:05 snailbrainx

@HenryHengZJ is this identical to how it worked before it was removed?

(i.e. won't need to make any changes to my bots that worked prior to the removal).

Yep came to realise there might be cases where prior messages are needed to give context to LLM

HenryHengZJ avatar May 17 '24 21:05 HenryHengZJ

  • users can prepend messages like:
{
   "question": "hihi! tell me my name",
   "history": [
        {
            "role": "apiMessage",
            "content": "Hello, how can I help?"
        },
        {
            "role": "userMessage",
            "content": "Hey my name is Henry"
        }
    ]
}

This is not working properly and if possible include the previous approach in current version to manage memory

ahsan3219 avatar May 18 '24 18:05 ahsan3219

  • users can prepend messages like:
{
   "question": "hihi! tell me my name",
   "history": [
        {
            "role": "apiMessage",
            "content": "Hello, how can I help?"
        },
        {
            "role": "userMessage",
            "content": "Hey my name is Henry"
        }
    ]
}

This is not working properly and if possible include the previous approach in current version to manage memory

which is not working properly? are you testing on the branch feature/Add-History-to-API or the main branch?

HenryHengZJ avatar May 18 '24 20:05 HenryHengZJ

I deployed Flowise on Render using the main branch and called the endpoint of an AI agent. When sending a request with previous message history, the agent did not provide a reliable response that showed it remembered the user's previous messages. For example, when the user mentioned their name as "conversation" and asked about it later, the agent gave a random response that was incorrect.

On Sun, May 19, 2024, 1:15 AM Henry Heng @.***> wrote:

  • users can prepend messages like:

{ "question": "hihi! tell me my name", "history": [ { "role": "apiMessage", "content": "Hello, how can I help?" }, { "role": "userMessage", "content": "Hey my name is Henry" } ] }

This is not working properly and if possible include the previous approach in current version to manage memory

which is not working properly? are you testing on the branch feature/Add-History-to-API or the main branch?

— Reply to this email directly, view it on GitHub https://github.com/FlowiseAI/Flowise/pull/2410#issuecomment-2118993189, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASKRYRJUVOZ5TQHY65PBQSDZC6ZFJAVCNFSM6AAAAABHXGGROOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJYHE4TGMJYHE . You are receiving this because you commented.Message ID: @.***>

ahsan3219 avatar May 18 '24 20:05 ahsan3219

I deployed Flowise on Render using the main branch and called the endpoint of an AI agent. When sending a request with previous message history, the agent did not provide a reliable response that showed it remembered the user's previous messages. For example, when the user mentioned their name as "conversation" and asked about it later, the agent gave a random response that was incorrect. On Sun, May 19, 2024, 1:15 AM Henry Heng @.> wrote: - users can prepend messages like: { "question": "hihi! tell me my name", "history": [ { "role": "apiMessage", "content": "Hello, how can I help?" }, { "role": "userMessage", "content": "Hey my name is Henry" } ] } This is not working properly and if possible include the previous approach in current version to manage memory which is not working properly? are you testing on the branch feature/Add-History-to-API or the main branch? — Reply to this email directly, view it on GitHub <#2410 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASKRYRJUVOZ5TQHY65PBQSDZC6ZFJAVCNFSM6AAAAABHXGGROOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJYHE4TGMJYHE . You are receiving this because you commented.Message ID: @.>

it's not been merged with main yet

snailbrainx avatar May 18 '24 22:05 snailbrainx

Can I use this to "train" an agent which tools to choose, or teach him a certain sequence of actions?

neria05 avatar May 21 '24 07:05 neria05

Shouldn't there be an option to update the persistent memory (zep, etc) with this history as well?

@HenryHengZJ maybe this will both flexibilize and simplify the current code, without the need to manually inject prependMessages everywhere.

Add history to memoryNode on buildChatflow.ts, then let the existing memory logic take over from there.

raffareis avatar May 24 '24 09:05 raffareis