Type something to search...

Warung Assistant

Summary

A warung owner answers the same five questions all day while the queue waits: prices, stock, shelf locations, estimated totals. Warung Assistant is a chat front desk that takes those questions instead, so the queue keeps moving while the owner handles cash.


A small shop hears the same things every day

  1. Repeated customer questions For example:

    • “How much is Indomie Ayam Bawang?”
    • “Is there any egg left?”
    • “Which shelf is the soy sauce on?”
  2. Distractions during checkout

    • Owners get interrupted while adding up a purchase
    • Every interruption is another chance to miscount
  3. Unstructured customer input Customers speak naturally, like:

    • “Half a kilo of eggs, 3 Indomie, and 2 bundles of spinach”

    One customer says ‘half a kilo’, another says ‘500 grams’, and both mean eggs.

  4. Rigid POS systems

    • They cannot read natural language
    • They cannot help a customer before the order is finalized

A front desk that reads slang

How an order flows

  1. The customer chats: prices, stock, shelf, estimated total.

  2. Turning “half a kilo of eggs” into numbers

    • It pulls out the product names, quantities, and units
    • Supports:
      • Kilograms, halves, quarters
      • Grams / ounces
      • Unit-based quantities
      • Budget-based requests (e.g., “10,000 IDR worth of sugar”)
      • Product name synonyms
  3. Checking before answering

    • Fuzzy product matching using RapidFuzz
    • Stock validation (requested quantity ≤ available stock)
    • Subtotal and grand total calculation
  4. The answer the owner sees

    • Product list
    • Unit price
    • Quantity
    • Subtotal per item
    • Grand total
    • Shelf location (if requested)
  5. Checkout for the owner

    • Fewer things to hold in your head
    • Faster checkout
    • Fewer counting mistakes

Architecture

graph TB
    User[Customer chat] --> UI[Gradio ChatInterface]
    UI --> EX[LangChain AgentExecutor]
    EX --> ZS[ZeroShotAgent on Ollama gemma3 12b]
    ZS --> T1[check stock]
    ZS --> T2[get price from csv]
    ZS --> T3[calculate total price]
    ZS --> T4[find product location]
    T1 & T2 & T4 -. lookup .-> CSV[(CSV inventory)]
    T1 & T2 & T4 -. fuzzy match .-> RF[RapidFuzz + unit parser]
    T1 & T2 & T3 & T4 --> ANS[answer with totals + shelf]
    ANS --> User

What it should change

I never measured this in a real shop, so read the list below as the target, not the result:

  • Faster customer service
  • Fewer calculation errors
  • Less to keep in your head at the counter
  • Better customer experience
  • A foundation for POS and inventory systems

What I took from this one:

  • Designing practical LLM systems
  • Tool-based reasoning
  • Handling real-world constraints
  • Building end-to-end AI applications

Why these tools

LLM & AI

  • Ollama (Local LLM: Gemma / LLaMA / Mistral)
  • LangChain (Agents, Tools, Memory)
  • Prompt Engineering (ReAct, Few-shot prompting)

The model runs locally because a warung has no GPU budget and often no reliable internet. LangChain was the fastest way to wire tools to the model at the time I built this.

Retrieval & Data

  • CSV-based Inventory (RAG-style retrieval)
  • RapidFuzz for fuzzy product matching
  • Custom quantity and unit parsing logic

No vector database on purpose. A shop inventory is a few hundred rows with exact prices, and a CSV lookup returns the exact number every time. Embeddings would only add creative ways to be wrong about prices.

Backend

  • Python
  • Pandas
  • Modular tool-based architecture:
    • check_stock
    • get_price_from_csv
    • calculate_total_price
    • find_product_location

Interface

  • Gradio ChatInterface
  • A chat box that updates as you type.

Gradio because the whole interface is a chat box, and that is a dozen lines of code instead of a frontend project.


Not yet built

Things I’d like to build on top of it:

  • Role-based access (Customer mode / Owner mode)
  • Transaction export (receipt, CSV, PDF)
  • Automatic stock updates after payment
  • Vector database integration (FAISS / Chroma)
  • Voice input (Speech-to-Text)
  • Multi-turn memory (e.g., “What did I buy earlier?”)

What made this one fun was the unglamorous part

On the surface it is a chat box. Underneath it is parsing slang, fuzzy-matching names, and checking stock. That plumbing took most of the work.

The piece I still do not have a good answer for is a customer who changes their mind halfway through an order. Right now the safest move is to hand that back to the owner.

Warung Assistant turning a colloquial order into an itemized total

Demo asking price, checking stock, requesting the total


Source

The full code is on GitHub: https://github.com/rasyidev/warung_assistant