{
  "nodes": [
    {
      "id": "200eb502-94ec-4807-aa75-d6017747ac61",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        496,
        144
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "rss"
      },
      "typeVersion": 1
    },
    {
      "id": "4d463e75-f9c7-4041-b038-411aaa640c1f",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1168,
        368
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "46d5aa0b-2ab1-426e-812f-251ee6cf9e22",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1296,
        368
      ],
      "parameters": {
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "title",
                "value": "={{ $json.title }}"
              },
              {
                "name": "createDate",
                "value": "={{ $now.toISO() }}"
              },
              {
                "name": "publishDate",
                "value": "={{ $json.date }}"
              },
              {
                "name": "link",
                "value": "={{ $json.link }}"
              }
            ]
          }
        },
        "jsonData": "=# {{ $json.title }}\n{{ $json.content }}",
        "jsonMode": "expressionData"
      },
      "typeVersion": 1
    },
    {
      "id": "84b8b0ec-32d8-4d65-b916-f19fc253f7c3",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1376,
        576
      ],
      "parameters": {
        "options": {},
        "chunkSize": 3000
      },
      "typeVersion": 1
    },
    {
      "id": "eb9bd447-b516-414e-9365-7f0e763b72ca",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        480,
        1088
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "837d08c1-3493-4003-82c0-520ff539a9a5",
      "name": "Get Articles Daily",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        48,
        144
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "376c6c99-c110-4f66-9a33-d3ef0c9c023d",
      "name": "Send Weekly Summary",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        32,
        864
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                1
              ],
              "triggerAtHour": 5
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "aef6c0ff-21e0-4d6d-bf96-7f353934bfba",
      "name": "News reader AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        512,
        864
      ],
      "parameters": {
        "text": "=Summarize the most relevant tech news published in the past 7 days. Today is {{ $now }}",
        "options": {
          "systemMessage": "=Write in clear, concise, and easy-to-understand English, as if curating a weekly tech newsletter.\n\nPrioritize stories related to the following topics: {{ $json.Interests }}.\nIf those topics aren't present, choose the most impactful, widely reported, and noteworthy tech events from the week.\n\nFor each news item:\n\nProvide a short, informative summary (1\u20133 sentences max)\n\nInclude the article title and a direct link to the original source\n\nAvoid duplicate stories.\n\nInclude exactly {{ $json['Number of news items to include'] }} distinct news items.\nMaintain a tone that's friendly yet professional, suitable for a broad audience of tech enthusiasts."
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "0de6f273-3cc1-4545-bb01-e77edb8a0700",
      "name": "Send Newsletter",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1200,
        864
      ],
      "parameters": {
        "sendTo": "enter receiver mail here",
        "message": "={{ $json.data }}",
        "options": {},
        "subject": "Weekly tech newsletter"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "54b6dcf2-f41d-4866-aa62-46e8209c6e0e",
      "name": "Convert Response to an Email-Friendly Format",
      "type": "n8n-nodes-base.markdown",
      "position": [
        976,
        864
      ],
      "parameters": {
        "mode": "markdownToHtml",
        "options": {},
        "markdown": "={{ $json.output }}"
      },
      "typeVersion": 1
    },
    {
      "id": "9ba5faf0-591d-4e89-af6b-f4925bc563f0",
      "name": "Your topics of interest",
      "type": "n8n-nodes-base.set",
      "position": [
        256,
        864
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "018882ca-37c3-45af-944f-2081b0605065",
              "name": "Interests",
              "type": "string",
              "value": " games"
            },
            {
              "id": "4cfdafc1-47a4-41cc-9eb8-72880ea34511",
              "name": "Number of news items to include",
              "type": "string",
              "value": "15"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5180289a-4b7f-47f4-b76a-dc4834c99305",
      "name": "Store News Articles",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        1200,
        144
      ],
      "parameters": {
        "mode": "insert",
        "memoryKey": "news_store_key"
      },
      "typeVersion": 1.1
    },
    {
      "id": "d9650c0d-b210-44a2-b4e0-b324f2763b96",
      "name": "Set Tech News RSS Feeds",
      "type": "n8n-nodes-base.set",
      "position": [
        272,
        144
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b8c00469-890b-4b5b-8e2e-2ad9ec2d0815",
              "name": "rss",
              "type": "array",
              "value": "=[\n  \"https://www.engadget.com/rss.xml\",\n  \"https://feeds.arstechnica.com/arstechnica/index\",\n  \"https://www.theverge.com/rss/index.xml\",\n  \"https://www.wired.com/feed/rss\",\n  \"https://www.technologyreview.com/topnews.rss\",\n  \"https://techcrunch.com/feed/\"\n]\n"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bb2dbd3f-6f73-43bc-9198-40d9e34c8b5c",
      "name": "Read RSS News Feeds",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        720,
        144
      ],
      "parameters": {
        "url": "={{ $json.rss }}",
        "options": {
          "ignoreSSL": false
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "14a6df1c-1890-455f-a987-fb8ebe843ee3",
      "name": "Get News Articles",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        608,
        1088
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "topK": 20,
        "toolName": "get_news",
        "memoryKey": "news_store_key",
        "toolDescription": "Call this tool to get the latest news articles."
      },
      "typeVersion": 1.1
    },
    {
      "id": "4fc30a62-3579-4bfd-9e93-b564766d9d8c",
      "name": "Embeddings OpenAI2",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        688,
        1296
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f78844f7-9219-4bb4-9f41-b273090ecbdb",
      "name": "Set and Normalize Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        944,
        144
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "e9f27ceb-c5f2-4997-8cb1-67576a7bb337",
              "name": "title",
              "type": "string",
              "value": "={{ $json.title }}"
            },
            {
              "id": "4c4f9417-40f2-4fb0-9976-d09f5984680f",
              "name": "content",
              "type": "string",
              "value": "={{ $json['content:encodedSnippet'] ?? $json.contentSnippet}}"
            },
            {
              "id": "e1986bac-054e-4240-ba50-536dbcd27337",
              "name": "date",
              "type": "string",
              "value": "={{ $json.isoDate}}"
            },
            {
              "id": "9566e23c-ac30-4d66-abbd-889f322688b7",
              "name": "link",
              "type": "string",
              "value": "={{ $json.link }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "266b3520-a6a0-42c0-b751-4b7f59fe65a4",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 368,
        "height": 144,
        "content": "## Daily News Collection (RSS)\nNews is scraped daily from multiple platforms\nusing their RSS feeds.\nEach article is cleaned, categorized,\nand prepared for vector storage."
      },
      "typeVersion": 1
    },
    {
      "id": "f205202c-6de6-4074-ba9f-05140edaca32",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1584,
        496
      ],
      "parameters": {
        "color": 7,
        "width": 384,
        "height": 128,
        "content": "## Vector Store Storage\nAll news articles are stored in a vector database\nwith embeddings and category information.\nThis enables fast and relevant topic-based searches.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "7df4b572-0d45-4eac-ae5d-7b640c529408",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        608
      ],
      "parameters": {
        "color": 7,
        "width": 496,
        "height": 176,
        "content": "## Weekly Trigger & User Preferences\n\nOn a weekly basis, this workflow runs to prepare news emails.\nUser preferences include:\n\u2022 Area of interest (topics)\n\u2022 Number of news items\n\u2022 Email address"
      },
      "typeVersion": 1
    },
    {
      "id": "a79d0386-c3ab-406b-b739-b1094f5cab84",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        -608
      ],
      "parameters": {
        "width": 624,
        "height": 608,
        "content": "## How it works\n\nThis workflow sends weekly topic-based news emails using an AI agent.\nNews articles are first collected daily from multiple platforms via RSS feeds\nand stored in a vector database with category and embedding information.\n\nOn a weekly schedule, the workflow fetches relevant news from the vector store\nbased on user-defined interests and the number of articles required.\nThe selected news is then passed to an AI agent, which converts the raw data\ninto a clean, readable email format. Finally, the generated content is sent\nto the user via email.\n\nThe separation between daily ingestion and weekly delivery ensures\nefficient processing, better performance, and reusable news data.\n\n## Setup steps\n\n1. Add your RSS feed URLs in the RSS Feed nodes\n2. Configure vector database credentials\n3. Add your AI model credentials for the agent\n4. Configure email service credentials\n5. Adjust the weekly schedule if needed\n6. Customize the AI prompt or email format as required\n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Split Out": {
      "main": [
        [
          {
            "node": "Read RSS News Feeds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "News reader AI": {
      "main": [
        [
          {
            "node": "Convert Response to an Email-Friendly Format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Store News Articles",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Get News Articles": {
      "ai_tool": [
        [
          {
            "node": "News reader AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "News reader AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI2": {
      "ai_embedding": [
        [
          {
            "node": "Get News Articles",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Get Articles Daily": {
      "main": [
        [
          {
            "node": "Set Tech News RSS Feeds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Store News Articles",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Read RSS News Feeds": {
      "main": [
        [
          {
            "node": "Set and Normalize Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Weekly Summary": {
      "main": [
        [
          {
            "node": "Your topics of interest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Tech News RSS Feeds": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Your topics of interest": {
      "main": [
        [
          {
            "node": "News reader AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set and Normalize Fields": {
      "main": [
        [
          {
            "node": "Store News Articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Convert Response to an Email-Friendly Format": {
      "main": [
        [
          {
            "node": "Send Newsletter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}