# DataWhisper – Conversational Data Analyst

Tagline: Talk to your business data. Instantly visualize trends, uncover anomalies, and generate insights — powered by Elastic + Google Cloud AI.

Badges: [License: MIT] [Node.js 16.x] [React 18.2]

---

Table of Contents:
- Overview
- Features
- Tech Stack
- Demo
- Installation
- Usage
- Project Structure
- Future Enhancements
- Contributing
- License

---

Overview:
DataWhisper is a conversational analytics assistant enabling natural-language interaction with business datasets. Users can ask questions like:
- “Show me last quarter’s sales trend for the West region.”
- “Why did revenue drop in mid-August?”
- “Generate a quick insight summary.”

It integrates Elastic Hybrid Search for fast data retrieval and Google Cloud Vertex AI / Gemini for natural-language summaries and anomaly detection. The interactive frontend visualizes insights in charts and tables, making decision-making seamless.

---

Features:
- Conversational Querying: Ask questions naturally, including filters and metrics.
- Hybrid Search Engine: Elastic indices store structured and unstructured company data.
- AI-Powered Summaries: Vertex AI generates executive-ready summaries and explanations.
- Visual Analytics: Line, bar, and table visualizations generated automatically.
- Follow-Up Suggestions: AI proposes related queries for deeper exploration.
- Explain Mode: Investigate anomalies with evidence and confidence scores.

---

Tech Stack:
Frontend: React + Chart.js
Backend: Node.js + Express
Search Engine: Elastic Cloud (Hybrid Search)
AI Layer: Google Cloud Vertex AI / Gemini
Hosting: Google Cloud Run / Firebase
Data Storage: Elastic Indices / BigQuery (optional)

---

Demo:
Example Queries:
1. “Show last quarter sales trend for West region”
2. “Why did revenue drop mid-August?”
3. “Which products contributed most to the drop?”

Demo flow:
1. Enter query → Backend queries Elastic → Vertex AI generates summary → Frontend renders chart + summary + sources + follow-ups.
2. Click suggested follow-ups to explore insights interactively.

---

Installation:
1. Clone the repository
   git clone https://github.com/yourusername/datawhisper.git
   cd datawhisper

2. Install backend dependencies
   cd backend
   npm install

3. Install frontend dependencies
   cd ../frontend
   npm install

4. Create environment variables (backend/.env)
   ELASTIC_URL=https://your-elastic-endpoint
   VERTEX_MODEL=projects/PROJECT/locations/LOCATION/models/gemini-1.0
   GOOGLE_APPLICATION_CREDENTIALS=path/to/creds.json
   PORT=3000

5. Load demo dataset into Elastic (sales-demo index)
   Fields: sale_date, region, product_name, amount, notes

---

Usage:
Start Backend:
cd backend
node server.js

Start Frontend:
cd frontend
npm start

Open http://localhost:3000 in a browser. Enter queries and interact with visualizations.

---

Project Structure:
datawhisper/
├─ backend/                # Node.js + Express API
│  ├─ server.js            # Main API logic
│  └─ package.json
├─ frontend/               # React UI
│  ├─ DataWhisperUI.jsx    # Main component
│  └─ package.json
├─ README.md
└─ .env                    # Env variables for Elastic + Vertex AI

---

Future Enhancements:
- Multi-modal search (images, PDFs, emails)
- Voice-enabled queries (Google Cloud Speech-to-Text)
- Multi-agent personas (Analyst, Investigator)
- Real-time anomaly detection & alerts
- Mobile-first responsive design

---

Contributing:
1. Fork the repo
2. Create a feature branch (git checkout -b feature-name)
3. Commit changes (git commit -m 'Add feature')
4. Push branch (git push origin feature-name)
5. Open a Pull Request

---

License:
MIT License

---

Acknowledgements:
- Elastic – Hybrid Search & Indexing
- Google Cloud Vertex AI / Gemini – Natural Language Summarization & AI reasoning
- Chart.js – Interactive Visualizations
- Inspiration from real-world business analytics workflows
Share this project:

Updates