Inspiration

In Singapore, small businesses are the backbone of the economy, but they face a common challenge: managing WhatsApp orders manually. Every day, millions of messages are exchanged, each representing a business investing precious hours into a task that could be automated.

This issue is not just about efficiency; it's about the opportunity cost – time that could be spent connecting with customers or growing the business is lost in processing digital information by hand.

What it does

Our project— OFFDAY brings a revolutionary change to order processing for small businesses, leveraging AI to automate interactions on WhatsApp. Capable of processing transactions in under 10 seconds — a task that manually takes minutes — OFFDAY enhances efficiency by an impressive 71%.

This automation is powered by advanced Large Language Models (LLMs). Previously, the complexity of messages posed a significant barrier to automation. However, with advance LLM, OFFDAY transforms this challenge into an opportunity, making efficient and intelligent order processing a reality for small businesses.

How we built it / Built with

Inference Server Structure for OFFDAY

  1. LLM Integration
    • OFFDAY leverages a Large Language Model (LLM) for core functions:
      • Intent Classification: Identifying the purpose behind each message.
      • Entity Extraction: Extracting key details from conversations.
      • Reasoning: Interpreting message context.
      • Data Conversion: Transforming casual chats into structured data.
  2. Text Generation Interface
    • The LLM is served through Huggingface's Text Generation Interface, enabling efficient model interaction.
  3. Langchain Utilization
    • LangChain, a framework for language model-powered applications, is used for its composability. It allows for chaining LLM calls, enhancing the functionality and flexibility of OFFDAY.
  4. Flask Server for Inference
    • The Inference Server is built using a Flask server framework. The inference logic, written in Python, is served as a REST API, facilitating seamless integration and communication with other system components.

Whatsapp Bot

  • We have set up a WhatsApp bot that currently uses a Matrix server to handle WhatsApp messages. However, this setup is temporary, and we plan to switch to the official WhatsApp API in the future.
  • When messages are received through WhatsApp, they are then forwarded to an AWS Step Function. Within this function, we perform several important tasks, including:
    • Throttling: Ensuring that we don't process messages too quickly to avoid overwhelming the system.
    • Thread management: Keeping a record of all incoming and outgoing messages, group into message threads.
    • Order management: Managing and processing any orders or requests received through WhatsApp.
    • Order validation: Checking the validity of orders to prevent errors.
    • Linking to an LLM Model: Connecting to a Language Model (LLM) to process and understand the message content.
    • Finally, we generate a response and send it back to the user on WhatsApp.

Challenges we ran into

We faced significant challenges in accurately interpreting casual language commonly found in WhatsApp chats. To address this:

  1. Prompt Engineering Techniques:
    • We employed sophisticated prompt engineering to refine the AI's understanding of informal chat nuances.
  2. Entity Extraction with Retrieval Augmented Generation:
    • This approach helped us more effectively identify specific items or customer names mentioned in conversations.
  3. Intent Classification:
    • Initially challenging, we utilized few-shot learning techniques. By providing the AI with a small number of examples, we significantly improved its ability to discern the intent behind messages, leading to more satisfactory results.

These strategies were pivotal in fine-tuning OFFDAY to meet the unique demands of WhatsApp-based order processing.

Besides that,

  1. Throttle:
    • Traditional chatbots typically handle one message at a time. However, users often send or reply with multiple messages to convey their intent. To extract the intended meaning, we implement throttling, which involves merging multiple related messages together for better comprehension.
  2. Group Notifications:
    • We need group chat capabilities to meet our business requirements. Currently, the official API only supports private chat webhooks, leaving us without the ability to handle group notifications.
  3. Thread:
    • Threads are essential for our Language Learning Model (LLM) to understand the context of a chat. WhatsApp doesn't have an explicit thread concept; instead, all the messages are in a single chat room. To address this, we have to create a system that records thread-related messages.

Conclusion

OFFDAY innovatively automates the manual process of managing WhatsApp orders for small businesses in Singapore. By harnessing advanced AI, it significantly enhances efficiency and transforms customer interaction, marking a new era in digital business operations.

Built With

Share this project:

Updates