Skip to content

Dipan2004/Notiflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ NotiFlow โ€” AI-Powered Business Operations Assistant

Turning informal business chaos into structured, automated intelligence โ€” powered by Amazon Nova.

NotiFlow is an end-to-end AI operations assistant designed for small and micro businesses across India. It automatically processes informal business notifications (in Hinglish/English) from WhatsApp, GPay, Amazon Seller, and other sources โ€” detecting intent, extracting entities, executing business logic, and syncing everything to a live Google Sheets ledger in real time.


๐Ÿ“‹ Table of Contents


๐Ÿ”ด The Problem

For a single small business owner, managing daily operations is incredibly messy and overwhelming. Throughout the day, they receive orders, payments, and credit requests continuously from multiple different apps at the same time:

  • WhatsApp: "bhaiya 3 kilo aata bhej dena"
  • GPay: "โ‚น8000 received from Amit"
  • Amazon Seller: "Product: Silk Kurti. Qty: 2. Total: โ‚น1500"
  • Credit requests: "suresh ko 500 ka maal udhar dena"

Tracking all of this manually in physical notebooks or constantly switching between multiple apps is chaotic. Because there are so many notifications from different sources, it's extremely difficult for one person to maintain a unified record. As a result, owners frequently miss orders, lose track of payments, and struggle with inventory management.

The Language Barrier (Problem We Faced): Furthermore, these messages are almost always written in Hinglish (a complex mix of Hindi and English) or use highly informal, code-mixed formatting. Traditional software simply cannot understand this colloquial language, making it nearly impossible to parse and automate accurately.

There is a desperate need for a single, unified system. The owner should not have to manually scroll through every app and write things down. Instead, a central system should ingest notifications from all these apps, understand the informal Hinglish intents, and automatically construct a unified digital ledger.


๐Ÿ’ก The Solution

NotiFlow uses Amazon Nova Lite (nova-lite-v1:0) via Amazon Bedrock to automatically convert raw, informal business notifications into structured, actionable operations.

One message in โ†’ complete business operation out.

"bhaiya 3 kilo aata bhej dena"
        โ†“
Intent:    order
Item:      aata
Quantity:  3
        โ†“
โœ… Order recorded
โœ… Inventory deducted
โœ… Invoice generated
โœ… Google Sheets updated
โœ… Dashboard refreshed

๐Ÿ— Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚     React Dashboard         โ”‚
โ”‚  (Real-time Pipeline View)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
              โ”‚ POST /api/notification
              โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚     FastAPI Backend          โ”‚
โ”‚   (notification_routes.py)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
              โ”‚ run_notiflow(message, source)
              โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚     AI Agent Pipeline        โ”‚
โ”‚                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚  โ”‚  1. Intent Agent     โ”‚    โ”‚
โ”‚  โ”‚  (Amazon Nova Lite)  โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ”‚             โ–ผ                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚  โ”‚  2. Extraction Agent โ”‚    โ”‚
โ”‚  โ”‚  (Amazon Nova Lite)  โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ”‚             โ–ผ                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚  โ”‚  3. Data Validator  โ”‚     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ”‚             โ–ผ                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚  โ”‚  4. Skill Router    โ”‚     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ”‚             โ–ผ                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚  โ”‚  5. Google Sheets   โ”‚     โ”‚
โ”‚  โ”‚     Ledger Sync     โ”‚     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โœจ Features

Core AI

  • Hinglish NLU โ€” Native understanding of Hindi-English code-mixed business language
  • Multi-intent classification โ€” Order, Payment, Credit, Return, Preparation
  • Structured entity extraction โ€” Customer, item, quantity, amount, payment type
  • Data validation โ€” Hindi numeral parsing, payment alias normalization (GPay โ†’ UPI)
  • Agent memory โ€” Remembers recent customers and items for contextual understanding

Automation

  • Zero-config pipeline โ€” Every notification triggers: AI processing โ†’ skill execution โ†’ ledger update โ†’ dashboard refresh
  • Live Google Sheets ledger โ€” Rows auto-appended, no manual export, no file downloads
  • Invoice generation โ€” Automatic invoices for every order
  • Inventory tracking โ€” Automatic stock deduction on orders

