Skip to content

Repository files navigation


NatWest Hackathon Python FastAPI React TypeScript MongoDB SQLite

Natural language in. Decision-ready Excel out.


What is AnalytiQ?

AnalytiQ is an AI-powered data assistant that lets you interact with your data using simple language.

You upload files, ask questions, and get:

  • Clear answers
  • Insights you can trust
  • Interactive charts and visualizations
  • Downloadable Excel reports

No SQL. No formulas. No dashboards.

Upload → Ask → Visualize → Understand → Act


The Problem We Solve

Pain Point What Users Face
Complex Excel files Hard to analyze without technical skills
Slow insights Manually querying data takes hours
Tool overload Most BI tools require training
Decision paralysis Too much data, too little clarity

Most users just want answers - not complex tools.



The Solution

AnalytiQ simplifies the entire process:

Step Description
1st Upload Add your Excel, CSV, or image files
2nd Ask Type your question in plain English
3rd AI processes Understands intent, runs SQL queries
4th Get results Answers, charts, insights, or a full Excel report


Core Capabilities

1. Natural Language Queries

Ask your data anything - no query language required:

"Which region is underperforming?"
"Compare this month with last month"
"What are the top 5 products by revenue?"
"Why are sales declining in Q3?"

The system understands your intent and finds the answer.


2. Data Processing Engine

The system:

  • Converts questions into SQL queries
  • Runs them on your data
  • Handles large datasets
  • Combines multiple results when needed

The output is explained in simple language.


3. Chart Builder

Build rich, interactive visualizations - visually or just by asking in the chat.

Two ways to create charts:

  • Chat: Simply describe a chart in your message - "Show me a 3D scatter plot of 10th, 12th grade and CGPA" - and AnalytiQ generates it inline.
  • Studio Panel: Open the Chart Builder from the Studio to configure and generate charts with full control.

Chart types supported:

Chart Type Best For
Auto Let AnalytiQ pick the best fit
Bar / Line / Area Trends and comparisons
Pie Part-to-whole breakdowns
Scatter / 3D Scatter Correlations and distributions
Bubble Three-variable relationships
Radar Multi-metric comparisons
Heatmap Density and matrix patterns
Treemap Hierarchical data
Composed Multi-layer custom charts

Quick Actions let you pick a visualization pattern instantly - Monthly trend, Category compare, Part to whole, Metric dashboard, Heatmap matrix, 3D relationship - no description needed.

Chart Gallery: All generated charts are saved in the Chart Builder panel. You can browse, re-open, download (JSON/CSV), or delete any previously created chart at any time.

Chart Analysis: Each chart comes with an AI-written summary below it - explaining the data, key patterns, ranges, and anomalies in plain English.

Export: Every chart can be exported as JSON or CSV for further use.


Chart Builder - create new charts

Chart gallery - browse saved charts


Interactive 3D scatter with axis ranges

AI chart analysis below every visualization
---

4. SQL Transparency

Every answer and chart shows exactly what happened behind the scenes.

Expand SQL details on any message or chart to see:

  • Query - the exact SQL that was executed
  • Tables used - which internal tables contributed
  • Spreadsheet sources - which uploaded files were involved
  • Execution status - SUCCESS or error details
-- Example: auto-generated query for a correlation chart
SELECT col_10th_percentage_cgpa, col_12th_percentage_cgpa, current_cgpa
FROM arista_1_ece_other_branches
UNION ALL
SELECT col_10th_percentage_cgpa, col_12th_percentage_cgpa, current_cgpa
FROM arista_1_cs_branch_students

You always know what data was used and how the answer was derived - no black boxes.


5. Excel Report Generation

You can generate full Excel reports by describing what you need.

Example:

"Create a report with summary, grouped data, and charts"

The system creates:

  • Multi-sheet workbooks
  • Calculations and aggregations
  • Charts (bar, line, pie)
  • Proper formatting

The result is a ready-to-use .xlsx file.


6. Background Processing

