Welcome to Zed-One, an intelligent data analysis application that leverages the power of OpenAI's GPT-4 to provide insightful data queries and visualizations. Whether you're a data analyst, business professional, or enthusiast, Zed-One simplifies data exploration by allowing you to interact with your datasets using natural language.
- CSV Upload: Easily upload your CSV files for analysis.
- Natural Language Queries: Ask questions about your data and receive precise answers generated by AI.
- Dynamic Visualizations: Request visual representations of your data and get interactive Plotly charts.
- Automated Schema Extraction: Automatically extracts and summarizes the schema of your datasets.
- Interactive Frontend: User-friendly interface built with Streamlit for seamless interaction.
- Robust Backend: Powered by FastAPI to handle requests efficiently.
-
Backend:
- FastAPI - A modern, fast web framework for building APIs with Python.
- LangChain - Framework for developing applications powered by language models.
- OpenAI GPT-4 - Advanced language model for generating intelligent responses.
- Plotly - Interactive graphing library for Python.
-
Frontend:
-
Utilities:
- Python 3.8 or higher
- pip (Python package installer)
-
Clone the Repository
git clone https://github.com/your-username/smartdata-ai.git cd smartdata-ai
-
Create a Virtual Environment
python -m venv venv
-
Activate the Virtual Environment
- Windows:
venv\Scripts\activate
- macOS/Linux:
source venv/bin/activate
- Windows:
-
Install Dependencies
pip install -r requirements.txt
-
Configure Environment Variables
Create a
.env
file in the root directory and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key_here
To start both the FastAPI backend and the Streamlit frontend simultaneously, use the run_all.py
script:
python run_all.py
- FastAPI Backend: Runs on
http://localhost:8000
- Streamlit Frontend: Runs on
http://localhost:8501
- URL:
/upload_csv/
- Method:
POST
- Description: Upload a CSV file for analysis.
- Parameters:
file
: The CSV file to upload.
- URL:
/ask_question/
- Method:
POST
- Description: Ask a question about the uploaded CSV data.
- Parameters:
question
: The question you want to ask.filename
: The name of the uploaded CSV file.
- URL:
/visualize/
- Method:
POST
- Description: Generate a Plotly visualization based on your question.
- Parameters:
question
: The visualization request.filename
: The name of the uploaded CSV file.
Access the Streamlit frontend at http://localhost:8501 after running the application. The interface allows you to:
- Upload CSV Files: Easily upload and manage your datasets.
- Ask Questions: Interact with your data using natural language queries.
- Generate Visualizations: Create insightful plots and charts based on your requests.
smartdata-ai/
├── agents/
│ ├── query_generator.py
│ ├── response_generator.py
│ └── visualizer.py
├── utils/
│ ├── data_loader.py
│ ├── schema_extractor.py
│ └── summary_generator.py
├── app.py
├── run_all.py
├── streamlit_app.py
├── requirements.txt
├── .env
├── README.md
└── banner.png
Contributions are welcome! Please follow these steps:
-
Fork the Repository
-
Create a Feature Branch
git checkout -b feature/YourFeature
-
Commit Your Changes
git commit -m "Add your message"
-
Push to the Branch
git push origin feature/YourFeature
-
Open a Pull Request
This project is licensed under the MIT License.
For any inquiries or support, please contact hossein.karimi.0128@gmail.com.