About the AI Store Agent

A specialized conversational AI agent that combines advanced natural language processing and AI capabilities to help users find the best suitable products that match their requirements and budget.

Overview & Business Goals

  • Business Goal: Help users find the most suitable products based on their requirements and budget—even when their criteria only partially match available options.
  • Supports both English and Arabic, including everyday street language.
  • Recognizes 9 key features from user queries: Product Type (Mobile, Laptop, Tablet), Brand, CPU, GPU, RAM, Storage, Battery, Camera, and Price.
  • Focuses on delivering the closest match when exact criteria are not available.

Overall Architecture

  • Microservices-based design for scalability and maintainability.
  • Uses fine-tuning on two base pre-trained AI models:
    • facebookAI/xlm-roberta-large for NER
    • sentence-transformers/paraphrase-multilingual-mpnet-base-v2 for Entity Mapping
  • Advanced NLP techniques handle text cleaning, normalization, and bilingual (and slang) inputs.
  • Designed to allow future AI pipelines to be added as business needs evolve.
System Architecture

1. Interface

  • Pages: Chatbot, Products List, Logs
  • Features:
    • Real-time conversation using JavaScript (Fetch API and dynamic DOM updates).
    • Extensive logging for auditing and re-training.
    • Clean and modular design that supports additional microservices.
Interface

2. Named-Entity Recognition (NER)

  • Base Pre Trained Model: facebookAI/xlm-roberta-large
  • Pre-trained on: ~2.5TB of multilingual text
  • Fine-tuned F1 Score: ~97%
  • Recognized Features:
    • Brand
    • ProductType
    • GPU
    • Processor
    • Price
    • RAM
    • Storage
    • Battery
    • Camera
  • Utilizes advanced text cleaning and normalization to handle diacritics, emojis, and bilingual input.
NER Output

3. Entity Mapping

  • Base Pre Trained Model: sentence-transformers/paraphrase-multilingual-mpnet-base-v2
  • Pre-trained on: ~1B sentence pairs
  • Fine-tuned F1 Score: ~98%
  • Categories Recognized:
    • Brand
    • ProductType
    • GPU
    • Processor
Entity Mapping Output

4. Numerical Processing

  • Standardizes numeric expressions (e.g., “25k”, “2 مليون”) into uniform values.
  • Features Processed:
    • Price
    • RAM
    • Storage
    • Battery
    • Camera
  • Handles both English and Arabic digits and numeric words (e.g., “twenty-five”, “خمسة عشر”).
  • Ensures consistent numeric data before applying product filters.
Numeric Processing Output

5. Product Filtering

  • Loads product data from PostgreSQL and caches it for efficiency.
  • Merges multiple filter criteria into a single organized set.
  • Categorical filters (Brand, GPU, Processor, ProductType) are applied first via case-insensitive matching.
  • If a categorical filter excludes all products, it is skipped.
  • Numeric filters are applied directly; if no products match, thresholds are iteratively adjusted (e.g., price increased by 1.25× or specs decreased by 0.8×) until viable matches appear.
  • Tracks which filters were directly applied and which were adjusted for transparency.
  • Final results are trimmed to a preset maximum number of products, sorted by price.
Product Filtering Output

6. Answer Generation

  • Generates a user-friendly response in English or Arabic.
  • Clearly indicates which filters were applied, adjusted, or skipped.
  • Delivers the final product recommendations to the chatbot interface in real time.
AI Response Example

Human Audits & Retraining

  • All interactions are logged for post-analysis.
  • Administrators mark outputs as correct or incorrect.
  • Annotated logs continuously feed back into the training pipeline to improve all modules.
Human Audit

Future Plans

  • Automatically classify user intents (e.g., product search vs. general conversation).

  • Handle both task-oriented product queries and open-domain chit-chat seamlessly.
  • Adapt responses based on conversational context.

  • Support follow-up questions and retain conversation context.
  • Handle iterative queries and clarify ambiguous references.

Thank you for exploring the technical overview of the AI Store Agent.