Skip to content

teguh407/warungbrain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿช WarungBrain

Multi-agent AI assistant untuk UMKM yang jualan online di Tokopedia, Shopee, & WhatsApp.

Powered by Xiaomi MiMo ยท Built with Hermes Agent patterns

Python 3.11+ License: MIT MiMo Multi-Agent UMKM

๐ŸŒ Live demo: teguh407.github.io/warungbrain


Kenapa WarungBrain?

UMKM Indonesia jualan online sambil ngerangkap 5 peran sekaligus: cek harga kompetitor, hitung margin, bikin caption, balesin WA customer, sampai lembur tutup buku. Hasilnya: harga ketinggalan pasar, caption seadanya, customer kabur karena slow response.

WarungBrain ngambil 4 peran itu jadi 4 AI agent yang saling ngomong. Lo input nama produk, dia kasih:

Riset kompetitor โ†’ strategi harga โ†’ konten siap-post โ†’ balesan WA siap-kirim

Satu pipeline. Dari nol jadi siap jualan dalam 30 detik.


โœจ Fitur

  • ๐Ÿ•ต๏ธ CompetitorScout โ€” pull harga & rating dari Tokopedia + Shopee per produk
  • ๐Ÿ’ฐ PricingStrategist โ€” kasih rekomendasi harga (3 tier: agresif / balance / premium) + margin calc
  • โœ๏ธ ContentCreator โ€” generate caption Instagram/TikTok + deskripsi produk yang SEO-friendly
  • ๐Ÿ’ฌ CSAutoReply โ€” balesan WA template untuk pertanyaan harga, stok, ongkir, refund
  • ๐Ÿ”Œ MiMo-native โ€” pakai Xiaomi MiMo sebagai reasoning engine (drop-in OpenAI-compatible)
  • ๐Ÿ“Š Audit trace โ€” tiap agent simpan input/output JSON, gampang debug
  • ๐ŸŒ CLI + FastAPI โ€” pake terminal atau pasang sebagai service

๐Ÿ—๏ธ Arsitektur

                     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                     โ”‚   PRODUK INPUT      โ”‚
                     โ”‚ "kaos polos cotton" โ”‚
                     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ”‚
                                โ–ผ
                     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                     โ”‚ ๐Ÿ•ต๏ธ  CompetitorScout โ”‚  scrape Tokopedia
                     โ”‚   (web tools)       โ”‚  + Shopee
                     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ”‚
                โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                โ–ผ               โ–ผ               โ–ผ
      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
      โ”‚ ๐Ÿ’ฐ Pricing   โ”‚ โ”‚ โœ๏ธ  Content  โ”‚ โ”‚ ๐Ÿ’ฌ CSAutoReplyโ”‚
      โ”‚ (MiMo logic) โ”‚ โ”‚ (MiMo write) โ”‚ โ”‚ (MiMo persona)โ”‚
      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ–ผ
                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                   โ”‚  ๐Ÿ“ฆ BUNDLE READY    โ”‚
                   โ”‚  โ€ข 3 tier harga     โ”‚
                   โ”‚  โ€ข 5 caption variantโ”‚
                   โ”‚  โ€ข 8 reply template โ”‚
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Tiap agent stateless, ngomong via Pydantic message. CompetitorScout fan-out hasil ke 3 agent lain in parallel, output di-merge jadi satu bundle siap pakai.


๐Ÿš€ Quickstart

1. Clone & install

git clone https://github.com/teguh407/warungbrain.git
cd warungbrain
python3.11 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

2. Set MiMo API key

Daftar di platform.xiaomimimo.com โ†’ ambil API key.

cp .env.example .env
# Edit .env, paste:
# MIMO_API_KEY=sk-...

3. Jalanin

CLI mode:

python -m src.main "kaos polos cotton combed 30s"

Output:

๐Ÿช WarungBrain v0.1.0  ยท  kaos polos cotton combed 30s

[1/4] ๐Ÿ•ต๏ธ  Riset kompetitor ............ โœ“ 18 listing terkumpul
[2/4] ๐Ÿ’ฐ Hitung strategi harga ......... โœ“ 3 tier
[3/4] โœ๏ธ  Bikin konten ................. โœ“ 5 caption + 1 deskripsi
[4/4] ๐Ÿ’ฌ Generate balasan CS ........... โœ“ 8 reply template