Multi-Source Ingestion

  • WhatsApp messages
  • GPay/UPI payment notifications
  • Amazon Seller orders
  • Custom webhooks via REST API
  • Real-time WebSocket streaming

Resilience

  • Dual model fallback โ€” Amazon Nova โ†’ Gemini โ†’ Demo mode
  • Graceful Sheets failure โ€” If Google Sheets API fails, pipeline continues normally
  • Error isolation โ€” No single failure crashes the system

๐Ÿ›  Tech Stack

Layer Technology
AI Engine Amazon Nova Lite (v1:0) via Amazon Bedrock
Backup AI Google Gemini
Backend Python 3.10+, FastAPI, Uvicorn
Frontend React 18, TypeScript, Vite, Tailwind CSS
Live Ledger Google Sheets API (gspread + google-auth)
Local Storage Excel (pandas + openpyxl)
Real-time WebSocket
Auth Google Service Account (OAuth2)
Config python-dotenv

๐Ÿ“ Project Structure

Notiflow/
โ”œโ”€โ”€ agent/                    # AI Agent Pipeline
โ”‚   โ”œโ”€โ”€ intent_agent.py       # Stage 1: Intent classification (Nova)
โ”‚   โ”œโ”€โ”€ extraction_agent.py   # Stage 2: Entity extraction (Nova)
โ”‚   โ”œโ”€โ”€ orchestrator.py       # Pipeline orchestrator (all stages)
โ”‚   โ”œโ”€โ”€ router.py             # Skill router (intent โ†’ skill)
โ”‚   โ”œโ”€โ”€ model_router.py       # Model selection (Nova/Gemini)
โ”‚   โ””โ”€โ”€ skill_generator.py    # Dynamic skill generation
โ”‚
โ”œโ”€โ”€ api/
โ”‚   โ””โ”€โ”€ notification_routes.py # FastAPI endpoints + WebSocket
โ”‚
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ config.py             # Central configuration
โ”‚   โ”œโ”€โ”€ main.py               # run_notiflow() โ€” public API
โ”‚   โ””โ”€โ”€ bedrock_client.py     # Amazon Bedrock client
โ”‚
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ main.py               # FastAPI app entry point
โ”‚   โ””โ”€โ”€ requirements.txt      # Python dependencies
โ”‚
โ”œโ”€โ”€ dashboard/                # React frontend
โ”‚   โ””โ”€โ”€ src/
โ”‚       โ”œโ”€โ”€ App.tsx           # Main app component
โ”‚       โ”œโ”€โ”€ react.tsx         # VyaparFlow dashboard UI
โ”‚       โ”œโ”€โ”€ api.ts            # Backend API client
โ”‚       โ””โ”€โ”€ index.css         # Styles
โ”‚
โ”œโ”€โ”€ services/
โ”‚   โ”œโ”€โ”€ google_sheets_service.py  # Google Sheets ledger sync
โ”‚   โ”œโ”€โ”€ inventory_service.py      # Stock management
โ”‚   โ”œโ”€โ”€ invoice_service.py        # Invoice generation
โ”‚   โ”œโ”€โ”€ excel_sync.py             # Excel persistence
โ”‚   โ””โ”€โ”€ notification_generator.py # Demo notification generator
โ”‚
โ”œโ”€โ”€ skills/                   # Business skills
โ”‚   โ”œโ”€โ”€ order_skill.py        # Order processing
โ”‚   โ”œโ”€โ”€ payment_skill.py      # Payment recording
โ”‚   โ”œโ”€โ”€ credit_skill.py       # Credit tracking
โ”‚   โ”œโ”€โ”€ return_skill.py       # Return handling
โ”‚   โ””โ”€โ”€ preparation_skill.py  # Preparation queuing
โ”‚
โ”œโ”€โ”€ validators/
โ”‚   โ””โ”€โ”€ data_validator.py     # Entity normalization
โ”‚
โ”œโ”€โ”€ memory/
โ”‚   โ””โ”€โ”€ agent_memory.py       # Agent context memory
โ”‚
โ”œโ”€โ”€ credentials/
โ”‚   โ””โ”€โ”€ sheets.json           # Google service account key
โ”‚
โ”œโ”€โ”€ data/                     # Runtime data (Excel store)
โ”œโ”€โ”€ .env                      # Environment variables
โ””โ”€โ”€ requirements.txt          # Python dependencies

