โ† All skills
Tencent SkillHub ยท Communication & Collaboration

Whatsapp Context Manager for Agents

AI-powered WhatsApp tool for agents providing instant customer history, sentiment, priority, order details, VIP detection, and response suggestions.

skill openclawclawhub Free
0 Downloads
0 Stars
0 Installs
0 Score
High Signal

AI-powered WhatsApp tool for agents providing instant customer history, sentiment, priority, order details, VIP detection, and response suggestions.

โฌ‡ 0 downloads โ˜… 0 stars Unverified but indexed

Install for OpenClaw

Quick setup
  1. Download the package from Yavira.
  2. Extract the archive and review SKILL.md first.
  3. Import or place the package into your OpenClaw setup.

Requirements

Target platform
OpenClaw
Install method
Manual import
Extraction
Extract archive
Prerequisites
OpenClaw
Primary doc
SKILL.md

Package facts

Download mode
Yavira redirect
Package format
ZIP package
Source platform
Tencent SkillHub
What's included
README.md, SKILL.md, examples_whatsapp.py, install_check_whatsapp.py, requirements_whatsapp.txt, test_whatsapp.py

Validation

  • Use the Yavira download entry.
  • Review SKILL.md after the package is downloaded.
  • Confirm the extracted package contains the expected setup assets.

Install with your agent

Agent handoff

Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.

  1. Download the package from Yavira.
  2. Extract it into a folder your agent can access.
  3. Paste one of the prompts below and point your agent at the extracted folder.
New install

I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.

Upgrade existing

I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.

Trust & source

Release facts

Source
Tencent SkillHub
Verification
Indexed source record
Version
0.1.0

Documentation

ClawHub primary doc Primary doc: SKILL.md 42 sections Open source page

WhatsApp Intelligent Context Manager - Skill Guide

This skill provides an AI-powered context management system for WhatsApp customer service agents, enabling instant access to customer history, sentiment analysis, and smart response suggestions.

Quick Installation

# Download and extract unzip whatsapp-context-manager.zip cd whatsapp-context-manager # Verify installation (no dependencies needed!) python install_check_whatsapp.py # Run tests python test_whatsapp.py # Try examples python examples_whatsapp.py

What Problem Does This Solve?

Without This System: โŒ Agents have no context when customer messages arrive โŒ No idea if customer is VIP or first-timer โŒ Can't see order status without switching systems โŒ Don't know if message is urgent or can wait โŒ Guessing what to say instead of smart suggestions With This System: โœ… Complete customer context in 2 seconds โœ… Automatic sentiment analysis (angry/happy/neutral) โœ… Smart priority (critical/high/normal/low) โœ… Order status right there โœ… AI-powered response suggestions โœ… VIP customer detection

1. Initialize the System

from whatsapp_context_manager import ContextManager # Create context manager (creates local database) manager = ContextManager("production.db")

2. Process Incoming WhatsApp Message

# When a WhatsApp message arrives context = manager.process_incoming_message( phone="+1234567890", message_content="Where is my order?!", agent_id="agent_001" )

3. Display Context to Agent

# Show agent what they need to know print(f"Priority: {context.priority.value}") # "critical" print(f"Sentiment: {context.sentiment.value}") # "negative" print(f"Category: {context.category}") # "order_status" print(f"VIP Customer: {context.customer.is_vip}") # True/False # Key insights for insight in context.key_insights: print(f"๐Ÿ’ก {insight}") # Warnings for warning in context.warnings: print(f"โš ๏ธ {warning}") # Suggested responses for response in context.suggested_responses: print(f"๐Ÿ’ฌ {response}")

4. Send Reply

# Agent sends reply manager.send_message( phone="+1234567890", message_content="Your order #12345 is on the way!", agent_id="agent_001" )

What Agent Sees - Dashboard Example

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ AGENT DASHBOARD โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Customer: +1234567890 โ”‚ โ”‚ Name: John Doe โ”‚ โ”‚ VIP: YES โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Priority: CRITICAL โ”‚ โ”‚ Sentiment: NEGATIVE โ”‚ โ”‚ Category: ORDER_STATUS โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ KEY INSIGHTS: โ”‚ โ”‚ โ€ข ๐ŸŒŸ VIP Customer - Prioritize response โ”‚ โ”‚ โ€ข ๐Ÿ“ฆ Active Order: #ORD-12345 - shipped โ”‚ โ”‚ โ€ข ๐Ÿšš Tracking: TRK-ABC123 โ”‚ โ”‚ โ€ข โšก Customer expects fast replies (~2min) โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ WARNINGS: โ”‚ โ”‚ โ€ข ๐Ÿšจ CRITICAL: Requires immediate attention! โ”‚ โ”‚ โ€ข ๐Ÿ˜ก Customer is very upset - handle with care โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ SUGGESTED RESPONSES: โ”‚ โ”‚ 1. Let me check your order status right away. โ”‚ โ”‚ 2. Your order #ORD-12345 is shipped. โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

