https://discord.gg/botpress logo
How would I be able to create a memory of what the...
# 🤝help
e
For further context I have built an agent that recommends products to the user. But a reoccuring issue is that it keeps giving out the same products over and over. Would I be able to make an array variable where I store the products that have already been displayed in the chat? And if yes how? Thanks alot
For example if I add this to my prompt :
Copy code
• SESSION MEMORY – Maintain an array `shown_product_ids` in the conversation state.
  – After sending a recommendation, push each product’s unique ID/SKU into this array.
  – Before showing a product, check that its ID is **not** inside `shown_product_ids`
    unless the user explicitly asks to revisit it.
and create a variable array string named shown_product_ids
would it work?
l
can you not use tables to store your products with details, SKU, ID, description etc and ask the autonomous node to refer to the table and recommend the matching by SKU and description
e
that's how it's made and it does not work
p
Have you done any testing to find what is failing? Your variable has the +r and +w permissions?