Automated DM Template for New Twitter Followers

Auto-DM New Twitter Followers

Use RAG technology and AI to automatically send personalized direct messages to new Twitter followers, integrating a vector database for intelligent content generation and logging.

12 NodesMarketing & SocialSocial Media Marketing AI Automation RAG Technology

Workflow Overview

This is an automated system for sending direct messages to new Twitter followers, integrating RAG (Retrieval-Augmented Generation) technology and a vector database. The workflow intelligently processes new follower data, uses AI to generate personalized direct message content, and logs operational results into Google Sheets.

Core Features

Intelligent Direct Message Automation

  • When a new Twitter follower appears, the system triggers the workflow via a webhook
  • Uses AI technology to generate personalized direct message content
  • Automatically sends welcome messages to new followers

RAG Technology Integration

  • Utilizes the Pinecone vector database to store and retrieve contextual information
  • Converts text into vector representations using the Cohere embedding model
  • Supports semantic search for more accurate contextual understanding

Workflow Architecture

1. Trigger Layer

Webhook Trigger

  • Receives POST requests at the endpoint: auto-dm-new-twitter-followers
  • Serves as the entry point for the entire workflow
  • Receives relevant data about new followers

2. Data Processing Layer

Text Splitter

  • Splits input text into smaller chunks
  • Chunk size: 400 characters
  • Overlap: 40 characters
  • Ensures contextual coherence when splitting text

Embeddings

  • Uses Cohere’s embed-english-v3.0 model
  • Converts text into numerical vector representations
  • Enables semantic similarity calculations

3. Vector Storage Layer

Pinecone Insert

  • Stores embedded vectors in the Pinecone database
  • Index name: auto-dm_new_twitter_followers
  • Mode: insert

Pinecone Query

  • Retrieves relevant context from the Pinecone database
  • Queries using the same index
  • Provides background information for AI generation

4. AI Processing Layer

Chat Model

  • Uses OpenAI’s language model
  • Responsible for generating intelligent response content

Vector Tool

  • Name: Pinecone
  • Description: Vector context
  • Supplies vector query results to the AI agent

Window Memory

  • Maintains conversation history
  • Ensures contextual coherence
  • Supports multi-turn conversations

RAG Agent

  • System prompt: "You are an assistant for Auto-DM New Twitter Followers"
  • Processing type: defined text processing
  • Integrates vector tools and memory to generate final responses

5. Output Layer

Append Sheet

  • Logs processing results to Google Sheets
  • Document ID: SHEET_ID
  • Worksheet name: Log
  • Operation: append new row
  • Logged field: Status

Slack Alert

  • Error handling mechanism
  • Sends to channel: #alerts
  • Message format: Auto-DM New Twitter Followers error: {error message}

Data Flow

Webhook receive → Text split → Vector embedding → 
                      ↓
                 Pinecone storage
                      ↓
Webhook receive → Window memory → RAG agent ← Vector query ← Pinecone
                      ↓                ↓
                 Chat model      Vector tool
                      ↓
                 Success → Google Sheets log
                      ↓
                 Failure → Slack alert

Technical Highlights

High Intelligence

  • Uses large language models to generate personalized content
  • RAG technology ensures accurate and relevant replies
  • Automatically learns and adapts to user preferences

Strong Scalability

  • Vector database supports large-scale data storage
  • Modular design facilitates feature expansion
  • Supports custom prompts and parameters

Reliability Assurance

  • Comprehensive error handling mechanism
  • Real-time Slack alerts
  • Google Sheets logging

Use Cases

  1. Social Media Marketing: Automatically welcome new followers to boost engagement
  2. Customer Relationship Management: Establish initial contact and collect user feedback
  3. Brand Promotion: Deliver brand messaging and guide user behavior
  4. Community Management: Batch-process new members with personalized welcomes

Configuration Requirements

API Credentials

  • Cohere API (embedding service)
  • Pinecone API (vector database)
  • OpenAI API (language model)
  • Google Sheets OAuth2 (data logging)
  • Slack API (error notifications)

Total Nodes: 12 nodes

  • 1 trigger node
  • 4 data processing nodes
  • 3 AI/ML nodes
  • 2 vector storage nodes
  • 2 output nodes