๐Ÿ“ฆ Bundle siap โ†’ out/bundle-20260518-1432.json

API mode (FastAPI):

uvicorn src.api:app --reload
# Buka http://localhost:8000/docs

๐Ÿ“ฆ Output Sample

{
  "product": "kaos polos cotton combed 30s",
  "market_summary": {
    "competitor_count": 18,
    "median_price": 45000,
    "min_price": 28000,
    "max_price": 89000,
    "avg_rating": 4.7
  },
  "pricing": {
    "agresif":  { "harga": 39000, "margin_pct": 18, "rationale": "..." },
    "balance":  { "harga": 49000, "margin_pct": 35, "rationale": "..." },
    "premium":  { "harga": 69000, "margin_pct": 55, "rationale": "..." }
  },
  "content": {
    "captions_ig": ["caption 1", "caption 2", "..."],
    "captions_tiktok": ["...", "..."],
    "deskripsi_produk": "..."
  },
  "cs_replies": {
    "tanya_harga":  "Halo Kak! Untuk kaos polos cotton combed 30s...",
    "tanya_stok":   "...",
    "tanya_ongkir": "...",
    "complain_size":"...",
    "refund":       "..."
  }
}

๐Ÿง  Stack

Python 3.11 + Pydantic     โ†’ schemas + validation
Xiaomi MiMo (mimo-pro)     โ†’ reasoning (pricing, content, CS)
httpx + BeautifulSoup      โ†’ competitor scraping
DuckDuckGo Search          โ†’ fallback site: search untuk Tokped/Shopee
FastAPI                    โ†’ REST API
Rich CLI                   โ†’ progress + output

๐Ÿ› ๏ธ Konfigurasi

Semua knob ada di .env:

MIMO_API_KEY=sk-...
MIMO_MODEL=mimo-pro
MIMO_BASE_URL=https://platform.xiaomimimo.com/v1

ENABLE_TOKOPEDIA=true
ENABLE_SHOPEE=true
MAX_LISTINGS_PER_SOURCE=10

DEFAULT_HPP_RATIO=0.4    # asumsi default cost = 40% dari median market
OUTPUT_DIR=./out

Lo bisa override DEFAULT_HPP_RATIO per-product kalau punya data HPP real.


๐Ÿ—บ๏ธ Roadmap

  • 4-agent pipeline
  • Tokopedia + Shopee scout (graceful degradation kalau anti-bot)
  • 3-tier pricing strategy
  • Caption IG + TikTok + deskripsi produk
  • CS auto-reply 8 template
  • FastAPI server
  • WhatsApp bot integration (Whapi / Baileys)
  • Ongkir kalkulator (RajaOngkir API)
  • Auto-post scheduler (Instagram Graph API)
  • Dashboard React untuk multi-produk
  • Marketplace listing auto-publish

โš ๏ธ Catatan Scraping

Tokopedia & Shopee aktif anti-bot. Default scout pakai dua jalur:

  1. DuckDuckGo site:tokopedia.com search โ€” handal headless, no proxy needed
  2. Direct fetch โ€” fallback ke API publik mereka, bisa rate-limited

Buat production scale, tambahin Playwright + residential proxy. Lihat src/tools/scout_backends.py buat extension point.


๐Ÿค Contributing

PR welcome. Run pytest sebelum buka PR. Style: ruff format.


๐Ÿ“œ License

MIT โ€” see LICENSE.


๐Ÿ™ Acknowledgements

  • Xiaomi MiMo โ€” reasoning engine yang nyalain semua agent
  • Hermes Agent โ€” multi-agent pattern + skill system
  • UMKM Indonesia โ€” yang udah jadi backbone ekonomi & inspirasi project ini ๐Ÿ‡ฎ๐Ÿ‡ฉ

About

๐Ÿช Multi-agent AI assistant for Indonesian UMKM. Riset kompetitor โ†’ strategi harga โ†’ konten โ†’ CS auto-reply. Powered by Xiaomi MiMo.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages