How to persist chatbot messages, plots, and inputs in Streamlit without them disappearing?

Hi everyone,

I’m building a chatbot app in Streamlit and I’m facing an issue: every time a new interaction happens (like submitting an input), the previous messages, charts, and inputs disappear from the page. I’d like everything to stay visible on the page, like a real conversation history, even after new inputs are added.

Here are some details about the app:

  1. The chatbot is designed for forecasting, using three different machine learning models (e.g., RandomForest, SARIMA, ETS).
  2. It asks the user a fixed sequence of questions, processes the answers, and uses them as inputs to the models.
  3. After gathering all inputs, it should show a bar chart with the forecasts and provide an option to download the results as an Excel file.

How can I make the chatbot messages, plots, and widgets persist on the page after each new user input?

Any help or examples would be appreciated!

Thanks in advance!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.