Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/Add prepend messages to memory #2410

Merged
merged 1 commit into from
May 20, 2024
Merged

Conversation

HenryHengZJ
Copy link
Contributor

  • 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"
        }
    ]
}

@snailbrainx
Copy link
Sponsor

@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).

@HenryHengZJ
Copy link
Contributor Author

@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

@ahsan3219
Copy link

  • 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

@HenryHengZJ
Copy link
Contributor Author

  • 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?

@ahsan3219
Copy link

ahsan3219 commented May 18, 2024 via email

@snailbrainx
Copy link
Sponsor

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

@HenryHengZJ HenryHengZJ merged commit 8caca47 into main May 20, 2024
2 checks passed
@neria05
Copy link

neria05 commented May 21, 2024

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

@raffareis
Copy link
Contributor

raffareis commented May 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants