İçeriğe geç

Türkçe Vaka: Trendyol Tarzı E-Ticaret Asistanı

Bir Türk e-ticaret platformuna LLM asistan tasarımı. Trendyol, Hepsiburada, Çiçeksepeti gibi 10M+ kullanıcı için scale, caching, KVKK uyumu.

Şükrü Yusuf KAYA
14 dakikalık okuma
Orta

Türkçe Vaka: E-Ticaret Asistanı

Senaryo: Türk bir e-ticaret platformu (Trendyol/Hepsiburada/Çiçeksepeti benzeri). 10M+ user, 100K SKU, günde 100K+ destek sorgusu.
Hedef: LLM tabanlı destek asistanı kur, KVKK uyumlu, cost-effective, scale'lensin.

Mimari Tasarım#

Context Layers#

KatmanBoyutCache TTLNiçin?
System prompt1K1hTone of voice, görev tanımı
Şirket KB25K1hİade politikası, kargo, ödeme
Tool defs5K1h8 tool (sipariş, kargo, iade, vb.)
Conversation history5-20K5mMulti-turn destek
RAG: relevant products5KSorguya göre değişir
User query0.1KDinamik

Cost Modeli#

python
# Aylık 3M sorgu varsayımı
QUERIES_MONTH = 3_000_000
PRICE_INPUT = 3.0 # Claude Sonnet 4.6
PRICE_OUTPUT = 15.0
PRICE_CACHE_WRITE = 3.75
PRICE_CACHE_READ = 0.30
 
# Static (cache'lenebilir)
static_tokens = 30_000 # KB + tools + system
dynamic_tokens = 5_000 # RAG + query
output_tokens = 400
 
cache_hit_rate = 0.93 # %93 expected
 
misses = QUERIES_MONTH * (1 - cache_hit_rate)
hits = QUERIES_MONTH * cache_hit_rate
 
cost_with_cache = (
misses * static_tokens / 1e6 * PRICE_CACHE_WRITE
+ hits * static_tokens / 1e6 * PRICE_CACHE_READ
+ QUERIES_MONTH * dynamic_tokens / 1e6 * PRICE_INPUT
+ QUERIES_MONTH * output_tokens / 1e6 * PRICE_OUTPUT
)
cost_no_cache = (
QUERIES_MONTH * (static_tokens + dynamic_tokens) / 1e6 * PRICE_INPUT
+ QUERIES_MONTH * output_tokens / 1e6 * PRICE_OUTPUT
)
 
print(f"Cache açık: ${cost_with_cache:,.2f}/ay → {cost_with_cache*33.5:,.2f} TL")
print(f"Cache kapalı: ${cost_no_cache:,.2f}/ay → {cost_no_cache*33.5:,.2f} TL")
print(f"Tasarruf: %{(cost_no_cache-cost_with_cache)/cost_no_cache*100:.1f}")
3M sorgu/ay senaryo
Beklenen sonuç:
Cache açık: $48,800/ay → 1,635,000 TL Cache kapalı: $333,000/ay → 11,153,000 TL Tasarruf: %85.4
Ayda ~9.5M TL tasarruf, yıllık ~114M TL. Bu rakamlar Trendyol scale'inde başlı başına bir CTO bütçesini karşılar.

KVKK Uyumu#

User chat'inde TCKN, telefon, kart no gelirse:
  • Pre-LLM redaction (Modül 12 Ders 78)
  • Cache'te PII yok, placeholder'lar var
clean_query = redact_pii(user_query) # "Telefon 0532 234 5678 lütfen" → "Telefon [PHONE] lütfen"

Production Lessons#

Türk e-ticaret platformlarından gözlemlerim:
  1. Türkçe optimizasyonu — Türkçe tokenizer ekstra cost; cache bu yüzden iki kat değerli
  2. Sezon trafik — Black Friday'de trafik 5×; cache stampede önleme şart
  3. Çok satıcılı (marketplace) modeller — her satıcının KB'si ayrı, multi-tenant pattern
  4. Mobile-first — latency çok önemli; cache hit ile p95 < 1s kritik

✓ Pekiştir#

Bir Sonraki Derste#

Bankacılık vakası — daha sıkı KVKK + compliance.

Yorumlar & Soru-Cevap

(0)
Yorum yazmak için giriş yap.
Yorumlar yükleniyor...

İlgili İçerikler