Skip to content

AI Reply DM

Automatically replies to unread Direct Messages using AI-generated contextual responses.

  1. Checks if the current inbox tab has unread messages (via tab indicator)
  2. Finds the first unread conversation (scrolls down if needed)
  3. Opens the conversation
  4. Extracts the other user’s username from the thread header
  5. Parses the last N messages to build conversation context
  6. Sends conversation history to an AI provider for contextual reply generation
  7. Types the reply with human-like simulation
  8. Sends the reply
  9. Verifies delivery (input emptied + send button disappeared)
  10. Optionally returns to the inbox
  11. Logs the action for tracking
ProviderModels Available
OpenAIGPT-4o, GPT-4o Mini, GPT-4 Turbo, GPT-4 Vision Preview
Claude (Anthropic)Claude 3.5 Sonnet, Claude 3 Opus, Claude 3 Sonnet
DeepSeekDeepSeek Chat, DeepSeek Reasoner
Gemini (Google)Gemini 1.5 Pro, Gemini 1.5 Flash, Gemini Pro Vision
GroqLlama 3.1 70B, Mixtral 8x7B
CustomAny OpenAI-compatible endpoint
OptionTypeDescription
AccountSelectAccount for logging
ProviderSelectAI provider to use
API KeyPasswordYour API key (stored securely in node)
ModelSelectAI model (options depend on provider)
Custom Model NameTextFor custom model names (when “Custom” selected)
Custom Endpoint URLTextFor custom providers (OpenAI-compatible format)
PromptTextareaInstructions for AI reply generation (up to 8000 chars)
Context MessagesNumberNumber of recent messages to include as context (default: 5)
Max Scrolls to Find UnreadNumberMaximum scrolls to search for unread conversations (default: 5)
Min LengthNumberMinimum reply length in words (default: 1)
Max LengthNumberMaximum reply length in words (default: 500)
BlacklistTextareaWords to avoid, one per line
Enable Typing SimulationCheckboxType like a human (recommended)
Typing PresetSelectFast, Normal, Slow, Human, or Custom
Custom Typing ConfigObjectMin/max delay, chars per word (for Custom preset)
Go Back After SendingCheckboxReturn to inbox after sending (default: on)
Wait AfterNumberSeconds to wait after sending (default: 1.0)
PresetSpeedRealism
FastQuickLow
NormalModerateMedium
SlowSlowHigh
HumanVariableVery High
CustomConfigurableConfigurable

The module detects unread messages at two levels:

  1. Tab level: Checks if the inbox tab (Primary/General) has unread messages
  2. Conversation level: Finds the unread dot indicator next to conversations, scrolling down the inbox if needed

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.

FeatureDescription
Conversation ContextAI receives the last N messages with [You]/[Them] labels for contextual replies
Unread-OnlyOnly processes conversations with unread messages
Smart ScrollingScrolls inbox to find unread conversations not visible on screen
Text-Only GenerationNo screenshot needed — conversation parsed via XML for speed
Multi-Provider Support6 AI providers + custom endpoints
Human-Like TypingConfigurable typing simulation with natural delays
Auto-RetryAutomatic retry on API failures (3 attempts, exponential backoff)
Blacklist FilteringAvoid specific words in generated replies
Length ValidationEnsures replies meet min/max word requirements
Send VerificationConfirms reply was sent (input emptied + send button gone)
Go BackOptionally returns to inbox after sending
Action LoggingLogs all replies to JSONL file for tracking
DataLocation
Reply LogAccounts/{account}/dms/dm_log.jsonl
{
"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"
}

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
  • 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
  • Automatically responding to incoming DMs
  • Maintaining conversations at scale
  • Responding to customer inquiries or fan messages
  • Building engagement through timely replies
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