Why cant chat recall previous results in this agent

Hi @Alex_MindStudio ,

I’m having some problems with the chat in this agent that I remixed for you to analyze. Here is the link to the remix: https://app.mindstudio.ai/agents/csv-analysis-by-trigo-copy-ccba70de/remix

Everything works fine until the gen text block. The result generated is perfect and wonderful. The problem arises when I click “next” and go to the ‘Chat’ block. I ask a question related to the results and what is in the “run” history, but the chat completely loses the history and a simple question about the data in the CSV file completely confuses it and it gives completely irrelevant answers.

After clicking on ”next” and write a simple query i get this answer:

What could be missing here? Can you help me? I’ve already created several agents of this type, and when I ask a question in the “chat” block, it “picks up” the context in the history and responds accordingly. Why can’t I do that now?

Thank you.

fernando

Hi @Fjmtrigo,

Thanks for the detailed explanation!

In your current setup, the model in the Chat block only has access to the output from the last Generate Text block in the workflow. It does not see the CSV file, the prompt used in that Generate Text block, or any other data, only the generated output.

If you’d like the model in the Chat block to have access to that data, make sure to reference the variables directly in the System Prompt of that workflow.

Also, please note that the Extract Text from File block stores the extracted text as an array. The model will not know that this data comes from a CSV unless you explicitly tell it. You can do that by adding something like this to the System Prompt:

The data below is a CSV. Whenever a user asks about a CSV, they are referring to the data below:
<csvData>
{{yourVariable}}
</csvData>

Hope this helps!

1 Like

Thanks a lot!!