1. Automatic Sentiment Analysis

Detects customer mood from message: # System automatically analyzes sentiment context = manager.process_incoming_message(phone, "This is TERRIBLE!", agent_id) print(context.sentiment.value) # "very_negative" context = manager.process_incoming_message(phone, "Thanks!", agent_id) print(context.sentiment.value) # "positive" Sentiment Levels: ๐Ÿ˜ก very_negative - Angry, furious, scam ๐Ÿ˜Ÿ negative - Disappointed, problem ๐Ÿ˜ neutral - Questions, info requests ๐Ÿ˜Š positive - Thanks, happy ๐Ÿคฉ very_positive - Excellent, love it

2. Message Categorization

Automatically categorizes messages: # System automatically categorizes context = manager.process_incoming_message(phone, "Where is my package?", agent_id) print(context.category) # MessageCategory.ORDER_STATUS context = manager.process_incoming_message(phone, "Refund please!", agent_id) print(context.category) # MessageCategory.PAYMENT Categories: ๐Ÿ“ฆ ORDER_STATUS - Delivery, tracking, shipment ๐Ÿ’ณ PAYMENT - Refund, billing, transaction ๐Ÿ”ด COMPLAINT - Problem, issue, broken ๐Ÿ›๏ธ PRODUCT_INQUIRY - Price, stock, features ๐Ÿ†˜ SUPPORT - Help, how-to, questions ๐Ÿ’ฐ SALES - Buy, purchase, interested โญ FEEDBACK - Review, opinion โ“ OTHER - Uncategorized

3. Priority Calculation

Smart priority based on multiple factors: # System calculates priority context = manager.process_incoming_message( phone="+1234567890", message_content="My payment failed!!!", agent_id="agent_001" ) print(context.priority.value) # "critical" Priority Levels: ๐Ÿ”ด CRITICAL - Angry customer, payment issue, VIP unhappy ๐ŸŸ  HIGH - Complaints, negative sentiment ๐ŸŸก NORMAL - General questions ๐ŸŸข LOW - Info requests, positive feedback

4. Response Suggestions

AI suggests appropriate responses: context = manager.process_incoming_message( phone="+1234567890", message_content="When will my order arrive?", agent_id="agent_001" ) # Get suggestions for response in context.suggested_responses: print(response) # Output: # "Let me check your order status right away." # "Your order #12345 is currently shipped." # "Expected delivery is tomorrow."

Order Integration

Add and track customer orders: from whatsapp_context_manager import Order from datetime import datetime, timedelta # Add order to system order = Order( order_id="ORD-12345", customer_id=context.customer.customer_id, status="shipped", amount=99.99, items=[ {"name": "Wireless Headphones", "quantity": 1, "price": 99.99} ], created_at=datetime.now().isoformat(), updated_at=datetime.now().isoformat(), tracking_number="TRK-ABC123", estimated_delivery=(datetime.now() + timedelta(days=2)).strftime("%Y-%m-%d") ) manager.add_order(order) # Now when customer asks about order, agent sees all details context = manager.process_incoming_message(phone, "Order status?", agent_id) print(context.active_orders[0].tracking_number) # "TRK-ABC123"

VIP Customer Management

Mark and manage VIP customers: # Update customer to VIP manager.update_customer_info( phone="+1234567890", name="John Doe", email="john@example.com", is_vip=True, tags=["premium", "loyal", "high-value"], notes="Always responds best to quick, direct answers" ) # Future messages automatically show VIP status context = manager.process_incoming_message(phone, "Hello", agent_id) print(context.customer.is_vip) # True print(context.customer.tags) # ["premium", "loyal", "high-value"]

Conversation History

Access complete conversation history: # Get context (includes recent messages) context = manager.process_incoming_message(phone, "Need help", agent_id) # View recent messages for msg in context.recent_messages: direction = "Customer" if msg.direction == "inbound" else "Agent" print(f"{direction}: {msg.content}")

