RAG Content Engine
This workflow pipes internal knowledge, call transcripts, and social listening into a vector database, connects it to an AI agent, and outputs written and video content drafts without manual research.
OutcomeConverts unstructured revenue intelligence into high-velocity, context-aware content that ships weekly instead of monthly.
AdvancedTime to value: 3 to 4 weeks11 tools
How it flows
How it flows.
Build it, step by step
Build it, step by step.
01
Aggregate all knowledge base sources
Consolidate internal documents, sales call recordings, playbooks, and scraped LinkedIn posts into a single Google Drive folder that serves as the source of truth.
- Create a dedicated Drive folder for all knowledge assets
- Use Apify to scrape LinkedIn posts from target creators in your niche
- Ingest SOPs, playbooks, and copywriting guidelines as PDFs or Docs
- Pull blog posts, podcast transcripts, and historical content
- Sync Ergo call recordings (transcripts exported as text files)
- Ensure every file is named with a timestamp or topic identifier
02
Provision the Pinecone vector index
Stand up a Pinecone index configured for OpenAI embeddings. This stores all knowledge as semantic vectors the agent will query.
- Log in to Pinecone and create a new serverless index
- Set dimension to 1536 for OpenAI text-embedding-3-small
- Choose a metric (cosine recommended for text similarity)
- Note your API key, environment, and index name for n8n
03
Build the ingestion pipeline in n8n
Automate chunking, embedding, and upserting every file from Google Drive into Pinecone whenever a file is created or updated.
- Add two Google Drive Trigger nodes: one for File Created, one for File Updated
- Insert a Code node that extracts text from binary (PDF, DOCX, TXT)
- Add a Text Splitter node with 1000-character chunks and 200-character overlap
- Connect an Embeddings (OpenAI) node using text-embedding-3-small
- Wire to a Pinecone Vector Store node in Insert Documents mode
- Log every ingested file (name, timestamp, chunk count) to a Google Sheets tracker
04
Configure the RAG agent
Build an AI Agent node in n8n that queries Pinecone and generates content using Claude. Add memory so it remembers multi-turn conversations.
- Add an AI Agent node and select Claude (or OpenAI) as the model
- Set temperature to 0.3 for consistent, fact-based responses
- Attach a Pinecone Vector Store tool in Retrieve Documents mode
- Add a Simple Memory node with a 5-message conversation window
- Write a system prompt that instructs the agent to cite sources and always call the vector store before answering
- Test with a Chat Trigger node before connecting live inputs
05
Wire in social listening signals
Feed real-time trending content from LinkedIn, X, YouTube, Reddit, and Clay into the agent as context alongside your internal knowledge.
- Use Jungler to monitor LinkedIn activity in your ICP's network
- Connect Tweet Hunter to pull trending posts and hashtags from X.com
- Scrape YouTube video titles and descriptions via Clay or Apify
- Pull Reddit threads from relevant subreddits (Apify or Webhooks)
- Aggregate all signals into a single n8n sub-workflow that formats them as structured JSON
- Route these signals as live context into the agent's system message or tool input
06
Replace the test trigger with Slack
Deploy the agent behind a Slack bot so your team can request drafts in a dedicated channel and see responses inline.
- Create a new Slack app at api.slack.com/apps
- Add bot token scopes: app_mentions:read, chat:write, channels:history
- Install the app to your workspace and copy the bot token
- In n8n, replace the Chat Trigger with a Slack Trigger node (On New Message)
- Add a Slack Send Message node to post agent replies back to the channel
- Test by mentioning the bot in Slack with a content request
07
Route written content drafts to distribution channels
Send the agent's output to writers and designers for polish, then publish to LinkedIn, X, or Beehiiv depending on format.
- Add branching logic: if output format is 'LinkedIn', route to a Writer for tone refinement
- If format is 'X thread', send to Tweet Hunter for scheduling
- For newsletter content, push to Beehiiv as a draft via API or Zapier
- Tag a Designer in Slack if visual assets are required
- Store all drafts in a Google Doc or Notion database for version control
08
Generate video scripts and route to production
Use the same agent to produce video outlines and scripts. Send them to a script writer for polish, then to a video editor for production.
- Add a conditional branch: if request type is 'video', format output as a script with timestamps
- Route to a Script Writer via Slack or email for narrative tightening
- Once approved, forward to a Video Editor with reference links and brand guidelines
- Publish final video to YouTube and log metadata (title, tags, thumbnail) in Google Sheets
09
Track performance and close the loop
Monitor what content performs, then feed high-performing posts back into Google Drive so the agent learns from what works.
- Use Hyperfury, Shield, and YouTube Studio to pull engagement metrics weekly
- Identify posts or videos with above-average CTR, likes, or shares
- Export top performers as text files and upload to the knowledge base folder
- Tag them as 'high-signal' so the agent weights them more heavily in retrieval
- Review Pinecone query logs monthly to spot gaps in coverage or common failure modes
The stack
The stack.
- n8n Orchestrates pipeline and agent logic
- Pinecone Vector database for embeddings
- Claude RAG agent inference
- Ergo Sales call transcript capture
- Apify LinkedIn post scraping
- Jungler LinkedIn social listening
- Tweet Hunter X.com trend monitoring
- Clay Audience signal aggregation
- Slack Agent interface for drafts
- Google Drive Knowledge base source folder
- Beehiiv Newsletter publishing
Related workflows
Related workflows.
Talk to us: Want this workflow run for you?
We wire it into your stack, then run it.
Talk to Phi