SMS SkillUp¶
An AI-powered business mentorship system that provides entrepreneurship guidance to Kenyan youth (18-35) through SMS and WhatsApp, supporting both English and Kiswahili languages with context-aware responses.
Purpose¶
No business context provided yet — add a context.md to enrich this documentation.
Based on the workflow implementation, this system appears to serve as a "Biashara Mentor" (Business Mentor) that helps young Kenyan entrepreneurs access business coaching through feature phones via SMS and smartphones via WhatsApp. The system provides guidance on 13 core business topics including entrepreneurship fundamentals, market research, customer acquisition, and business funding.
How It Works¶
- Message Reception: Users send messages via WhatsApp or SMS to initiate conversations
- Language Detection: The AI agent automatically detects whether the user is communicating in English or Kiswahili
- Topic Selection: For new conversations, the system presents a menu of 13 business topics in the user's preferred language
- Knowledge Retrieval: When users ask questions, the system queries a vectorized knowledge base of business resources
- Response Generation: The AI generates contextual responses under 160 characters (SMS limit) with follow-up questions
- Response Classification: The system determines if responses are normal messages or topic selection menus
- Message Delivery:
- Normal responses are sent as single messages
- Topic selection menus are split into 3 parts to fit SMS constraints
- Session Management: The system maintains conversation context using session memory
Mermaid Diagram¶
graph TD
A[WhatsApp Webhook] --> B[SkillUp SMS Support Agent]
C[SMS Webhook] --> D[SkillUp SMS Support Agent1]
B --> E[Text Clean up1]
D --> F[Text Clean up]
E --> G[Classify Response Type]
F --> H[Classify Response Type1]
G --> I{If Normal Response?}
H --> J{If1 Normal Response?}
I -->|Yes| K[Send WhatsApp response SkillUp SMS]
I -->|No| L[Code in JavaScript2]
J -->|Yes| M[Send SMS]
J -->|No| N[Code in JavaScript]
L --> O[Send WhatsApp response SkillUp SMS 2]
O --> P[Send WhatsApp response SkillUp SMS 3]
P --> Q[Send WhatsApp response SkillUp SMS 4]
N --> R[Send SMS1]
R --> S[Send SMS2]
S --> T[Send SMS3]
U[OpenAI Chat Model2] --> B
V[OpenAI Chat Model] --> D
W[SkillUp SMS Support Resources Vectorized] --> B
X[SkillUp SMS Support Resources Vectorized1] --> D
Y[Simple Memory] --> B
Z[Simple Memory1] --> D
AA[On form submission] --> AB[SkillUp SMS Support Storage]
AC[On form submission1] --> AD[SkillUp SMS Support Storage1]
Trigger¶
The workflow has multiple triggers:
- WhatsApp Webhook: Receives incoming WhatsApp messages (currently not visible in the provided JSON but referenced in nodes)
- SMS Webhook: Receives incoming SMS messages via webhook endpoint eda54d73-9621-4f15-b1db-4affd2f92668
- Form Submissions: Two form triggers for uploading documents to the knowledge base
Nodes Used¶
| Node Type | Purpose |
|---|---|
| AI Agent | Processes user messages and generates contextual business mentorship responses |
| OpenAI Chat Model | Provides the language model for generating responses |
| Vector Store (PGVector) | Stores and retrieves business knowledge documents |
| Embeddings OpenAI | Creates vector embeddings for document storage and retrieval |
| Memory Buffer Window | Maintains conversation context across messages |
| Code (JavaScript) | Classifies response types and splits long messages |
| HTTP Request | Sends SMS messages via Africa's Talking API |
| Twilio | Sends WhatsApp messages |
| Form Trigger | Allows document uploads for knowledge base |
| Webhook | Receives incoming SMS messages |
| If | Routes messages based on response type |
| Reranker Cohere | Improves relevance of retrieved knowledge |
External Services & Credentials Required¶
- OpenAI API: For language model and embeddings
- Cohere API: For document reranking
- PostgreSQL Database: For vector storage (Postgres Waringa)
- Twilio API: For WhatsApp messaging (Waringa account)
- Africa's Talking API: For SMS messaging
- n8n Cloud: For webhook endpoints
Environment Variables¶
The workflow uses hardcoded API keys and configuration values that should be moved to environment variables:
- Africa's Talking API key
- Africa's Talking username: toll_free_sms_ke
- SMS sender ID: 24436
Data Flow¶
Input: - SMS messages with user questions about business topics - WhatsApp messages with business inquiries - Document uploads for knowledge base enhancement
Processing: - Language detection (English/Kiswahili) - Vector similarity search against business knowledge base - AI-generated responses with contextual follow-up questions - Message formatting and splitting for SMS constraints
Output: - SMS responses (≤160 characters) via Africa's Talking - WhatsApp responses via Twilio - Multi-part topic selection menus when needed
Error Handling¶
The workflow includes basic error handling through: - Response classification to handle different message types - Language-specific error messages for invalid inputs - Fallback responses for unclear or unrelated questions
Known Limitations¶
- SMS responses are limited to 160 characters
- Topic selection menus require 3 separate SMS messages
- No explicit error handling for API failures
- Hardcoded API credentials instead of environment variables
- SMS webhook is currently disabled
Related Workflows¶
No related workflows mentioned in the provided context.
Setup Instructions¶
-
Import Workflow: Import the JSON into your n8n instance
-
Configure Credentials:
- Set up OpenAI API credentials
- Configure Cohere API access
- Add PostgreSQL database connection
- Set up Twilio account for WhatsApp
- Configure Africa's Talking API for SMS
-
Database Setup:
- Create PostgreSQL table
sms_rag_for_skilup_finalfor vector storage - Ensure pgvector extension is enabled
- Create PostgreSQL table
-
Upload Knowledge Base:
- Use the form triggers to upload business mentorship documents
- Documents will be automatically processed and vectorized
-
Configure Webhooks:
- Set up SMS webhook endpoint with your provider
- Configure WhatsApp webhook with Twilio
- Update webhook URLs in the respective nodes
-
Environment Variables (Recommended):
- Move API keys to environment variables
- Update hardcoded values in HTTP Request nodes
-
Test the Workflow:
- Send test SMS to verify SMS flow
- Send test WhatsApp message to verify WhatsApp flow
- Test both English and Kiswahili language detection
-
Activate Workflow: Enable the workflow to start receiving messages