Skip to main content
Glama
README.md
# VaultAlexa+ โ€” Alexa+ Smart Personal Financial & Intelligent Shopping Agent

<div align="center">

[![Amazon Developer Hackathon 2026](https://img.shields.io/badge/Amazon%20Developer%20Hackathon-2026-FF9900?style=for-the-badge&logo=amazon&logoColor=white)](https://amazonappdev2026.devpost.com/)
[![Alexa+ Track](https://img.shields.io/badge/Track-Alexa%2B%20MCP%20Server-2563EB?style=for-the-badge&logo=amazon-alexa&logoColor=white)](https://amazonappdev2026.devpost.com/)
[![MCP Spec 2025-11-25](https://img.shields.io/badge/MCP%20Spec-2025--11--25-10B981?style=for-the-badge)](https://modelcontextprotocol.io/)
[![JSON-RPC 2.0](https://img.shields.io/badge/Transport-Streamable%20HTTP%20%2B%20SSE-6366F1?style=for-the-badge)](https://www.jsonrpc.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-8B5CF6?style=for-the-badge)](LICENSE)
[![Version](https://img.shields.io/badge/Version-2.5.0-F59E0B?style=for-the-badge)](package.json)
[![YouTube Demo](https://img.shields.io/badge/YouTube-Watch%20Demo%20Video-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/watch?v=U0SNEII29Cg)

**Enterprise-grade autonomous AI financial advisor and intelligent Amazon shopping assistant** โ€” powered by Model Context Protocol (MCP) Spec `2025-11-25` over JSON-RPC 2.0 Streamable HTTP.

[๐ŸŽฌ Watch Demo Video](https://www.youtube.com/watch?v=U0SNEII29Cg) ยท [๐Ÿš€ Quickstart](#-quickstart) ยท [๐Ÿ› ๏ธ MCP Tools Reference](#๏ธ-mcp-tools-reference-15-tools) ยท [๐Ÿงช Testing Guide for Judges](#-testing-guide-for-judges) ยท [๐Ÿ—๏ธ Architecture](#๏ธ-architecture) ยท [๐Ÿ“œ Friction Log](FRICTION_LOG.md)

</div>

---

<div align="center">

### ๐ŸŽฌ Watch Live Product Demo Video (3 Minutes)

[![VaultAlexa+ Live Demo Video](https://img.youtube.com/vi/U0SNEII29Cg/maxresdefault.jpg)](https://www.youtube.com/watch?v=U0SNEII29Cg)

*๐Ÿ‘‰ Click the banner above to watch the full demonstration on YouTube: [https://www.youtube.com/watch?v=U0SNEII29Cg](https://www.youtube.com/watch?v=U0SNEII29Cg)*

</div>

---

<div align="center">

![Key Features](docs/images/features-showcase.jpg)

</div>

---

## ๐Ÿ“Œ Overview

**VaultAlexa+** is a **Two-Sided Bilateral AI Agent** bridging **Consumers (Buyers)** with the **Amazon Seller Ecosystem**:

| ๐Ÿ›’ For **Buyers** | ๐Ÿช For **Sellers** |
|---|---|
| Pre-purchase safety validation against monthly budgets | FBA inventory stockout prediction & PO drafting |
| Proactive deficit risk forecast (upcoming bills radar) | Real-time sales analytics & revenue intelligence |
| 1-Click Alexa+ Voice Purchasing with budget guards | Dynamic repricing strategy & Buy Box optimization |
| Bilateral AI negotiation for instant discount vouchers | AI-powered product listing generation from photos |
| Anti-impulse cooldown & opportunity cost simulation | Incoming orders dispatch monitoring |
| Household bill splitting via Alexa Contacts | Multimodal product catalog publishing |
| Price drop sniper & deal watchlist | โ€” |

---

## ๐Ÿ“ธ Screenshots

| ๐Ÿ“Š Financial Dashboard & Alexa+ Chat | ๐Ÿ›๏ธ Intelligent Amazon Shopping Assistant |
|:---:|:---:|
| ![Dashboard Overview](docs/screenshots/dashboard_preview.jpeg) | ![Shopping Deals](docs/screenshots/shopping_deals.jpeg) |

| ๐Ÿ”Œ Interactive MCP Protocol Inspector | ๐Ÿค AI Negotiation & Anti-Impulse Guard |
|:---:|:---:|
| ![MCP Inspector](docs/screenshots/mcp_inspector.jpeg) | ![AI Negotiation Cooldown](docs/screenshots/ai_negotiation_cooldown.jpeg) |



---

## ๐ŸŒŸ Key Highlights

- **15 MCP Tools** (far exceeding the minimum 5 required)
- **3 MCP Resources** (`vault://` URI scheme)
- **2 Reusable Prompts** (financial audit, deal negotiation)
- **Full Bilingual** โ€” EN (`US`) and Bahasa Indonesia (`ID`) with dynamic switching
- **Visual Reasoning Trace** โ€” real-time agentic chain-of-thought visible to judges
- **Human-in-the-Loop** โ€” Seller can review, edit, and approve AI-generated product listings before publishing
- **Multimodal AI Vision** โ€” Gemini 2.0 Flash analyzes uploaded product photos to generate Amazon listings

---

## ๐Ÿš€ Quickstart

### Option A โ€” Zero Dependency: Open in Browser Directly

No installation needed. Open the web simulator instantly:

```bash
# Windows
start index.html

# macOS / Linux
open index.html
```

### Option B โ€” Run MCP Node.js Server (for Judge MCP Inspector)

```bash
# 1. Clone repository
git clone https://github.com/karyalangitdigital/vault-alexa-mcp.git
cd vault-alexa-mcp

# 2. Install dependencies
npm install

# 3. Start MCP server
npm start
# Server is now running at http://localhost:3000

# 4. Open web simulator
#    Navigate browser to: http://localhost:3000
```

> **MCP Endpoints:**
> - JSON-RPC 2.0: `POST http://localhost:3000/mcp/v1/rpc`
> - Server-Sent Events: `GET http://localhost:3000/mcp/v1/sse`
> - Health Check: `GET http://localhost:3000/health`

### Option C โ€” Run Tests (for Judge Verification)

```bash
npm test           # MCP JSON-RPC 2.0 compliance test (9 methods)
npm run test:dom   # DOM sync & state consistency test
npm run test:all   # Full test suite
```

---

## ๐Ÿ› ๏ธ MCP Tools Reference (15 Tools)

All tools conform to **MCP Specification 2025-11-25** and are callable via `tools/call` JSON-RPC 2.0.

### ๐Ÿ›’ Buyer Tools

| # | Tool Name | Description | Key Args |
|---|---|---|---|
| 1 | `get_financial_summary` | Real-time budget status, account balances & category breakdown | `timeframe` |
| 2 | `search_amazon_deals` | Intelligent Amazon Prime deal discovery with sorting & filters | `category`, `keyword`, `maxPrice`, `sortBy` |
| 3 | `validate_purchase_safety` | Pre-purchase safety check against remaining category budget | `itemName`*, `itemPrice`*, `category`* |
| 4 | `track_price_drop_target` | Register deal sniper / price drop alert watchdog | `itemName`*, `targetPrice`* |
| 5 | `split_shared_expense` | Split household expenses via Alexa Contacts | `totalAmount`*, `title`*, `splitMembers` |
| 6 | `log_transaction` | Append a financial transaction to the personal vault ledger | `title`*, `amount`*, `category`* |
| 7 | `negotiate_dynamic_discount` | Bilateral buyer-seller real-time discount negotiation bridge | `itemName`*, `currentPrice`* |
| 8 | `calculate_opportunity_cost` | Anti-impulse guard: projects savings goal delay from purchase | `itemName`*, `itemPrice`* |
| 9 | `predict_monthly_runway` | Proactive deficit risk forecast using upcoming obligation radar | `projectedSpend` |
| 10 | `initiate_purchase_dispute` | Full-lifecycle RMA dispute, return label & instant escrow refund | `orderId`*, `reason`* |
| 11 | `trigger_peer_split_request` | Dispatch Alexa voice bill-split notifications to household contacts | `total`*, `contacts` |

### ๐Ÿช Seller Tools

| # | Tool Name | Description | Key Args |
|---|---|---|---|
| 12 | `generate_morning_briefing` | Proactive standup: cashflow / FBA stockout / orders (role-aware) | `includeWatchlistRadar` |
| 13 | `predict_inventory_stockout` | FBA burn velocity analysis, auto PO draft & dynamic repricing | `asin`*, `dailyVelocity` |
| 14 | `analyze_product_image_listing` | Gemini 2.0 Flash multimodal vision โ†’ Amazon-ready product listing | `imageDataUrl`*, `hintProductName` |
| 15 | `publish_seller_product` | Confirm & publish AI-generated listing to seller catalog | `listingData`* |

*\* = required argument*

### ๐Ÿ“ฆ MCP Resources (3)

| URI | Description |
|---|---|
| `vault://financial/overview` | Personal financial vault: balances, categories, transactions |
| `vault://household/summary` | Household shared pool, member limits, pending splits |
| `vault://diagnostics/health` | MCP server health, latency metrics, RPC audit trails |

### ๐Ÿ“ MCP Prompts (2)

| Name | Description |
|---|---|
| `financial_health_audit` | Deep financial audit prompt with savings goal integration |
| `amazon_deal_negotiator` | Bilateral negotiation prompt for Buyer-Seller discount bridge |

---

## ๐Ÿงช Testing Guide for Judges

### Quick JSON-RPC Test (curl)

```bash
# List all 15 tools
curl -X POST http://localhost:3000/mcp/v1/rpc \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

# Call validate_purchase_safety
curl -X POST http://localhost:3000/mcp/v1/rpc \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"validate_purchase_safety","arguments":{"itemName":"Bose Headphones 700","itemPrice":219.00,"category":"shopping"}}}'

# Read financial vault resource
curl -X POST http://localhost:3000/mcp/v1/rpc \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":3,"method":"resources/read","params":{"uri":"vault://financial/overview"}}'
```

### Web Simulator โ€” 7 Demo Scenarios

Launch `index.html` (or `http://localhost:3000`) and type these into the Alexa+ chat:

| # | Type This | Tool Invoked | What to Observe |
|---|---|---|---|
| 1 | `morning briefing` | `generate_morning_briefing` | **Buyer mode**: personal standup (cashflow/bills/sniper radar) ยท **Seller mode**: store ops briefing (revenue/stockout/orders) |
| 2 | `prediksi defisit tagihan rutin` | `predict_monthly_runway` | Multi-agent swarm warns of $450 upcoming obligations causing -$129 deficit |
| 3 | `Bose Headphones rusak di jalan` | `initiate_purchase_dispute` | RMA ticket issued, prepaid return label, +$219 instant escrow credit |
| 4 | `tawar harga echo show` | `negotiate_dynamic_discount` | Bilateral negotiation issues voucher `AMZ-MCP-SAVE15` ($99.99 โ†’ $84.99) |
| 5 | `bagi tagihan ke Michael` | `trigger_peer_split_request` | Voice bill-split dispatched to Echo Dot of household members |
| 6 | `cek kehabisan stok fba` | `predict_inventory_stockout` | FBA co-pilot flags 3.3-day stockout, drafts PO-SUPPLIER-77491 |
| 7 | Switch to **Seller Mode** โ†’ `morning briefing` | `generate_morning_briefing` | Role-aware: shows Apex Tech Store operations briefing, not Buyer data |

### MCP Inspector Tab (Built-in)

1. Click **"MCP Inspector"** in the left sidebar
2. Select any of the **15 registered tools** from the dropdown
3. Click **"Execute JSON-RPC Tool"**
4. Observe structured JSON response with sub-15ms latency indicator

### Bilingual Test

Click the **`ID` / `US`** toggle in the top-right header to instantly switch all UI labels, voice synthesis accent, and agent reasoning trace language.

---

## ๐Ÿ—๏ธ Architecture

![VaultAlexa+ Architecture](docs/screenshots/architecture.jpg)

```mermaid
flowchart TD
    A["๐Ÿ‘ค Buyer / Seller"] -->|Voice + Touch| B["๐Ÿ”Š Alexa+ Echo Show / Fire TV / Web Simulator"]
    B -->|"Streamable HTTP / SSE"| C["๐Ÿ”Œ JSON-RPC 2.0\n/mcp/v1/rpc + /mcp/v1/sse"]

    subgraph MCP ["โšก VaultAlexa+ MCP Server โ€” Node.js / Express"]
        C --> D["๐Ÿง  Role-Aware Intent Router\nprocessUserQuery()"]
        D --> E["๐Ÿ›’ Buyer Branch\n11 Tools"]
        D --> F["๐Ÿช Seller Branch\n4 Tools"]
        E & F --> G["๐Ÿ› ๏ธ 15 MCP Tools"]
        E & F --> H["๐Ÿ“ฆ 3 Resources"]
        E & F --> I["๐Ÿ“ 2 Prompts"]
    end

    G -->|"Agent Orchestration"| J["โ˜๏ธ AWS Bedrock AgentCore\nClaude 3.5 / Nova Pro"]
    G -->|"Vision Analysis"| K["๐Ÿ‘๏ธ Google Gemini 2.0 Flash\nMultimodal Product Vision"]
    G -->|"Encrypted IAM"| L[("๐Ÿ—„๏ธ DynamoDB\nPrimeVaultLedger")]
    G -->|"SigV4 Auth"| M[("๐Ÿ›๏ธ Amazon SP API")]
    G -.->|"Telemetry"| N["๐Ÿ“Š CloudWatch"]
```


### Role-Aware Dual-Agent Flow

```
User Query
    โ”‚
    โ–ผ
processUserQuery()
    โ”‚
    โ”œโ”€[window.currentUserRole === 'seller']โ”€โ”€โ–บ Seller Intent Chain
    โ”‚   โ”œโ”€โ”€ generate_morning_briefing (Store Ops Briefing)
    โ”‚   โ”œโ”€โ”€ predict_inventory_stockout (FBA Co-Pilot)
    โ”‚   โ”œโ”€โ”€ analyze_product_image_listing (Multimodal Vision)
    โ”‚   โ””โ”€โ”€ publish_seller_product (Human-in-the-Loop Confirm)
    โ”‚
    โ””โ”€[window.currentUserRole === 'buyer']โ”€โ”€โ”€โ–บ Buyer Intent Chain
        โ”œโ”€โ”€ validate_purchase_safety (Budget Guard)
        โ”œโ”€โ”€ predict_monthly_runway (Deficit Forecast)
        โ”œโ”€โ”€ negotiate_dynamic_discount (Bilateral Negotiation)
        โ”œโ”€โ”€ initiate_purchase_dispute (RMA & Refund)
        โ””โ”€โ”€ generate_morning_briefing (Personal Finance Standup)
```

---

## ๐Ÿ“ Project Structure

```
vault-alexa-mcp/
โ”œโ”€โ”€ index.html              # Web simulator UI (Single-Page App)
โ”œโ”€โ”€ app.js                  # Frontend controller & agent intent router
โ”œโ”€โ”€ styles.css              # Premium glassmorphism UI design system
โ”œโ”€โ”€ mcp-server.js           # MCP Server (Express / JSON-RPC 2.0 / SSE)
โ”œโ”€โ”€ mcp-config.json         # MCP manifest (Spec 2025-11-25, Streamable HTTP)
โ”œโ”€โ”€ package.json            # npm config โ€” version 2.5.0
โ”œโ”€โ”€ test-mcp.js             # MCP JSON-RPC compliance test (9 methods)
โ”œโ”€โ”€ test-dom-and-sync.js    # DOM state sync test
โ”œโ”€โ”€ test-e2e-dom.js         # End-to-end role-switching E2E test
โ”œโ”€โ”€ FRICTION_LOG.md         # Hackathon bonus: developer friction feedback
โ”œโ”€โ”€ LICENSE                 # MIT License
โ””โ”€โ”€ docs/
    โ”œโ”€โ”€ Naskah_Video_Demo_VaultAlexa.html
    โ””โ”€โ”€ Panduan_Submisi_Hackathon_VaultAlexa.html
```

---

## ๐Ÿงช Running the Full Test Suite

```bash
# MCP Protocol Compliance (9 JSON-RPC methods verified)
npm test

# DOM Sync & State Consistency
npm run test:dom

# Full Suite
npm run test:all
```

Expected output: `โœ… All 9 MCP JSON-RPC 2.0 Method Calls Verified Successfully! (15 Tools + 3 Resources + 2 Prompts registered on server)`

---

## โ˜๏ธ AWS Services

| Service | Role in VaultAlexa+ |
|---|---|
| **Amazon API Gateway** | TLS 1.3 ingress for Streamable HTTP / SSE |
| **AWS Lambda / ECS Fargate** | Hosts stateless MCP server (sub-15ms) |
| **AWS Bedrock AgentCore** | Multi-agent orchestration (Claude 3.5 / Nova Pro) |
| **Amazon DynamoDB** | Encrypted personal financial vault ledger |
| **Amazon Selling Partner API** | Live Prime catalog & seller fulfillment |
| **Amazon CloudWatch** | RPC latency telemetry & audit trails |

---

## ๐Ÿ† Hackathon Compliance Summary

| Requirement | Status |
|---|---|
| MCP Spec `2025-11-25` | โœ… |
| Transport: Streamable HTTP + SSE | โœ… |
| JSON-RPC 2.0 (`tools/list`, `tools/call`, `resources/read`, `prompts/list`) | โœ… |
| Minimum 5 agentic tools | โœ… **15 tools** |
| Human-in-the-Loop safety guardrails | โœ… `validate_purchase_safety` + Anti-Impulse Lock + Listing Review |
| Proactive agent (not just reactive) | โœ… `generate_morning_briefing` |
| Developer Friction Log (Bonus 10%) | โœ… [FRICTION_LOG.md](FRICTION_LOG.md) |
| Open Source MIT License | โœ… |
| Working demo / test scripts | โœ… `npm test` |

---

## ๐Ÿ‘ค Author

**KARYA LANGIT Digital โ€” Supriadi**  
Amazon Developer Hackathon 2026 ยท Alexa+ MCP Server Track  
๐Ÿ“ง [karyalangitdigital](https://github.com/karyalangitdigital)

---

## ๐Ÿ“œ License

Distributed under the **MIT License**. See [LICENSE](LICENSE) for details.