Customer Profile

Access complete customer profile: context = manager.process_incoming_message(phone, "Hello", agent_id) customer = context.customer print(f"Phone: {customer.phone}") print(f"Name: {customer.name}") print(f"Total Messages: {customer.total_messages}") print(f"VIP: {customer.is_vip}") print(f"Tags: {customer.tags}") print(f"Notes: {customer.notes}") print(f"Last Contact: {customer.last_contact}") print(f"Sentiment History: {customer.sentiment_history}")

Use Case 1: Order Status Inquiry

# Customer: "Where is my order?" context = manager.process_incoming_message( phone="+1234567890", message_content="Where is my order?", agent_id="agent_001" ) # Agent sees: if context.active_orders: order = context.active_orders[0] print(f"Order ID: {order.order_id}") print(f"Status: {order.status}") print(f"Tracking: {order.tracking_number}") print(f"Est. Delivery: {order.estimated_delivery}") # Suggested response print(context.suggested_responses[0]) # "Your order #ORD-12345 is shipped. Tracking: TRK-ABC123"

Use Case 2: Angry Customer

# Customer: "This is TERRIBLE! I want a refund NOW!!!" context = manager.process_incoming_message( phone="+1234567890", message_content="This is TERRIBLE! I want a refund NOW!!!", agent_id="agent_001" ) # System detects: print(context.priority.value) # "critical" print(context.sentiment.value) # "very_negative" # Agent sees warnings: for warning in context.warnings: print(warning) # "๐Ÿšจ CRITICAL: Requires immediate attention!" # "๐Ÿ˜ก Customer is very upset - handle with care" # Suggested response print(context.suggested_responses[0]) # "I sincerely apologize for the inconvenience. Let me help resolve this."

Use Case 3: Multiple Customers Priority Queue

# Process messages from multiple customers customers = [ ("+1111111111", "Can I get some info?"), ("+2222222222", "My payment failed!!!"), ("+3333333333", "I have a complaint"), ("+4444444444", "Thanks for the help!"), ] contexts = [] for phone, message in customers: context = manager.process_incoming_message(phone, message, "agent_001") contexts.append((phone, context)) # Sort by priority priority_order = { MessagePriority.CRITICAL: 0, MessagePriority.HIGH: 1, MessagePriority.NORMAL: 2, MessagePriority.LOW: 3 } contexts.sort(key=lambda x: priority_order[x[1].priority]) # Agent dashboard shows: # 1. ๐Ÿ”ด +2222222222 - CRITICAL - Payment failed # 2. ๐ŸŸ  +3333333333 - HIGH - Complaint # 3. ๐ŸŸก +1111111111 - NORMAL - Info request # 4. ๐ŸŸข +4444444444 - LOW - Thank you message

Use Case 4: First-time vs Returning Customer

# System automatically tracks context = manager.process_incoming_message( phone="+9999999999", # New number message_content="Hello", agent_id="agent_001" ) # Check if first time if context.customer.total_messages == 1: print("๐Ÿ‘‹ First time customer!") # Show introduction, onboarding info else: print(f"๐Ÿ“Š Returning customer ({context.customer.total_messages} messages)") # Show history, previous orders

With WhatsApp Business API

from whatsapp_business_api import WhatsAppClient from whatsapp_context_manager import ContextManager # Initialize wa_client = WhatsAppClient(api_key="your_key") manager = ContextManager("production.db") # Handle incoming messages @wa_client.on_message def handle_message(phone, message): # Get context context = manager.process_incoming_message( phone=phone, message_content=message, agent_id="auto_agent" ) # Display to agent dashboard display_to_agent(context) # If critical, alert supervisor if context.priority == MessagePriority.CRITICAL: notify_supervisor(context)

With Web Dashboard

from flask import Flask, jsonify from whatsapp_context_manager import ContextManager app = Flask(__name__) manager = ContextManager() @app.route('/api/message', methods=['POST']) def process_message(): data = request.json # Process message context = manager.process_incoming_message( phone=data['phone'], message_content=data['message'], agent_id=data['agent_id'] ) # Return context as JSON return jsonify(context.to_dict())

1. Always Process Through System

# Good โœ… context = manager.process_incoming_message(phone, message, agent_id) # Agent has full context # Bad โŒ # Responding without context send_reply_directly(phone, "Hello") # Agent is blind

2. Mark VIP Customers

