ব্যাপারী· B-AI

Byapari AI Documentation

Everything judges and developers need to understand the platform — architecture, APIs, the ML stack, and how to get started.

01
System Capabilities

What is Byapari AI

ENEnglish Description

Byapari AI is an AI-powered business intelligence platform designed for Bangladeshi merchants — upload your sales CSV and instantly receive KPIs, a 30-day Prophet forecast, AI-generated recommendations, a dynamic pricing engine, and a full business health score. Built for Infinity AI BuildFest 2026 by Team Nexion, it combines a FastAPI backend with a Next.js frontend to deliver real-time insights with zero manual configuration.

বাংলাBengali Description

ব্যাপারী AI বাংলাদেশি ব্যবসায়ীদের জন্য একটি এআই-চালিত বিজনেস ইন্টেলিজেন্স প্ল্যাটফর্ম — আপনার সেলস CSV আপলোড করুন এবং সাথে সাথে পান KPI, ৩০-দিনের বিক্রয় পূর্বাভাস, AI পরামর্শ, ডাইনামিক প্রাইসিং ইঞ্জিন এবং সম্পূর্ণ বিজনেস হেলথ স্কোর। টিম নেক্সিয়নের তৈরি এই প্ল্যাটফর্ম ব্যবহারকারীকে কোনো কনফিগারেশন ছাড়াই রিয়েল-টাইম ব্যবসায়িক অন্তর্দৃষ্টি দেয়।

KPI Dashboard 30-Day Forecast Dynamic Pricing AI Insights Health Score RAG Knowledge Base Bengali + English
02
Data Pipeline

How It Works

Three steps from raw CSV to actionable business intelligence.

STEP 01
Upload
Drop your sales CSV
Supports any CSV with date, product, sales, profit, quantity, rating, stock columns. Auto-detects and fixes encoding issues.
STEP 02
Analyze
ML processes your data
Prophet forecasts 30 days ahead. Rule-based engine scores health. RAG retrieves relevant business tips from 35-tip knowledge base.
STEP 03
Act
Get prioritized actions
Dynamic pricing suggestions per product, high-priority AI alerts, Bengali/English insights, and a downloadable action plan.
Required CSV Columns
dateproduct_nameproduct_categorysalesprofitquantityratingreturnedstockpayment_methodcustomer_city
03
HTTP JSON API

API Reference

REST endpoints accepting and returning JSON.

POST/api/ai-insightsFull AI analysis: KPIs, insights, health score, forecast, RAG tips
POST/api/pricing-suggestionsPer-product dynamic pricing suggestions with priority ranking
POST/uploadUpload CSV file (multipart/form-data), returns parsed data + quick KPIs
GET/healthBackend health check — used by frontend connection indicator
POST/api/ai-insights

Request body (Content-Type: application/json):

JSON
{
  "csv_data": [
    {
      "date": "2025-01-01",
      "product_name": "Samsung Galaxy A54",
      "product_category": "Electronics",
      "sales": 1250000,
      "profit": 312500,
      "quantity": 5,
      "rating": 4.8,
      "returned": "No",
      "stock": 15,
      "payment_method": "Mobile Banking",
      "customer_city": "Dhaka"
    }
  ],
  "lang": "en"
}

Response (200 OK):

JSON
{
  "insights": [
    {
      "type": "warning",
      "title": "Low Stock Alert",
      "message": "Samsung Galaxy A54 has only 15 units — reorder urgently.",
      "priority": "high",
      "confidence": 0.91
    },
    {
      "type": "growth",
      "title": "Top Performer Identified",
      "message": "Galaxy A54 leading revenue with ৳1,250,000 in sales.",
      "priority": "low",
      "confidence": 0.85
    }
  ],
  "rag_recommendations": [
    {
      "id": "tip_12",
      "text": "রমজান মাসে ইলেকট্রনিক্স পণ্যের চাহিদা ৩০% বাড়ে — আগে স্টক করুন।",
      "category": "seasonal",
      "relevance": 0.78
    }
  ],
  "health_score": 82,
  "top_performer": { "product": "Samsung Galaxy A54", "revenue": 1250000 },
  "worst_performer": null,
  "forecast": [
    { "date": "2025-02-01", "predicted_sales": 1312500, "lower_bound": 1150000, "upper_bound": 1475000 }
  ],
  "period_analyzed": "2025-01-01 to 2025-01-31",
  "confidence": 0.87,
  "data_points": 1,
  "generated_at": "2025-01-31T14:32:00"
}
POST/api/pricing-suggestions

Response (200 OK):

JSON
{
  "suggestions": [
    {
      "product": "Samsung Galaxy A54",
      "suggestion": "increase_price",
      "reason": "scarcity_premium",
      "price_change_percent": 10,
      "priority": "high",
      "display_text": "Increase price by 10% — low stock with strong demand",
      "current_metrics": {
        "total_sales": 1250000,
        "profit_margin": 25.0,
        "avg_rating": 4.8,
        "return_rate": 0.0,
        "stock_days_remaining": 3.0,
        "velocity": 41.67
      }
    }
  ],
  "summary": {
    "total_opportunities": 1,
    "revenue_at_risk": 1250000,
    "potential_uplift": 125000,
    "top_priority": "Samsung Galaxy A54",
    "stable_products": 0,
    "total_products": 1
  },
  "generated_at": "2025-01-31T14:32:00"
}
04
Service Mapping

Architecture

Fully serverless architecture: Next.js frontend on Vercel, FastAPI backend on Railway.

👤
Browser
User uploads CSV
Next.js 16
Vercel · React
FastAPI
Railway · Python

Frontend Stack

Next.js 16 (App Router)
TypeScript + Tailwind CSS 4
Recharts for data viz
Lucide React icons
Deployed on Vercel

Backend Stack

Python 3.11 + FastAPI
Facebook Prophet (forecasting)
Keyword RAG (Bengali tips)
Groq LLM (llama-3.1-8b-instant)
Deployed on Railway
05
Local Knowledge

RAG Knowledge Base

Retrieval-Augmented Generation featuring 35 hand-curated Bengali business intelligence tips.

Byapari AI ships with 35 hand-curated Bengali business tips retrieved by a lightweight keyword-matching engine. When you upload your CSV, the system builds a context string from your business situation, scores it against the knowledge base, and surfaces the 3 most relevant tips — zero model downloads, instant startup, zero per-request API cost. Retrieved tips are injected into the LLM prompt as grounding context alongside knowledge-graph facts, your merchant profile, and live market signals.

35 tips
Knowledge base size
Keyword match
Retrieval engine
Top 3
Tips returned per query

How retrieval works

1Business context extracted from uploaded CSV (categories, trends, stock levels)
2Context embedded via paraphrase-multilingual-MiniLM-L12-v2 (supports Bengali)
3Cosine similarity search against vector index
4Top-3 results appended to AI insights response

Tip categories

Seasonal demand8 tips
Inventory management9 tips
Pricing strategy8 tips
Customer retention6 tips
Payment & cash flow4 tips
Sample Tip from Knowledge Base

"রমজান মাসে ইলেকট্রনিক্স ও ফ্যাশন পণ্যের চাহিদা ৩০-৪০% বৃদ্ধি পায় — ঈদের ৩ সপ্তাহ আগে স্টক বাড়ান এবং বিশেষ বান্ডেল অফার তৈরি করুন।"

Translation: "Electronics and fashion demand rises 30-40% in Ramadan — stock up 3 weeks before Eid and create bundle deals."

06
Instant Testing

Sample CSV

Use this to test the platform instantly — 10 rows, all required columns.

CSV
date,product_name,product_category,sales,profit,quantity,rating,returned,stock,payment_method,customer_city
2025-01-01,Cats Eye Jeans,Fashion,202608,64023.51,28,4.2,No,252,Cash on Delivery,Comilla
2025-01-03,Bashundhara Tissue Box,Home & Kitchen,669935,260869.93,35,4.6,No,221,Bank Transfer,Rangpur
2025-01-04,Awei Bluetooth Headset,Mobile Accessories,327761,121497.59,49,4.1,No,318,Bank Transfer,Chittagong
2025-01-09,Kiam Pressure Cooker,Home & Kitchen,370790,75429.26,35,4.5,No,64,Bank Transfer,Chittagong
2025-01-12,Samsung Galaxy A54,Electronics,1250000,312500.00,5,4.8,No,15,Mobile Banking,Dhaka
2025-01-15,Nike Running Shoes,Fashion,450000,135000.00,12,4.3,Yes,88,Cash on Delivery,Sylhet
2025-01-18,Walton Refrigerator,Home Appliances,980000,196000.00,3,4.7,No,22,Bank Transfer,Dhaka
2025-01-20,RFL Plastic Chair,Furniture,45000,13500.00,60,3.9,No,400,Cash on Delivery,Mymensingh
2025-01-22,Singer Sewing Machine,Home Appliances,320000,80000.00,8,4.4,No,35,Mobile Banking,Rajshahi
Upload to Dashboard

Tip: The platform auto-detects and handles missing values, inconsistent casing in the returned column (Yes/yes/YES/1/true), and date format variations. Minimum 3 rows per product for pricing analysis.