AI Reply DM
Automatically replies to unread Direct Messages using AI-generated contextual responses.
What It Does
Section titled “What It Does”- Checks if the current inbox tab has unread messages (via tab indicator)
- Finds the first unread conversation (scrolls down if needed)
- Opens the conversation
- Extracts the other user’s username from the thread header
- Parses the last N messages to build conversation context
- Sends conversation history to an AI provider for contextual reply generation
- Types the reply with human-like simulation
- Sends the reply
- Verifies delivery (input emptied + send button disappeared)
- Optionally returns to the inbox
- Logs the action for tracking
Supported AI Providers
Section titled “Supported AI Providers”| Provider | Models Available |
|---|---|
| OpenAI | GPT-4o, GPT-4o Mini, GPT-4 Turbo, GPT-4 Vision Preview |
| Claude (Anthropic) | Claude 3.5 Sonnet, Claude 3 Opus, Claude 3 Sonnet |
| DeepSeek | DeepSeek Chat, DeepSeek Reasoner |
| Gemini (Google) | Gemini 1.5 Pro, Gemini 1.5 Flash, Gemini Pro Vision |
| Groq | Llama 3.1 70B, Mixtral 8x7B |
| Custom | Any OpenAI-compatible endpoint |
Configuration Options
Section titled “Configuration Options”| Option | Type | Description |
|---|---|---|
| Account | Select | Account for logging |
| Provider | Select | AI provider to use |
| API Key | Password | Your API key (stored securely in node) |
| Model | Select | AI model (options depend on provider) |
| Custom Model Name | Text | For custom model names (when “Custom” selected) |
| Custom Endpoint URL | Text | For custom providers (OpenAI-compatible format) |
| Prompt | Textarea | Instructions for AI reply generation (up to 8000 chars) |
| Context Messages | Number | Number of recent messages to include as context (default: 5) |
| Max Scrolls to Find Unread | Number | Maximum scrolls to search for unread conversations (default: 5) |
| Min Length | Number | Minimum reply length in words (default: 1) |
| Max Length | Number | Maximum reply length in words (default: 500) |
| Blacklist | Textarea | Words to avoid, one per line |
| Enable Typing Simulation | Checkbox | Type like a human (recommended) |
| Typing Preset | Select | Fast, Normal, Slow, Human, or Custom |
| Custom Typing Config | Object | Min/max delay, chars per word (for Custom preset) |
| Go Back After Sending | Checkbox | Return to inbox after sending (default: on) |
| Wait After | Number | Seconds to wait after sending (default: 1.0) |
Typing Presets
Section titled “Typing Presets”| Preset | Speed | Realism |
|---|---|---|
| Fast | Quick | Low |
| Normal | Moderate | Medium |
| Slow | Slow | High |
| Human | Variable | Very High |
| Custom | Configurable | Configurable |
How Unread Detection Works
Section titled “How Unread Detection Works”The module detects unread messages at two levels:
- Tab level: Checks if the inbox tab (Primary/General) has unread messages
- Conversation level: Finds the unread dot indicator next to conversations, scrolling down the inbox if needed
How Message Parsing Works
Section titled “How Message Parsing Works”Messages in a DM thread are differentiated by the presence of a sender avatar:
- Has sender avatar — message received (from them)
- No sender avatar — message sent (from you)
Only text messages are parsed. Non-text content (images, reels, voice notes) is skipped.
Features
Section titled “Features”| Feature | Description |
|---|---|
| Conversation Context | AI receives the last N messages with [You]/[Them] labels for contextual replies |
| Unread-Only | Only processes conversations with unread messages |
| Smart Scrolling | Scrolls inbox to find unread conversations not visible on screen |
| Text-Only Generation | No screenshot needed — conversation parsed via XML for speed |
| Multi-Provider Support | 6 AI providers + custom endpoints |
| Human-Like Typing | Configurable typing simulation with natural delays |
| Auto-Retry | Automatic retry on API failures (3 attempts, exponential backoff) |
| Blacklist Filtering | Avoid specific words in generated replies |
| Length Validation | Ensures replies meet min/max word requirements |
| Send Verification | Confirms reply was sent (input emptied + send button gone) |
| Go Back | Optionally returns to inbox after sending |
| Action Logging | Logs all replies to JSONL file for tracking |
Data Storage
Section titled “Data Storage”| Data | Location |
|---|---|
| Reply Log | Accounts/{account}/dms/dm_log.jsonl |
Log Entry Format
Section titled “Log Entry Format”{ "type": "reply_dm", "target_username": "jane_doe", "dm_text": "Generated reply text", "provider": "openai", "model": "gpt-4o-mini", "success": true, "account": "your_account", "timestamp": "2024-01-15T10:30:00Z"}Output Connections
Section titled “Output Connections”This module has three outputs:
- success — Reply was sent successfully
- failed — An error occurred during execution
- no_unread — No unread messages found in the current tab
When successful, the output includes:
- provider: AI provider used
- model: Model used
- reply_text: The generated reply text
- target_username: User replied to
- messages_context: Number of messages used as context
- duration: Execution time in seconds
Requirements
Section titled “Requirements”- API key for chosen provider
- Internet connection
- Must already be in the DM inbox (use Navigate to Direct module before this)
- At least one unread conversation
When to Use
Section titled “When to Use”- Automatically responding to incoming DMs
- Maintaining conversations at scale
- Responding to customer inquiries or fan messages
- Building engagement through timely replies
Example Prompt
Section titled “Example Prompt”You are replying to a DM on Instagram.Keep the reply short, natural and conversational (1-3 sentences).Match the tone of the conversation. Do not use hashtags.If they asked a question, answer it helpfully.Return ONLY the reply text.- Use the Navigate to Direct module before this one to ensure you’re in the inbox
- Increase “Context Messages” for longer conversations that need more context
- Customize your prompt to match your brand voice
- Use blacklist to prevent unwanted words in replies
- Enable “Go Back After Sending” to chain with Loop modules for multiple replies
- Monitor logs to review AI-generated replies
- Start with GPT-4o Mini or DeepSeek Chat for cost efficiency
- Pair with a Loop module to reply to multiple unread conversations in sequence