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
| Component | Technology |
|---|---|
| LLM | Anthropic Claude 3 Haiku (claude-3-haiku-20240307) |
| Framework | LangChain.js |
| Database | PostgreSQL with pgvector extension |
| Queue | BullMQ + Redis |
| Messaging | Meta WhatsApp Business API |
| Real-time | Socket.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
- Configure environment variables (see Setup)
- Enable pgvector extension in PostgreSQL
- Populate knowledge base (see Knowledge Base Management)
- 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