๐Ÿš€ Getting Started

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • AWS account with Bedrock access (for live mode)
  • Google Cloud service account (for Sheets integration)

1. Clone and Install Backend

cd Notiflow
pip install -r requirements.txt

2. Set Up Environment Variables

Create a .env file in the project root:

# AWS Bedrock (for live AI mode)
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_DEFAULT_REGION=us-east-1

# Google Sheets Integration
GOOGLE_SHEETS_CREDENTIALS=credentials/sheets.json
GOOGLE_SHEET_ID=your_google_sheet_id

# Optional
GEMINI_API_KEY=your_gemini_key
NOTIFLOW_DEMO_MODE=true

3. Set Up Google Sheets

  1. Create a new Google Sheet at sheets.google.com
  2. Add headers in Row 1:
intent item quantity customer amount source timestamp
  1. Share the sheet with your service account email (found in credentials/sheets.json โ†’ client_email) as Editor
  2. Copy the Sheet ID from the URL and update GOOGLE_SHEET_ID in .env

4. Start the Backend

cd Notiflow
uvicorn backend.main:app --reload

Backend runs at: http://localhost:8000 API docs at: http://localhost:8000/docs

5. Start the Dashboard

cd Notiflow/dashboard
npm install
npm run dev

Dashboard runs at: http://localhost:5173


๐Ÿ“ก API Reference

POST /api/notification

Process a business notification through the full AI pipeline.

Request:

{
  "source": "whatsapp",
  "message": "bhaiya 3 kilo aata bhej dena"
}

Response:

{
  "message": "bhaiya 3 kilo aata bhej dena",
  "intent": "order",
  "data": {
    "customer": null,
    "item": "aata",
    "quantity": 3
  },
  "event": {
    "event": "order_received",
    "order": {
      "order_id": "ORD-20260316-0001",
      "customer": null,
      "item": "aata",
      "quantity": 3,
      "status": "pending"
    },
    "invoice": {
      "invoice_id": "INV-20260316-ABCD",
      "total_amount": 0.0
    }
  },
  "source": "whatsapp",
  "sheet_updated": true,
  "model": "live"
}

GET /api/notifications/generate?n=5

Generate demo notifications using Gemini.

WebSocket /ws/notifications

Real-time bidirectional notification streaming.

Send:

{"source": "whatsapp", "message": "rahul ne 15000 bheja"}

Receive: Same response format as POST endpoint, broadcast to all clients.

GET /api/stream/start?n=5&delay=2.0

Trigger automated Gemini notification streaming.

GET /health

Health check with configuration summary.


๐Ÿง  AI Agent Pipeline

The pipeline processes each message through 5 sequential stages:

Stage 1 โ€” Intent Detection

Amazon Nova classifies the message into one of 6 intents:

Intent Example
order "bhaiya 3 kurti bhej dena"
payment "rahul ne 15000 bheja"
credit "udhar me de dijiye"
return "size chota hai exchange karna hai"
preparation "3 kurti ka set ready rakhna"
other Unclassified messages

Stage 2 โ€” Entity Extraction

Nova extracts structured fields based on the detected intent:

Field Example Values
customer "Rahul", "Amit Kumar"
item "kurti", "aata", "silk saree"
quantity 3, 5 (parsed from Hindi numerals too)
amount 15000, 8000
payment_type "upi" (normalized from gpay/paytm/phonepe)
reason "size issue", "defective"

Stage 3 โ€” Data Validation

Normalizes extracted data:

  • Number parsing (Hindi โ†’ integer)
  • Text cleanup
  • Payment alias mapping (GPay/PhonePe/Paytm โ†’ UPI)