# Identify high-value customers early if customer_is_high_value(phone): manager.update_customer_info( phone=phone, is_vip=True, tags=["high-value", "premium"] )

3. Track Orders

# Add orders to system for automatic context when_order_placed(): manager.add_order(order) # Now agents automatically see order status when customer asks

4. Use Suggested Responses

# Get AI suggestions context = manager.process_incoming_message(phone, message, agent_id) # Show to agent for quick selection for i, response in enumerate(context.suggested_responses, 1): print(f"{i}. {response}")

5. Monitor Priority Queue

# Get all pending messages pending_contexts = get_all_pending_messages() # Sort by priority pending_contexts.sort(key=lambda x: priority_order[x.priority]) # Agents work from top (critical) to bottom (low)

1. Database Management

# Use separate databases for different purposes dev_manager = ContextManager("development.db") prod_manager = ContextManager("production.db") test_manager = ContextManager("test.db")

2. Batch Processing

# Process multiple messages efficiently for phone, message in message_queue: context = manager.process_incoming_message(phone, message, agent_id) process_context(context)

3. Regular Cleanup

# Archive old conversations (optional) # System stores everything by default # Implement custom archival if needed

Security Features

Local Storage: All data stored locally in SQLite No External Dependencies: Pure Python, no third-party libraries Data Integrity: SHA-256 checksums Secure Queries: Parameterized SQL, no injection risks Privacy: No data sent to external services

Issue: Database locked

# Use different database per process manager1 = ContextManager("agent1.db") manager2 = ContextManager("agent2.db")

Issue: Old data in tests

# Clean up test databases import os if os.path.exists("test.db"): os.remove("test.db")

Issue: No order suggestions

# Make sure orders are added to system order = Order(...) manager.add_order(order)

File Structure

whatsapp-context-manager/ โ”œโ”€โ”€ whatsapp_context_manager.py # Main library โ”œโ”€โ”€ examples_whatsapp.py # 8 usage examples โ”œโ”€โ”€ test_whatsapp.py # Complete test suite โ”œโ”€โ”€ README_WHATSAPP.md # Full documentation โ”œโ”€โ”€ install_check_whatsapp.py # Installation check โ”œโ”€โ”€ requirements_whatsapp.txt # Dependencies (none!) โ”œโ”€โ”€ LICENSE_WHATSAPP # MIT License โ””โ”€โ”€ .gitignore_whatsapp # Git ignore rules

Requirements

Python 3.8 or higher No external dependencies!

Testing

# Run all tests python test_whatsapp.py # Should show: # โœ… Sentiment analysis tests passed # โœ… Message categorization tests passed # โœ… Priority calculation tests passed # โœ… Customer management tests passed # โœ… Message storage tests passed # โœ… Order management tests passed # โœ… VIP customer tests passed # โœ… Sentiment tracking tests passed # โœ… Response suggestions tests passed # โœ… Priority queue tests passed # โœ… Conversation flow tests passed # โœ… Context export tests passed # โœ… ALL TESTS PASSED

Examples

Run the examples to see the system in action: python examples_whatsapp.py Includes: Basic message processing Customer with active order Angry customer scenario VIP customer handling Conversation history Multiple customers priority queue Agent dashboard view Context export to JSON

Getting Help

๐Ÿ“– Read full documentation: README_WHATSAPP.md ๐Ÿ’ป Check examples: examples_whatsapp.py ๐Ÿงช Run tests: test_whatsapp.py ๐Ÿ› Report issues on GitHub โญ Star the repo if helpful!

Next Steps

โœ… Install and verify: python install_check_whatsapp.py โœ… Run tests: python test_whatsapp.py โœ… Try examples: python examples_whatsapp.py โœ… Integrate with your WhatsApp system โœ… Customize for your needs

License

MIT License - see LICENSE_WHATSAPP file

Author

cerbug45 GitHub: @cerbug45 Transform your WhatsApp customer service from reactive to proactive! ๐Ÿš€

Category context

Messaging, meetings, inboxes, CRM, and teammate communication surfaces.

Source: Tencent SkillHub

Largest current source with strong distribution and engagement signals.

Package contents

Included in package
3 Scripts2 Docs1 Files
  • SKILL.md Primary doc
  • README.md Docs
  • examples_whatsapp.py Scripts
  • install_check_whatsapp.py Scripts
  • test_whatsapp.py Scripts
  • requirements_whatsapp.txt Files