Observed since 21 Oct, 09:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
WhatsApp integration for Agntrick agents
WhatsApp integration for Agntrick agents. Connect LLM's to your personal WhatsApp account with QR code login.
pip install agntrick-whatsapp
The WhatsApp channel uses neonize which requires:
brew install libmagicsudo apt-get install libmagic1sudo dnf install file-develFor audio transcription, you need:
ffmpeg: For audio format conversion
brew install ffmpegsudo apt-get install ffmpegsudo dnf install ffmpegGroq API Key: Set GROQ_AUDIO_API_KEY or GROQ_API_KEY environment variable
pip install agntrick-whatsapp
Create a whatsapp.yaml configuration file:
# Agent model configuration
model: "glm-4.7"
# Channel configuration
channel:
storage_path: "./storage"
# Privacy and filtering - only allow your own number
privacy:
allowed_contact: "+12 6XX X6X XX6" # Your phone number
# Feature flags
features:
text_messages: true # Enable text messages
media_messages: true # Enable media (images, videos, documents, audio)
group_messages: false # Enable group messages
presence_updates: true # Enable presence (online/typing status)
typing_indicators: true # Send typing indicators when processing
# WhatsApp bridge settings
whatsapp_bridge:
auto_setup: true # Auto-clone Go bridge on first run
auto_connect: true # Auto-connect on startup
bridge_timeout_sec: 180 # Max wait for bridge startup
poll_interval_sec: 5 # Check for new messages every N seconds
# Logging
logging:
level: "INFO" # DEBUG, INFO, WARNING, ERROR
file: "./logs/agent.log" # Log file location
Create a simple Python script run_whatsapp.py:
import asyncio
from pathlib import Path
from agntrick_whatsapp import WhatsAppChannel, WhatsAppRouterAgent
async def main():
# Create channel - storage is where session data is saved
channel = WhatsAppChannel(
storage_path="./storage",
allowed_contact="+34 6XX XXX XXX", # Your phone number
)
# Create and start the router agent
agent = WhatsAppRouterAgent(
channel=channel,
model_name="glm-4.7",
)
await agent.start()
asyncio.run(main())
Run it:
python run_whatsapp.py
On first run, you'll see a QR code in your terminal. Open WhatsApp on your phone:
That's it! Your agent is now connected and will respond to messages from your allowed contact.
Here's how you can organize a project using the agntrick-whatsapp package:
~/code/agntrick/
├── whatsapp/
│ ├── run_whatsapp.py # Main entry point
│ ├── whatsapp.yaml # Configuration file
│ ├── storage/ # WhatsApp session data (created on first run)
│ └── logs/ # Application logs
└── prompts/ # Custom prompts for agents
The storage/ directory contains your WhatsApp session data after QR code login - you don't need to recreate this on subsequent runs.
Install system dependencies (if needed):
# macOS
brew install libmagic ffmpeg
Install the package:
pip install agntrick-whatsapp
Create your config file (whatsapp.yaml):
allowed_contactRun the agent:
python run_whatsapp.py
Scan the QR code displayed in your terminal using WhatsApp:
Start chatting! Send a message from your allowed contact number.
After the first QR code login, your session is saved in the storage_path directory. On subsequent runs, you don't need to scan again - the agent will auto-connect using the saved session.
If you need to re-login (new phone number, etc.), simply delete the storage directory:
rm -rf ./storage
Then run python run_whatsapp.py again to scan a new QR code.
The router agent supports the following commands:
| Command | Description |
|---|---|
/learn <topic> | Learning/tutorial mode |
/youtube <url> | YouTube video analysis |
/remind <time> <message> | Set a reminder |
/schedule <time> <agent> [task] | Schedule an agent task |
/schedules | List all scheduled tasks |
/note <content> | Save a note |
/notes | List all saved notes |
/help | Show available commands |
/learn Python decorators - Get a step-by-step tutorial on Python decorators/youtube https://youtube.com/watch?v=xyz - Analyze a YouTube video/remind in 30 min check the oven - Set a reminder/schedule tomorrow 9am assistant summarize news - Schedule a task/note Remember to call mom - Save a noteWhat's the weather in Tokyo? - General questionVoice messages are automatically transcribed using Groq's Whisper API:
from agntrick_whatsapp import AudioTranscriber
transcriber = AudioTranscriber()
result = await transcriber.transcribe_audio("/path/to/voice.ogg")
print(result)
| Field | Type | Required | Description |
|---|---|---|---|
allowed_contact | str | Yes | Phone number to allow messages from |
log_filtered_messages | bool | No | Log filtered messages for debugging |
| Field | Type | Default | Description |
|---|---|---|---|
text_messages | bool | true | Enable text messages |
media_messages | bool | true | Enable media messages |
group_messages | bool | false | Enable group messages |
presence_updates | bool | true | Enable presence updates |
typing_indicators | bool | true | Send typing indicators |
| Field | Type | Default | Description |
|---|---|---|---|
model | str | whisper-large-v3-turbo | Groq Whisper model |
timeout | float | 60.0 | Request timeout in seconds |
config_file | str? | None | Optional config file path |
# Clone the repository
git clone https://github.com/jeancsil/agntrick-whatsapp.git
cd agntrick-whatsapp
# Install dependencies with uv (required for this project)
uv sync
# Run tests
make test
# Run linting
make check
# Format code
make format
To use your local development version in another project:
cd ~/code/agntrick-whatsapp
uv pip install -e .
Now your other projects will use your local version.
make release VERSION=0.4.0
Install system dependencies and reinstall:
# macOS
brew install libmagic
pip install agntrick-whatsapp --force-reinstall
# Ubuntu/Debian
sudo apt-get install libmagic1
pip install agntrick-whatsapp --force-reinstall
rm -rf ./storage (triggers new QR code on next run)Delete the storage directory and run again:
rm -rf ./storage
python run_whatsapp.py
echo $GROQ_AUDIO_API_KEYffmpeg -versionallowed_contact in configDEBUG in config to see what's happeningtail -f ./logs/agent.logMIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.3.7 | 21 Mar 2026 | 7 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 21 Oct, 09:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:1d825894abdbc026305f3cb2f4e60f27cdcfb53c3de0ec4a460136e41d3bd765