Skip to main content

About the project

EsnafDoktor (MerchantDoctor) is an offline, privacy-first AI assistant built specifically for small e-commerce sellers on marketplaces like Trendyol and Hepsiburada. In small shops, a single owner frequently handles packaging, shipping, and answering 100+ daily customer inquiries across multiple platforms. Delayed replies hurt store performance ratings, while hasty decisions lead to illegitimate refunds and direct financial loss. Meanwhile, closed cloud LLMs charge prohibitive per-token fees and expose sensitive customer data across borders.

EsnafDoktor bridges this gap by running 100% locally on standard laptop hardware with zero API costs, zero data leakage (KVKK compliant), and full offline capability.

How It Works (4-Stage Pipeline):

  1. NLU Classification: Analyzes customer queries to identify intent, sentiment, and category.
  2. 2026 Advanced Hybrid RAG: Combines Turkish-normalized Okapi BM25 and multilingual-e5-small dense embeddings using Reciprocal Rank Fusion (RRF
    k=60), re-ranked with a Cross-Encoder to retrieve the exact matching store policy from 16 verified e-commerce rules.
  3. TabPFN Dispute Risk Engine: Evaluates 7 tabular order signals (order value, delivery duration, return history, unboxing video availability, damage report) to compute calibrated return abuse risk.
  4. Gemma 3 4B & Grounding Guard: Generates policy-grounded replies via local Ollama. Crucially, the model never decides a refund or rejection autonomously. Routine questions are answered immediately, while disputes and high-risk cases are escalated to the merchant desk with a structured action checklist and an editable draft reply. The built-in Grounding Guard scans replies to prevent hallucinated numbers, dates, or terms.

Verified Benchmark Results:
Category Accuracy: 95.0% (Macro F1: 93.8%) on an isolated 20-case held-out benchmark.
Exact Policy Hit@1 (RAG): 95.2% (20/21) on colloquial, unstructured customer queries (100% category Hit@1).
End-to-End Latency: ~2 seconds total (~1.5s CPU analysis + ~1.4s GPU/CPU warm reply generation).
Quality Assurance: 7/7 deterministic offline unit tests passing with 0 network calls.
Architecture: Fast, framework-free dual interface (Customer Storefront + Merchant Desk) served via local FastAPI.

Built with

pythonhtmlcssgithubvscodefastapigemmaclaudeollama

AI tools

Coded withClaude CodeAntigravityGemini 4 ArgonGemini 3.8 FlashGPT-5.5Qwen3.8 27B

Prize Categories Entered

  • DigitalOcean

    Best Open-Source AI Project

    Submitted