Skip to content

E!BA and SkillUp Bots

A comprehensive WhatsApp AI support system that provides instant, context-aware assistance to program staff running E!BA and SkillUp bootcamps. The workflow combines voice and text processing with RAG (Retrieval-Augmented Generation) to deliver accurate guidance from program handbooks directly through WhatsApp.

Purpose

No business context provided yet — add a context.md to enrich this documentation.

This workflow serves as an intelligent support system for two educational programs: - E!BA Academy: A 4-week non-residential bootcamp for out-of-school youth (18-30) in Uganda - SkillUp Bootcamp: A 4-week in-person + 2-week virtual entrepreneurship program in Kenya

The system helps Program Officers, Trainers, Field Operations Assistants, and Site Assistants by providing instant access to procedural guidance, safeguarding protocols, retention strategies, and operational best practices through WhatsApp conversations.

How It Works

  1. Message Reception: Users send text or voice messages to dedicated WhatsApp numbers for either E!BA or SkillUp support
  2. Input Processing: The system detects message type (text/audio) and processes accordingly, transcribing voice messages using OpenAI
  3. Context Retrieval: AI agents query PostgreSQL vector stores containing program handbooks and documentation
  4. Response Generation: GPT models generate contextually appropriate responses based on retrieved information and conversation history
  5. Format Optimization: Responses are cleaned of markdown formatting and optimized for WhatsApp delivery
  6. Delivery: Clean, actionable guidance is sent back via WhatsApp, with conversation history maintained for context

The system also includes feedback collection mechanisms and conversation logging for continuous improvement.

Mermaid Diagram

graph TD
    A[WhatsApp Message] --> B{Message Type?}
    B -->|Audio| C[Download Audio]
    B -->|Text| D[Extract Text]
    C --> E[OpenAI Transcription]
    E --> F[Unified Input Processing]
    D --> F
    F --> G{Which Bot?}
    G -->|E!BA| H[E!BA Support Agent]
    G -->|SkillUp| I[SkillUp Support Agent]
    H --> J[E!BA Vector Store]
    I --> K[SkillUp Vector Store]
    J --> L[Generate E!BA Response]
    K --> M[Generate SkillUp Response]
    L --> N[Clean Text Format]
    M --> N
    N --> O[Send WhatsApp Response]
    F --> P[Log to Airtable]
    N --> Q[Update Response Log]

Trigger

The workflow is triggered by: - WhatsApp Webhook: Incoming messages to configured WhatsApp numbers via Twilio - Form Submissions: File uploads for updating knowledge bases and feedback collection - Chat Interface: Direct chat interactions for testing (disabled in production)

Nodes Used

Node Type Purpose
Webhook Receives WhatsApp messages via Twilio
Switch Routes messages based on type (audio/text)
HTTP Request Downloads audio files from Twilio
OpenAI Transcription Converts voice messages to text
Code (JavaScript) Processes and unifies input, cleans responses
AI Agent Generates contextual responses using GPT models
Vector Store (PostgreSQL) Stores and retrieves handbook knowledge
Embeddings OpenAI Creates vector embeddings for semantic search
Document Loader Processes uploaded documents
Text Splitter Chunks documents for vector storage
Cohere Reranker Improves search result relevance
Memory Buffer Maintains conversation context
Twilio Sends WhatsApp responses
Airtable Logs conversations and feedback
Form Trigger Handles file uploads and feedback

External Services & Credentials Required

  • OpenAI API: For GPT models, embeddings, and transcription
  • Twilio: For WhatsApp messaging
  • PostgreSQL: For vector storage (multiple databases)
  • Cohere: For result reranking
  • Airtable: For logging and feedback collection
  • Google Cloud Storage: For audio file storage
  • Telegram: For alternative chat interface (disabled)

Environment Variables

No specific environment variables are documented in the workflow. Configuration is handled through n8n credential management for: - OpenAI API keys - Twilio account credentials - PostgreSQL connection strings - Cohere API keys - Airtable tokens - Google Cloud service accounts

Data Flow

Input: - WhatsApp text messages - WhatsApp voice messages - PDF/CSV file uploads - Feedback form submissions

Processing: - Voice-to-text transcription - Vector similarity search - Context-aware response generation - Conversation history tracking

Output: - Formatted WhatsApp responses (≤400 characters) - Conversation logs in Airtable - Updated knowledge bases - Audio responses (for specific flows)

Error Handling

The workflow includes several error handling mechanisms: - Input validation in JavaScript nodes - Fallback text processing when audio transcription fails - Escalation guidance when handbook information is insufficient - Safeguarding protocol triggers for urgent situations

Known Limitations

  • Response length limited to 400 characters for mobile optimization
  • No markdown formatting in WhatsApp responses
  • Audio response generation only available for specific flows
  • Requires manual knowledge base updates through file uploads
  • Language support limited to English and Luganda for E!BA

No related workflows are explicitly mentioned in the current configuration.

Setup Instructions

  1. Import Workflow: Import the JSON into your n8n instance
  2. Configure Credentials:

    • Set up OpenAI API credentials for multiple accounts
    • Configure Twilio account for WhatsApp messaging
    • Set up PostgreSQL connections for vector storage
    • Add Cohere API credentials
    • Configure Airtable access tokens
    • Set up Google Cloud Storage credentials
  3. Initialize Vector Stores:

    • Upload handbook documents via the form triggers
    • Ensure vector stores are populated with relevant content
  4. Configure Webhooks:

    • Set up Twilio webhooks to point to your n8n webhook URLs
    • Configure WhatsApp phone numbers
  5. Test Flows:

    • Send test messages to verify audio/text processing
    • Validate response formatting and delivery
    • Test feedback collection mechanisms
  6. Monitor Logs:

    • Check Airtable for conversation logging
    • Monitor vector store performance
    • Review feedback submissions for improvements

The workflow is designed to be production-ready with comprehensive logging and error handling for reliable operation in supporting educational programs.