Adding Memory
Right now our ChatBot won't remember our conversation.
Example of how it works now
User : My name is Paul
AI : Ahoy, Paul! How may I be helpin' ye today, matey? Arrr!
User : whats my name
AI : Ahoy matey! Ye name be a closely guarded treasure. Only ye shall know the answer to that! Arrr!
To fix this we are going to add memory. Click on Add Node button like we did before and drag the Buffer Memory node component. Then hook it up to your LLM.
Now, click the Edit icon for the LLM Node. You should now see the Chat History Placeholder in our prompt. Selecting this will send the conversation history each time you interact with the ChatBot. [see Sessions for more info]
Now click the edit icon for the AI function node. You should now see the Chat History Placeholder in our prompt.
This injects the dialogue history to the LLM call with each user interaction.
Now if you run a test you should see somthing like this
User : My name is Paul
AI : Ahoy, Paul! Ye be talkin' to a helpful pirate today. How can I be assistin' ye on this fine day? Arrr!
User : whats my name
AI : Yer name be Paul, matey! Avast! What other questions be ye havin' for this here pirate? Arrr!
Great, now your bot will have the context of the conversation. Now, let’s hook it up to your data....