An AI-powered chat application for data analysis. Upload CSV or Excel files and get intelligent insights.
- π Upload CSV and Excel files
- π€ AI-driven data analysis and querying
- π¬ Conversational interface
- π Data visualization (charts)
- πΎ Conversation history
- π± Responsive design with mobile support
- FastAPI - Web framework
- LangChain - AI agent framework
- Pandas - data processing
- OpenAI GPT - language model
- Python 3.8+
- Next.js 14 - React framework
- TypeScript - type safety
- Tailwind CSS - styling framework
- Recharts - data visualization
- Ensure
backend/requirements.txtincludes all dependencies:
fastapi==0.115.11
uvicorn==0.34.1
python-multipart==0.0.20
pandas==2.2.3
tabulate==0.9.0
langchain==0.3.25
langchain-openai==0.2.14
langchain-experimental==0.3.4
langchain-core==0.3.59
langgraph==0.3.31
langgraph-checkpoint==2.0.24
openai==1.75.0
python-dotenv==1.1.0
pydantic==2.11.3
typing-extensions==4.13.2
openpyxl==3.1.5
requests==2.32.3- Create a new Web Service on Render
- Connect the GitHub repository
- Set the build command:
pip install -r backend/requirements.txt - Set the start command:
cd backend && python main.py - Add an environment variable:
OPENAI_API_KEY: your OpenAI API key
- Import the GitHub repository in Vercel
- Set the root directory to
frontend - Add an environment variable:
NEXT_PUBLIC_API_URL: backend API URL (e.g. https://your-backend.onrender.com)
- Enter the backend directory:
cd backend- Install dependencies:
pip install -r requirements.txt- Create a
.envfile:
OPENAI_API_KEY=your_openai_api_key_here- Start the server:
python main.py- Enter the frontend directory:
cd frontend- Install dependencies:
npm install- Create a
.env.localfile:
NEXT_PUBLIC_API_URL=http://localhost:8000- Start the development server:
npm run dev- Open the frontend application
- Click "Add files" to upload CSV or Excel files
- Type your question in the chat box, for example:
- "Analyze the basic statistics of this dataset"
- "Find the top 10 products by sales"
- "Show the monthly trend"
- The AI analyzes the data and returns results with charts
-
Network error - "Failed to fetch"
- Problem: the frontend cannot reach the backend API
- Possible causes:
- The Render service is waking up (cold start)
- Network timeout
- CORS configuration issues
- Solutions:
- Wait 1β2 minutes for the Render service to fully start
- Check backend health at
https://dataanalyzeagent2.onrender.com/health - The frontend will automatically retry three times with increasing intervals
- Inspect the browser console for detailed errors
-
"Missing optional dependency 'tabulate'" error
- Solution: ensure
requirements.txtincludestabulate==0.9.0; this is fixed in the latest version
- Solution: ensure
-
Render cold start issues
- Symptom: connection fails on first visit or after long inactivity
- Solutions:
- Wait 30β60 seconds for the service to start
- Hit the backend health endpoint to warm up the service
- Consider upgrading to a paid Render plan to avoid cold starts
-
Environment variables not applied on Vercel
- Check:
- Make sure
NEXT_PUBLIC_API_URLis added in the Vercel project settings - The value should be
https://dataanalyzeagent2.onrender.com - Redeploy after changing environment variables
- Make sure
- Check:
-
CORS errors
- Symptom: the browser console shows a CORS policy error
- Solution: the backend is configured to allow the Vercel domain; check domain settings if issues persist
- Repository connected to Render
- Build command:
pip install -r backend/requirements.txt - Start command:
cd backend && python main.py - Environment variable
OPENAI_API_KEYset - Service type "Web Service"
- Python version 3.8+
- Repository imported into Vercel
- Root directory set to
frontend - Environment variable
NEXT_PUBLIC_API_URLset to backend URL - Automatic deployments enabled
-
Backend health check:
curl https://dataanalyzeagent2.onrender.com/health
Should return:
{"status": "healthy", "temp_dir": "temp_file"} -
Frontend connection test:
- Open the frontend application
- Check the connection status indicator at the top of the page
- Green means connected, red means failed
-
Functional test:
- Try sending a simple message without files: "Hello"
- Upload a CSV file and ask: "Analyze this data"
OPENAI_API_KEY: OpenAI API key (required)
NEXT_PUBLIC_API_URL: backend API URL (required)
MIT License
Contributions via Issues and Pull Requests are welcome!