Stage 4 โ€” Skill Routing

Dispatches to the appropriate business skill based on intent.

Stage 5 โ€” Google Sheets Sync

Appends a structured row to the configured Google Sheet.


โšก Business Skills

Each skill handles persistence, side effects, and returns a structured event:

Skill Trigger Intent Actions
Order Skill order Record order โ†’ Deduct inventory โ†’ Generate invoice โ†’ Update memory
Payment Skill payment Record payment โ†’ Update ledger โ†’ Update memory
Credit Skill credit Record credit entry โ†’ Track outstanding balance
Return Skill return Log return request โ†’ Set status to pending_review
Preparation Skill preparation Queue preparation task โ†’ Track readiness

๐Ÿ“Š Google Sheets Integration

NotiFlow uses Google Sheets as a live, cloud-accessible business ledger โ€” no Excel downloads, no manual exports.

How It Works

  1. Service account authenticates via credentials/sheets.json
  2. After every AI pipeline execution, a row is auto-appended
  3. The dashboard shows sync status (โœ… Synced / โš ๏ธ Failed)

Row Structure

intent item quantity customer amount source timestamp
order aata 3 Rahul whatsapp 2026-03-16 19:30
payment Amit 8000 gpay 2026-03-16 19:31
credit goods Suresh 500 whatsapp 2026-03-16 19:32

Error Handling

  • If credentials are missing โ†’ logs warning, returns sheet_updated: false
  • If Sheets API fails โ†’ logs error, pipeline continues normally
  • The system never crashes due to a Sheets failure

๐Ÿ–ฅ Dashboard

The React dashboard provides a premium, real-time operations console:

Reasoning Engine View

  • Step 1 โ€” POST /Ingest: Shows the raw notification payload
  • Step 2 โ€” AI Reasoning: Displays detected intent and extracted entities from the backend response
  • Step 3 โ€” Skills Applied: Shows record finalization status and Google Sheets ledger sync badge

Business Ledger View

  • Orders tab: All processed orders with source, customer, item, quantity, status
  • Ledger tab: Payment and credit records
  • Inventory tab: Current stock levels with alerts

Mobile Simulation Panel

  • Displays a live "Signal Stream" of incoming notifications
  • Simulates a mobile device receiving business messages

โš™ Configuration

All settings are centralized in app/config.py:

Setting Default Description
DEMO_MODE true Use demo data instead of live Bedrock
BEDROCK_MODEL_ID amazon.nova-lite-v1:0 Nova model ID
BEDROCK_REGION us-east-1 AWS region
DATA_FILE data/notiflow_data.xlsx Local Excel store
GOOGLE_SHEETS_CREDENTIALS credentials/sheets.json Service account path
GOOGLE_SHEET_ID (from .env) Target Google Sheet key

๐Ÿ” Environment Variables

Variable Required Description
AWS_ACCESS_KEY_ID For live mode AWS access key
AWS_SECRET_ACCESS_KEY For live mode AWS secret key
AWS_DEFAULT_REGION No Default: us-east-1
GOOGLE_SHEETS_CREDENTIALS For Sheets Path to service account JSON
GOOGLE_SHEET_ID For Sheets Google Sheet key from URL
GEMINI_API_KEY Optional Gemini fallback API key
NOTIFLOW_DEMO_MODE No true / false

๐ŸŽฎ Demo Mode

When NOTIFLOW_DEMO_MODE=true (default), NotiFlow operates without AWS credentials:

  • Pre-configured responses for common Hinglish business messages
  • Keyword-based intent fallback for unknown messages
  • Google Sheets sync still works in demo mode
  • Full dashboard experience without cloud dependencies

Set NOTIFLOW_DEMO_MODE=false to use live Amazon Nova inference via Bedrock.


๐Ÿ“„ License

This project was built for the Amazon Nova Hackathon.


Built with โค๏ธ using Amazon Nova Lite ยท FastAPI ยท React ยท Google Sheets

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors