An AI-powered platform empowering ASEAN MSMEs (Micro, Small, and Medium Enterprises) with cross-border trade intelligence, alternative credit scoring, supply chain optimization, and real-time market analytics.
Built for the BorneoHack hackathon, this full-stack application combines a FastAPI backend with a Next.js frontend, powered by Google Gemini AI and a LangGraph multi-agent orchestrator.
- LangGraph Multi-Agent Orchestrator β Supervisor Agent delegates tasks to specialist sub-agents
- Researcher Agent (7 tools) β Web search, ASEAN news, chart/graph generation, image generation, tariff guidance, TTS
- Quant Agent (4 tools) β Calculator, stock prices, live currency conversion, loan amortization
- Prompt Injection Protection β Hardened system prompts with security directives
- MCP Integration β Model Context Protocol server exposing tools over SSE
- Markdown-rendered responses with tables, charts, and images inline
- AI-powered Q&A on ASEAN import/export regulations
- RAG-based semantic search over trade regulation knowledge base (Supabase pgvector)
- Auto-generated compliance documents (Commercial Invoice, Certificate of Origin)
- Tariff lookup with HS code estimation under ATIGA framework
- AI credit model using 11+ non-traditional data points
- Assesses unbanked/offline businesses via digital transaction ratios, mobile payment volume, inventory turnover, supplier reliability, and customer ratings
- Visual score dial with risk tier classification and AI recommendations
- Smart supplier recommendation engine
- Demand forecasting and inventory optimization
- Regional supplier matching across ASEAN countries
- Real-time geopolitical risk surveillance with interactive map
- Live USGS earthquake data layer integration
- Multi-stream live news (Al Jazeera, Sky News, Euronews, DW)
- Live webcam feeds from global hotspots
- Country instability indices with dynamic risk scoring
- Digital onboarding for offline businesses
- Multi-step verified profile creation
- Supply chain identity generation (MSME-ID)
- Revenue & expense analytics with interactive Recharts visualizations
- Smart Process Manager (Kanban-style workflow)
- Market intelligence summary with regional breakdown
BorneoHack/
βββ backend/ # FastAPI Python Backend
β βββ app/
β β βββ main.py # Application entry point & CORS
β β βββ config.py # Pydantic settings from .env
β β βββ routers/
β β β βββ chatbot.py # AI-Finance Assist endpoint
β β β βββ trade_ai.py # Trade Navigator (RAG + Compliance)
β β β βββ credit.py # Alternative Credit Scoring
β β β βββ supply_chain.py # Supply Chain Optimization
β β β βββ market.py # Predictive Market Analytics
β β β βββ document_ai.py # Document Processing
β β β βββ translation.py # Multi-language Translation
β β β βββ inventory.py # Inventory Management
β β β βββ dashboard.py # Dashboard Analytics
β β β βββ mcp.py # Model Context Protocol Server
β β β βββ health.py # Health Check
β β βββ services/
β β β βββ agent.py # LangGraph Multi-Agent System (11 tools)
β β β βββ trade_ai.py # Trade AI RAG + Semantic Search
β β β βββ gemini_client.py # Google Gemini API Client
β β β βββ credit.py # Credit Scoring Engine
β β β βββ supply_chain.py # Supply Chain Logic
β β β βββ market.py # Market Analytics
β β β βββ document_ai.py # Document AI Service
β β β βββ translation.py # Translation Service
β β β βββ inventory.py # Inventory Service
β β β βββ dashboard.py # Dashboard Service
β β β βββ mem0_client.py # Mem0 Memory Client
β β β βββ supabase_client.py # Supabase Client
β β βββ schemas/ # Pydantic request/response models
β βββ requirements.txt
β βββ .env.example
β
βββ frontend/ # Next.js TypeScript Frontend
β βββ src/
β β βββ app/
β β β βββ page.tsx # Main Dashboard
β β β βββ trade-navigator/ # Trade Navigator Chat
β β β βββ credit-scoring/ # Credit Scoring UI
β β β βββ supply-chain/ # Supply Chain Management
β β β βββ worldmonitor/ # World Monitor Command Center
β β β βββ visibility-engine/ # Business Visibility Engine
β β β βββ globals.css # Design System & Tokens
β β βββ components/
β β βββ ai-chat.tsx # AI-Finance Assist Chat Widget
β β βββ right-chat-sidebar.tsx# Sliding Chat Drawer
β β βββ sidebar.tsx # Navigation Sidebar
β β βββ world-map.tsx # Interactive World Map
β βββ package.json
β
βββ README.md
The AI backbone uses LangGraph to orchestrate a Supervisor β Worker multi-agent pattern:
βββββββββββββββ
User Query ββββΆ β Supervisor β ββββ Structured Routing
β (Orchestrator)β
ββββββββ¬βββββββ
β
ββββββββββββββΌβββββββββββββ
βΌ βΌ
ββββββββββββββββββ ββββββββββββββββββ
β Researcher β β Quant β
β (7 Tools) β β (4 Tools) β
ββββββββββββββββββ€ ββββββββββββββββββ€
β β’ search_web β β β’ calculator β
β β’ asean_news β β β’ stock_price β
β β’ current_date β β β’ convert_curr β
β β’ gen_image β β β’ calc_loan β
β β’ gen_graph β ββββββββββββββββββ
β β’ tariff_info β
β β’ tts_url β
ββββββββββββββββββ
Security Features:
- Prompt injection defense across all agent prompts
- Domain-confinement (financial/trade topics only)
- System instruction concealment directives
- Input length capping on tool parameters
- Python 3.11+
- Node.js 18+
- npm or yarn
cd backend
# Create & activate virtual environment
python -m venv venv
.\venv\Scripts\activate # Windows
# source venv/bin/activate # macOS / Linux
# Install dependencies
pip install -r requirements.txt
# Copy env and configure API keys
cp .env.example .env
# Edit .env with your API keys (see Environment Variables below)
# Run dev server
uvicorn app.main:app --reload --port 8000API docs available at: http://localhost:8000/docs
cd frontend
# Install dependencies
npm install --legacy-peer-deps
# Run dev server
npm run devApp available at: http://localhost:3000
Create a .env file in /backend with:
| Variable | Description | Required |
|---|---|---|
GEMINI_API_KEY |
Google Gemini API key | β |
GEMINI_MODEL |
Gemini model name (e.g. gemini-2.5-flash) |
β |
TAVILY_API_KEY |
Tavily web search API key | β |
ALPHAVANTAGE_API_KEY |
Alpha Vantage stock/forex API key | β¬ Optional |
NEWS_API_KEY |
NewsAPI.org key for ASEAN headlines | β¬ Optional |
MEM0_API_KEY |
Mem0 memory layer API key | β¬ Optional |
SUPABASE_URL |
Supabase project URL | β¬ Optional |
SUPABASE_ANON_KEY |
Supabase anonymous key | β¬ Optional |
SUPABASE_SERVICE_KEY |
Supabase service role key | β¬ Optional |
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Root welcome message |
GET |
/api/health |
Health check |
POST |
/api/chatbot/message |
AI-Finance Assist (multi-agent) |
POST |
/api/trade-ai/query |
Trade regulation Q&A (RAG) |
POST |
/api/trade-ai/generate-document |
Compliance document generation |
POST |
/api/trade-ai/tariff-lookup |
Tariff rate lookup |
POST |
/api/credit/score |
Alternative credit scoring |
POST |
/api/supply-chain/recommend-suppliers |
Supplier recommendations |
GET |
/api/market/analysis |
Market analytics |
POST |
/api/document-ai/process |
Document AI processing |
POST |
/api/translation/translate |
Multi-language translation |
GET |
/api/dashboard/summary |
Dashboard data |
GET |
/api/mcp/ |
MCP Server (SSE) |
| Layer | Technology |
|---|---|
| Frontend | Next.js 16.1, React 19, TypeScript, Tailwind CSS v4 |
| UI Components | Lucide React, Recharts, react-simple-maps, react-markdown, remark-gfm |
| Backend | FastAPI, Python 3.11+, Pydantic v2 |
| AI/LLM | Google Gemini (gemini-2.5-flash), LangChain, LangGraph |
| Agent Tools | Tavily (search), Alpha Vantage (stocks), NewsAPI (news), QuickChart (graphs), Pollinations (images), ExchangeRate API (forex) |
| Database | Supabase (PostgreSQL + pgvector) |
| Memory | Mem0 (conversational memory) |
| Protocol | Model Context Protocol (MCP) via FastMCP |
https://drive.google.com/file/d/1lJO3Bpwct4cWzprqfkGMhjadmW7-dFuZ/view?usp=sharing
This project is for hackathon demonstration purposes.