Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Msg-Use docs

avocardioc50e7cf43dbb
diff --git a/docs/examples/apps/msg-use.mdx b/docs/examples/apps/msg-use.mdx
new file mode 100644
index 000000000..31581a898
--- /dev/null
+++ b/docs/examples/apps/msg-use.mdx
@@ -0,0 +1,133 @@
+---
+title: "Msg-Use (WhatsApp Scheduler)"
+description: "AI-powered WhatsApp message scheduler using browser agents and Gemini. Schedule personalized messages in natural language."
+icon: "message"
+mode: "wide"
+---
+
+<Note>
+This demo requires browser-use v0.7.4+.
+</Note>
+
+## Features
+
+1. Agent logs into WhatsApp Web automatically
+2. Parses natural language scheduling instructions
+3. Composes personalized messages using AI
+4. Schedules messages for future delivery or sends immediately
+5. Persistent session (no repeated QR scanning)
+
+## Setup
+
+Make sure the newest version of browser-use is installed:
+```bash
+pip install -U browser-use
+```
+
+Export your Gemini API key, get it from: [Google AI Studio](https://makersuite.google.com/app/apikey)
+```bash
+export GEMINI_API_KEY='your-gemini-api-key-here'
+```
+
+## Initial Login
+
+First-time setup requires QR code scanning:
+```bash
+python whatsapp_login.py
+```
+- Scan QR code when browser opens
+- Session will be saved for future use
+
+## Normal Usage
+
+1. **Edit your schedule** in `schedule.txt`:
+```
+- Send "Hi" to Magnus on the 13.06 at 18:15
+- Tell hinge date (Camila) at 20:00 that I miss her
+- Send happy birthday message to sister on the 15.06
+- Remind mom to pick up the car next tuesday
+```
+
+2. **Test mode** - See what will be sent:
+```bash
+python whatsapp_scheduler.py --test
+```
+
+3. **Run scheduler**:
+```bash
+python whatsapp_scheduler.py
+
+# Debug Mode - See the browser in action
+python whatsapp_scheduler.py --debug
+```
+
+## Programmatic Usage
+
+```python
+import asyncio
+from whatsapp_scheduler import schedule_messages
+
+async def main():
+ messages = [
+ "Send hello to John at 15:30",
+ "Remind Sarah about meeting tomorrow at 9am"
+ ]
+ await schedule_messages(messages, debug=False)
+
+asyncio.run(main())
+```
+
+## Example Output
+
+The scheduler processes natural language and outputs structured results:
+
+```json
+[
+ {
+ "contact": "Magnus",
+ "original_message": "Hi",
+ "composed_message": "Hi",
+ "scheduled_time": "2025-06-13 18:15"
+ },
+ {
+ "contact": "Camila",
+ "original_message": "I miss her",
+ "composed_message": "I miss you ❤️",
+ "scheduled_time": "2025-06-14 20:00"
+ },
+ {
+ "contact": "sister",
+ "original_message": "happy birthday message",
+ "composed_message": "Happy birthday! 🎉 Wishing you an amazing day, sis! Hope you have the best birthday ever! ❤️🎂🎈",
+ "scheduled_time": "2025-06-15 09:00"
+ }
+]
+```
+
+## Advanced Configuration
+
+```python
+import asyncio
+from whatsapp_scheduler import WhatsAppScheduler
+
+async def advanced_scheduling():
+ scheduler = WhatsAppScheduler(
+ debug=True,
+ compose_messages=True, # Enable AI message composition
+ session_persist=True # Save login session
+ )
+
+ # Custom scheduling with time zones
+ await scheduler.schedule_message(
+ contact="John",
+ message="Meeting reminder",
+ time="2025-01-15 14:30",
+ timezone="US/Pacific"
+ )
+
+asyncio.run(advanced_scheduling())
+```
+
+## Source Code
+
+Full implementation: [https://github.com/browser-use/browser-use/tree/main/examples/apps/msg-use](https://github.com/browser-use/browser-use/tree/main/examples/apps/msg-use)
\ No newline at end of file