Excel generation runs in the background:

  • No waiting screen
  • Progress can be tracked
  • File is available when ready

7. Thread Instructions

Customize how AnalytiQ behaves - per thread.

Open Thread Instructions from the settings panel to add persistent instructions that are automatically injected alongside the system prompt for every message in that thread.

Examples:

"Give short answers"
"Always respond in bullet points"
"Focus only on revenue metrics"
"Assume currency is INR"

Instructions can be added, edited, toggled on/off, or deleted at any time. This lets you shape AnalytiQ's behavior for your specific dataset or use case - without repeating yourself every message.


8. Text-to-Speech

Every AI response includes a speaker button that reads the answer aloud.

  • Click the speaker icon next to any agent message to hear it read out
  • Useful for reviewing long reports hands-free or accessibility purposes
  • Works directly in the browser - no setup required

9. Data Handling

Supported inputs:

  • Excel (.xls, .xlsx)
  • CSV (.csv)
  • Images (.jpg, .png, etc.)

Uploaded data is:

  • Structured automatically
  • Stored for fast querying
  • Ready for analysis

10. Spreadsheet Intelligence

  • Each sheet becomes a queryable table
  • Multiple sheets are handled automatically
  • Columns are cleaned and understood
  • Works with real-world messy data

11. Trust and Transparency

Every answer clearly shows:

  • Data source - which file was used
  • Tables used - which sheets contributed
  • Columns involved - what data was analyzed
  • SQL queries - exactly how the result was computed

This helps users verify results end-to-end.


12. Flexible Query Modes & Smart Context

Choose how AnalytiQ should answer:

Mode Behavior
Internal Uses only your uploaded data
External Enriches answers with web knowledge
Context Maintains chat history for follow-ups
Self-Knowledge Falls back to general AI knowledge

13. Advanced Query Intelligence

The system can:

  • Break complex questions into smaller parts
  • Run queries in parallel
  • Combine results into one answer

If direct answers are not possible, it adapts and still provides useful output.


14. Image Understanding (OCR)

  • Extracts text from images
  • Works with scanned documents
  • Converts visual data into usable information

15. Smart Hybrid Retrieval

  • Combines keyword search (BM25) + semantic search (vector embeddings)
  • Finds the most relevant data across all your uploads
  • Dramatically improves answer accuracy on large datasets

16. Workspace Management

  • Work is organized into threads
  • Each thread has its own data and chat
  • Multiple datasets can be managed easily

17. Insights Tools

  • Document Summaries - instant overview of any uploaded file
  • Global Summaries - cross-file insights across your workspace
  • Mind Map Generation - visual knowledge mapping from your data

18. Export Options

Format Use Case
Markdown Clean, shareable chat exports
HTML Web-ready formatted exports
Excel .xlsx Structured, chart-rich reports
JSON / CSV Raw chart data export

19. Security

  • JWT-based user authentication
  • Controlled, isolated data access per user
  • Safe, sandboxed file handling

20. Real-Time Experience

  • Live WebSocket updates via Socket.IO
  • Fast responses
  • Smooth interaction


How It Works

ezgif com-resize (1)

Upload file
    ↓
Choose mode 
    ↓
Ask question (or open Chart Builder)
    ↓
System processes data & runs SQL
    ↓
Get answer, chart, or Excel report
    ↓
Inspect SQL · Export data · Listen aloud

Clean, minimal dashboard

Name thread & upload files


View all thread documents

Create thread in seconds


Select docs to summarize

Auto-generated document summary


Mind map generating in real-time

Interactive, expandable mind map


Export filtered data as Excel

Studio panel with advanced settings

System Architecture

flowchart LR
    U[User] --> FE[React Frontend]
    FE --> API[FastAPI + Socket.IO]

    API --> AUTH[JWT Middleware]
    API --> AGENT[Agent Graph Runtime]
    API --> THREADS[Thread/User State]

    THREADS --> MONGO[(MongoDB)]

    AGENT --> RETR[Hybrid Retriever]
    RETR --> CHROMA[(Chroma Vector Store)]
    RETR --> BM25[(BM25 Index)]
    AGENT --> TRIPLES[(Triple Store)]

    AGENT --> SQL[Spreadsheet SQL Engine]
    SQL --> SQLITE[(Per-thread SQLite)]

    AGENT --> EXCEL[Excel Skill Pipeline]
    EXCEL --> XLSX[(Generated .xlsx Exports)]

    AGENT --> CHARTS[Chart Builder Engine]
    CHARTS --> CHARTSTORE[(Chart Artifact Store)]

    API --> STUDIO[Summary + Mind Map Services]
    API --> STORAGE[(Thread File Storage)]
    API --> TTS[Text-to-Speech]
    API --> INSTRUCT[Thread Instructions]
Loading

Example Queries

  • "Show revenue breakdown by region"
  • "Why are sales decreasing?"
  • "Compare performance across months"
  • "Create an Excel report with summary and charts"
  • "Plot a 3D scatter of 10th, 12th grade and CGPA"
  • "Show student distribution by branch and gender as a treemap"

Example Output


Ask questions, get structured answers

Branch-wise rankings in clean tables


Flags data inconsistencies transparently

Correlations broken into clear insights


Patterns across multiple metrics

Uncovers hidden trends automatically

Tech Stack

Layer Technology
Frontend React + TypeScript
Backend Python 3.10+ · FastAPI · Socket.IO
AI / LLM LangChain · LangGraph (Agent Graph Runtime)
Data Processing Pandas · NLTK
Query Engine SQLite (per-thread)
Vector Search ChromaDB
Keyword Search BM25 Index
Database MongoDB
Excel Output openpyxl / xlsxwriter
Charts Recharts / Plotly (interactive, exportable)
Text-to-Speech Web Speech API
Auth JWT Middleware

Setup & Installation

Tested on Python 3.11 · CUDA 12.4 · Windows / Linux

1. Clone the Repository

git clone https://github.com/Fyxod/NatWest-Code-for-Purpose.git
cd analytiq

2. Create a Virtual Environment

# Recommended: Python 3.11
py -3.11 -m venv venv

# Or if Python 3.11 is your default:
python -m venv venv

Activate it:

# Windows
venv\Scripts\activate

# macOS / Linux
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

⚠️ First-time install may take a while - includes heavy packages like torch, sentence-transformers, and easyocr.


4. Configure Environment Variables

cp .env.example .env

Then edit .env and fill in your values:

Variable Description
SECRET_KEY Any long random string
GEMINI_API_KEYS JSON array of keys - more keys = higher rate limits
TAVILY_API_KEY Your Tavily search API key
OPENAI_API_KEY Only needed if OpenAI is enabled in core/constants.py
USE_VISION_MODEL True to enable vision/OCR features, False to skip

💡 LLM Priority Order: Local LLM → Gemini → OpenAI Default config uses Gemini only. To switch providers, edit core/constants.py. Hit rate limits? Add more keys to GEMINI_API_KEYS - they rotate automatically.


5. Run the Application

Start the backend (first run downloads models - may take a few minutes):

py backend.py

In a separate terminal (venv activated), start the frontend:

py frontend.py

Frontend runs at http://localhost:5173 · Backend API at http://localhost:8000


Why AnalytiQ?

Most data tools are built for analysts. AnalytiQ is built for everyone who needs answers.

Traditional Tools AnalytiQ
Requires SQL / coding Plain English
Hours to build reports Seconds
Static dashboards Dynamic, queryable chat
Technical setup Upload and go
Black-box results Full SQL transparency
No chart customization 10+ chart types, auto or manual
Silent responses Built-in text-to-speech
Fixed AI behavior Per-thread custom instructions

AnalytiQ turns questions into insights, insights into reports, and reports into decisions.

About

Natural-language analytics for Excel and CSV with structured ingestion, text-to-SQL, interactive visualizations, source tracing, and generated reports.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages