{
  "name": "Turn a YouTube channel into a second brain with Neo4j GraphRAG and GPT-4o-mini",
  "nodes": [
    {
      "id": "1111e006-bac2-4015-b1f5-229bab094434",
      "name": "4.1 mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1440,
        640
      ]
    },
    {
      "id": "8435fa26-e11a-482b-b3eb-c3e662739fc4",
      "name": "Catégorie définition Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1136,
        208
      ]
    },
    {
      "id": "75532cab-739f-41af-bf1f-0a596a332b3b",
      "name": "4o mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1104,
        432
      ]
    },
    {
      "id": "09bb672b-a246-43a3-9deb-a409c7b84bf0",
      "name": "sonnet 3.5",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1232,
        432
      ]
    },
    {
      "id": "bf0d5e00-3dd3-4b27-b3fa-cc655bcbc57f",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        880,
        336
      ]
    },
    {
      "id": "201648c3-67aa-45e2-8156-264b7becc008",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2272,
        288
      ]
    },
    {
      "id": "94b2f1c2-fe48-4a62-b3d1-01c501b16d72",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        2096,
        288
      ]
    },
    {
      "id": "4ee455ee-8c76-46a6-9af9-57e52bb64efe",
      "name": "4o",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2208,
        480
      ]
    },
    {
      "id": "b4d72802-f7c9-4774-a517-20dad5d7cb1b",
      "name": "sonnet 4.5",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2320,
        480
      ]
    },
    {
      "id": "f9bb0cb6-d2d4-40eb-b5e0-cb7ecdf241ee",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2448,
        480
      ]
    },
    {
      "id": "ac46630f-88d6-4189-958a-0cdec6005d00",
      "name": "Respond to Chat",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        2624,
        288
      ]
    },
    {
      "id": "ceff4090-08f5-4824-9b22-b14200c6ad95",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -112
      ],
      "parameters": {
        "width": 2992,
        "height": 880,
        "content": "## 📥 Video Ingestion\n\nScrapes YouTube videos via Apify, extracts entities with GPT-4o-mini, and stores everything in Neo4j."
      }
    },
    {
      "id": "c9e42c1b-722b-496a-b40d-151aa97cd83e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2000,
        144
      ],
      "parameters": {
        "width": 848,
        "height": 496,
        "content": "## 5. 🤖 Ask the Database for relation with LLM augmented analysis\n\nReceives user questions, generates Cypher queries via the Neo4j tool, and returns a natural response with relevant videos."
      }
    },
    {
      "id": "e42f4902-7feb-4d04-a1ac-c0ed9d9f3599",
      "name": "neo4j_query",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        2640,
        464
      ]
    },
    {
      "id": "f472eb4e-ac35-49e0-8bed-259dc3620c0a",
      "name": "Parseur",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1360,
        432
      ]
    },
    {
      "id": "8996cff2-eea2-4377-be43-826f6d8a5532",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        -112
      ],
      "parameters": {
        "width": 720,
        "height": 880,
        "content": "# GraphRAG with Neo4j | Second Brain YouTube\n\n### How it works\nThis AI agent queries a Neo4j database containing all videos from a YouTube channel. Videos are enriched with **topics**, **tools** and *"
      }
    },
    {
      "id": "47cc9de7-b485-4ee9-a0df-8e1f693c74e3",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1696,
        256
      ],
      "parameters": {
        "width": 256,
        "height": 352,
        "content": "##  ⚠️ Credentials\nMake sure you converted your username:password combination into a Base64 string. \n\nYou can use this site : [Base64 Encode](https://www.base64encode.org/)"
      }
    },
    {
      "id": "4fb6e349-751d-43e7-9199-877b4ea8c131",
      "name": "Vers Neo4j",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1760,
        432
      ]
    },
    {
      "id": "7b9fea92-c4e7-4794-bc59-a6ff9b75fb30",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        192
      ],
      "parameters": {
        "width": 1104,
        "height": 304,
        "content": "## 1. Scrape Channel & Video URLs\n\nFetches the YouTube channel and retrieves all video URLs using Apify YouTube Scraper."
      }
    },
    {
      "id": "e1c58b5f-5e13-44c0-a313-91217efdce4c",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        80
      ],
      "parameters": {
        "width": 592,
        "height": 672,
        "content": "## 2. Extract Concepts, Tools, Topics\n\nLLM analyzes title, description & transcript to extract structured entities (Topics, Tools, Concepts) as JSON."
      }
    },
    {
      "id": "7ef94294-6a37-439d-bbe1-fe687437a945",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1664,
        64
      ],
      "parameters": {
        "width": 320,
        "height": 576,
        "content": "## 3. Input into Neo4j database\n\nSends extracted data to Neo4j, creating Video nodes and relationships to Topics, Tools, and Concepts."
      }
    },
    {
      "id": "06fc6d3d-7c69-4100-8683-28f7ff6d104b",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        -48
      ],
      "parameters": {
        "width": 310,
        "height": 224,
        "content": "## 4. Show completion screen\n"
      }
    },
    {
      "id": "69837a64-3442-4832-ac5f-4f725f38e180",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2864,
        -112
      ],
      "parameters": {
        "width": 752,
        "height": 880,
        "content": "## 📊 Output - Neo4j Dashboard & AI Chat\n\nThis workflow produces:\n\n**1. Knowledge Graph Database**\n- Videos, Topics, Tools & Concepts as nodes\n- Relationships showing what each video covers, uses & exp"
      }
    },
    {
      "id": "d6212140-79d4-40b4-a4d9-a6ee728ccb04",
      "name": "Wich creator ? How many videos ?",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -16,
        320
      ]
    },
    {
      "id": "e7691955-2df5-43d0-a1c4-550869c8dca1",
      "name": "Get channel videos URLs",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        208,
        320
      ]
    },
    {
      "id": "b97a69a7-7d9e-4ea4-bbb0-3605ce2e9dcb",
      "name": "Scraping of each URLs",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        656,
        336
      ]
    },
    {
      "id": "ee329995-ec5b-4f1f-a145-6ac9c9824e72",
      "name": "Results",
      "type": "n8n-nodes-base.form",
      "position": [
        848,
        16
      ]
    },
    {
      "id": "1b6b06fe-ee7c-482b-a537-8f2b5fde01a0",
      "name": "loop each video",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        432,
        320
      ]
    }
  ],
  "connections": {
    "4o": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Catégorie définition Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "loop each video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4o mini": {
      "ai_languageModel": [
        [
          {
            "node": "Catégorie définition Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Parseur": {
      "ai_outputParser": [
        [
          {
            "node": "Catégorie définition Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "4.1 mini": {
      "ai_languageModel": [
        [
          {
            "node": "Parseur",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Respond to Chat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Vers Neo4j": {
      "main": [
        [
          {
            "node": "loop each video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "loop each video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "sonnet 3.5": {
      "ai_languageModel": [
        [
          {
            "node": "Catégorie définition Agent",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "sonnet 4.5": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "neo4j_query": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "loop each video": {
      "main": [
        [
          {
            "node": "Results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Scraping of each URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scraping of each URLs": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get channel videos URLs": {
      "main": [
        [
          {
            "node": "loop each video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Catégorie définition Agent": {
      "main": [
        [
          {
            "node": "Vers Neo4j",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wich creator ? How many videos ?": {
      "main": [
        [
          {
            "node": "Get channel videos URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}