Skip to content

kamalviewcode-spec/Project_6_AI_Agent_CSV_Visual

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖📊 CSV Intelligence — AI Agent Chatbot

Chat with your CSV data in plain English. No SQL. No formulas. Just ask.

Python Streamlit LangChain DeepSeek License: MIT


What Is This?

CSV Intelligence is an AI-powered chatbot that lets you have a full conversation with any CSV file.

Upload your data, ask a question, and the agent:

  • Writes and executes Python code against your CSV on the fly
  • Generates interactive charts (bar, pie, line) rendered in the browser
  • Returns a written summary explaining the insight in plain English

No data science skills needed.


Demo

Ask a question Get a chart + summary
"What are the top 10 products by price?" Bar chart + ranked list
"What % of items are Large vs Small?" Pie chart + percentage breakdown
"Show me the distribution of stock values" Line chart + stats summary

Features

  • 🧠 AI-powered analysis — DeepSeek V3 reasons step-by-step to answer complex data questions
  • 📊 Auto visualisation — generates Chart.js HTML charts tailored to the data
  • 🔁 Agent caching — the CSV agent is built once and reused, keeping responses fast
  • 🎨 Modern UI — dark gradient theme, live progress steps, sidebar CSV preview & stats
  • 💬 Sample questions — clickable chips to get started immediately
  • 🛡️ Resilient parsingjson-repair handles imperfect LLM JSON output gracefully
  • 🗑️ Auto cleanup — temporary files deleted on exit

Tech Stack

Layer Technology
UI Streamlit
AI Agent LangChain — ReAct CSV Agent
LLM DeepSeek V3 (deepseek-chat)
Data Pandas
Validation Pydantic
Package Manager uv

Project Structure

├── ModernChatbot.py   # Modern UI — start here
├── Chatbot.py         # Original UI
├── csv_agent.py       # LangChain ReAct agent (reads & analyses CSV)
├── plotter.py         # DeepSeek formatter (generates charts + summaries)
├── pyproject.toml     # Dependencies
└── .env               # API keys (not committed)

Getting Started

1. Clone the repo

git clone https://github.com/kamalviewcode-spec/Project_6_AI_Agent_CSV_Visual.git
cd Project_6_AI_Agent_CSV_Visual

2. Add your DeepSeek API key

Create a .env file in the project root:

DEEPSEEK_API_KEY=your_key_here

Get your key at platform.deepseek.com/api_keys

3. Install dependencies

uv sync

4. Run the app

streamlit run ModernChatbot.py

Your browser will open at http://localhost:8501


How It Works

User question
     │
     ▼
LangChain ReAct Agent
  → writes pandas code
  → executes against CSV
  → returns text answer
     │
     ▼
DeepSeek Formatter
  → generates HTML chart
  → writes summary
     │
     ▼
Streamlit UI
  → renders chart in iframe
  → displays summary

License

This project is licensed under the MIT License — see the LICENSE file for full details.

Free to use, modify, and distribute.


Built with LangChain · DeepSeek · Streamlit · Python

About

Chat with your CSV data in plain English — AI agent that writes & runs Python code, generates interactive charts, and explains insights using DeepSeek V3 + LangChain + Streamlit

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages