Turn any CSV file into insights, code, and charts using LLM-powered agents, Docker, and a Streamlit UI.
- Lets you upload a CSV file and ask natural language questions about your data.
- Uses a Data Analyzer agent to plan the analysis and generate Python code.
- Uses a Python Code Executor agent running inside Docker to safely execute the code.
- Streams back:
- Explanations and intermediate reasoning.
- Final insights in text form.
- Generated visualizations as PNG images.
- Provides both:
- A Streamlit web app for interactive exploration.
- A CLI demo via
main.pyfor quick testing.
flowchart LR
U[User 🧑💻] --> S[Streamlit UI<br/>streamlit_app.py]
S -->|task + CSV path| T[RoundRobinGroupChat Team 🤝]
subgraph Team
A[Data_Analyzer_Agent 🤖] <--> C[Python_Code_Executor 🐍<br/>DockerCommandLineCodeExecutor]
end
T --> A
T --> C
C -->|PNG charts, console output| FS[(temp/ directory)]
A -->|text insights + STOP| S
FS -->|PNG images| S
- Language: Python 3.12
- UI: Streamlit
- LLM Orchestration:
autogen-agentchat,autogen-core,autogen-ext - Code Execution: Docker via
DockerCommandLineCodeExecutor - Model Provider: OpenRouter
From the project root:
streamlit run streamlit_app.pyThen open the URL shown in the terminal (usually http://localhost:8501).
- Upload CSV
- Use the “Upload a CSV file” widget to select your dataset.
- Describe Your Task
- In the chat input, type something like:
- “Give me summary statistics of all numeric columns.”
- “Plot a histogram of sepal.length grouped by variety.”
- In the chat input, type something like:
- Watch the Conversation
- The app shows:
- User messages 👤
- Data Analyzer agent messages 🤖
- Code executor outputs 👨💻
- The app shows:
- View Generated Visualizations
- Any PNGs saved into
temp/by the code executor are displayed under Generated Visualizations.
- Any PNGs saved into
Session state keeps:
messages– the full chat history.autogen_team_state– serialized agent team state to resume conversations.images_shown– images that have already been displayed.
-
Data_Analyzer_Agent
- Receives your natural-language request and the context that a CSV is available.
- Produces:
- A short plan.
- A single Python code block that:
- Loads and analyzes the CSV.
- Installs any missing packages via
pip install ...if needed. - Saves plots to PNG files (e.g.
plt.savefig('temp/some_plot.png')).
- Post-analysis explanation, ending with
STOPas a termination signal.
-
Python_Code_Executor
- Runs the code produced by the Data Analyzer inside Docker.
- Uses
WORK_DIR_DOCKER = "temp"as the working directory. - Produces console logs and PNG files consumed by the UI.
-
RoundRobinGroupChat Team
- Alternates between agents up to
max_turns=10. - Uses a
TextMentionTermination("STOP")condition to know when to stop.
- Alternates between agents up to