Building a Conversational Data Analysis App with Streamlit and PandasAI (Chat with your DataFrames!)

Hey Streamlit Community,

I wanted to share a YouTube video tutorial in Spanish but dubbed in English, thanks to YouTube. The project I built using Streamlit adds a powerful capability for data analysis: natural language querying via PandasAI.

PandasAI acts as an AI agent for your DataFrames, allowing users (even non-technical ones!) to ask questions about their data in plain English (or other languages) and get results back as DataFrames, charts, or simple text.

I created a Streamlit app demonstrating this by:

  • Allowing CSV/Excel file uploads.

  • Converting the uploaded data into a PandasAI DataFrame.

  • Setting up a chat interface using st.chat_input and st.chat_message.

  • Showing how PandasAI handles queries and returns results (including generated code and charts).

  • Integrating with different LLMs (like Mistral in this example) using litellm.

This is a fantastic way to make your data applications more interactive and accessible.

You can see a demo and walk-through in this video: