Skip to content

xprabhudayal/mira

Repository files navigation

🔮 Mira: AI-Powered CSV Data Analyst

Upload any CSV, get instant AI-powered insights with beautiful visualizations

Amazon Kiro E2B Gemini Vercel

🚀 Live Demo📊 Try Analysis


📋 Table of Contents


💬 The Problem

Last year, I was helping my uncle with his restaurant. He kept complaining about the POS system dumping massive CSV files every week—thousands of rows of orders, payments, inventory.

He'd open it once, get overwhelmed, and close it. "I just need to know if we're doing better than last month," he'd say.

Business owners don't need spreadsheets. They need answers.


💡 The Solution

Mira bridges the gap between raw data and actual understanding.

Upload any CSV file through our web interface, and within minutes receive:

  • 📊 Automatic data exploration - AI understands your data structure
  • 📈 Beautiful visualizations - Charts generated with matplotlib
  • 🔢 Key metrics & KPIs - Numbers that matter, extracted automatically
  • 💡 Actionable insights - Recommendations based on your data

No Excel skills required. No SQL knowledge needed. Just upload and get answers.


🛠️ Amazon Kiro Integration

This entire project was built using Amazon Kiro as the primary development environment.

How Kiro Accelerated Development

Amazon Kiro was instrumental throughout the entire development lifecycle:

Phase How Kiro Helped
Architecture Design Designed multi-agent architecture with E2B sandbox integration
Code Generation Generated E2B agent logic, API routes, and React components
Debugging Fixed Gemini model compatibility, function calling format issues
UI Development Built responsive landing page and CSV upload interface
Deployment Configured Vercel deployment with environment variables

Kiro Usage Screenshots

Development Session Code Generation Deployment
Kiro Session 1 Kiro Session 2 Kiro Session 3
Architecture planning & setup Building E2B agent & APIs Testing & production deployment

Key Implementations with Kiro

// E2B Agent - Core analysis engine built with Kiro
export async function runE2BAgent(input: E2BAgentInput): Promise<E2BAgentOutput> {
  // Kiro helped design the iterative analysis loop
  // with proper Gemini function calling and error handling
  const sandbox = await Sandbox.create();
  // Multi-round analysis with automatic chart generation
}

// Web API - Clean endpoint for CSV analysis
export async function POST(req: NextRequest) {
  // Kiro created the complete analyze endpoint
  // with file upload handling and E2B integration
}

✨ Key Features

Feature Description
🔐 Secure Sandboxed Execution All Python code runs in isolated E2B sandboxes - no access to production systems
🧠 Multi-Step AI Agent Iterative analysis with automatic data exploration, SQL-like queries, and KPI extraction
📊 Auto Visualization Minimum 3 matplotlib charts per analysis - histograms, bar charts, trends
🎯 Smart Insights AI extracts meaningful patterns, anomalies, and actionable recommendations
Fast Processing Analysis completes in 1-2 minutes for most datasets
🌐 Web-Based No installation required - works in any browser

🏗️ Architecture

┌─────────────────────────────────────────────────────────────────┐
│                         WEB INTERFACE                           │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │              Next.js Frontend (React)                    │   │
│  │         Landing Page  •  CSV Upload  •  Results          │   │
│  └─────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                         API LAYER                               │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │              /api/analyze (POST)                         │   │
│  │         Receives CSV • Triggers E2B Agent                │   │
│  └─────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                    AI ANALYSIS ENGINE                           │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │              E2B Code Interpreter Sandbox                │   │
│  │  ┌─────────┐  ┌─────────┐  ┌─────────────┐             │   │
│  │  │ Pandas  │  │ SQLite  │  │ Matplotlib  │             │   │
│  │  └─────────┘  └─────────┘  └─────────────┘             │   │
│  └─────────────────────────────────────────────────────────┘   │
│                              │                                  │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │           Gemini 2.0 Flash (Orchestration)               │   │
│  │      Function Calling • Multi-Round Analysis             │   │
│  └─────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                         OUTPUT                                  │
│       Summary • KPIs • Charts (Base64) • Recommendations        │
└─────────────────────────────────────────────────────────────────┘

Technology Stack

Component Technology Purpose
Development Amazon Kiro AI-assisted development
Frontend Next.js 15 + React Web interface
Styling Tailwind CSS Responsive design
AI Orchestration Google Gemini 2.0 Flash Agent reasoning & function calling
Code Execution E2B Code Interpreter Secure Python sandboxes
Data Processing Pandas + SQLite CSV analysis
Visualization Matplotlib Chart generation
Deployment Vercel Serverless hosting

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • E2B API Key (e2b.dev - $100 free credits)
  • Google Gemini API Key (ai.google.dev - free tier)

Installation

# Clone repository
git clone https://github.com/AWS-25/mira.git
cd mira

# Install dependencies
npm install

# Configure environment
cp env.example .env.local
# Edit .env.local with your API keys

# Start development server
npm run dev

Project Structure

mira/
├── app/
│   ├── api/
│   │   └── analyze/route.ts    # CSV analysis endpoint
│   ├── analyze/page.tsx        # Upload interface
│   ├── page.tsx                # Landing page
│   ├── layout.tsx              # Root layout
│   └── globals.css             # Tailwind styles
├── lib/
│   ├── e2b-agent.ts            # Core AI agent logic
│   └── types.ts                # TypeScript definitions
├── assets/                     # Kiro screenshots
├── env.example                 # Environment template
└── README.md                   # This file

🎯 Impact & Scalability

Real-World Impact

Metric Value
Time Saved 30 min manual analysis → 2 min automated
Accessibility No Excel/SQL knowledge required
Cost Free tier covers ~50+ analyses/month
Reach Works on any device with a browser

Target Users

  • Small Business Owners - Restaurant owners, retail shops, service providers
  • Non-Technical Managers - Sales managers, operations leads
  • Students & Researchers - Quick data exploration
  • Anyone with CSV files - No technical skills required

Scalability

  • Serverless Architecture - Auto-scales with Vercel
  • Isolated Sandboxes - E2B handles compute scaling independently
  • Stateless Design - Easy horizontal scaling
  • Edge Deployment - Fast global response times

📦 Hackathon Submission

✅ Submission Checklist

Requirement Status Details
Project Documentation Complete README with architecture, setup, and impact
Working Code Clean TypeScript codebase
Live Demo mira-aws.vercel.app
Amazon Kiro Usage Screenshots + detailed integration documentation

🏆 Scoring Highlights

Criteria Implementation
🛠️ Tool Integration Extensive Amazon Kiro usage - architecture, code generation, debugging, deployment
🌐 Technical Quality Production-ready, well-architected with E2B sandboxes + Gemini AI
🧾 Documentation Comprehensive README with setup instructions and architecture diagrams
💡 Innovation AI-powered CSV analysis accessible to non-technical users
🎯 Impact Solves real problem - makes data analysis accessible to everyone
📈 Scalability Serverless architecture with isolated compute sandboxes

Built with ❤️ using Amazon Kiro for AWS Vibeathon 2025

Making data analysis accessible to everyone

About

Upload any CSV, get instant AI-powered insights with beautiful visualizations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published