Skip to main content

AI System Overview

KAIU Natural Living uses an AI-powered WhatsApp assistant to provide 24/7 customer support in Spanish. The system handles product inquiries, inventory searches, and knowledge base queries with automatic handover to human agents when needed.

Key Features

  • Claude 3 Haiku Integration: Fast and cost-effective conversational AI
  • RAG System: Retrieval Augmented Generation with pgvector for accurate product and policy information
  • Function Calling: Native Anthropic tool use for inventory and knowledge base searches
  • PII Protection: Automatic redaction of emails and phone numbers from conversation history
  • Smart Handover: Keyword-based escalation to human agents
  • Image Support: Automatic product image sending with [SEND_IMAGE] tags
  • Real-time Dashboard: Socket.IO integration for live chat monitoring

System Architecture

Technology Stack

ComponentTechnology
LLMAnthropic Claude 3 Haiku (claude-3-haiku-20240307)
FrameworkLangChain.js
DatabasePostgreSQL with pgvector extension
QueueBullMQ + Redis
MessagingMeta WhatsApp Business API
Real-timeSocket.IO

Core Components

RAG System

Vector search with pgvector for knowledge retrieval

Function Tools

searchInventory and searchKnowledgeBase implementations

Handover Protocol

Automatic escalation to human agents

PII Privacy

Privacy protection and data redaction

Quick Start

  1. Configure environment variables (see Setup)
  2. Enable pgvector extension in PostgreSQL
  3. Populate knowledge base (see Knowledge Base Management)
  4. Deploy worker process with BullMQ
The AI system is currently configured for memory optimization on free-tier cloud hosting. Vector embeddings are bypassed with zeros to prevent OOM errors.

Next Steps

Architecture Deep Dive

Explore the complete system architecture and data flow

Build docs developers (and LLMs) love