{
  "id": "FoooqLnoNApWemAG",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "GraphRAG with Neo4j | Second cerveau \u00e0 partir d'une cha\u00eene youtube",
  "tags": [],
  "nodes": [
    {
      "id": "1111e006-bac2-4015-b1f5-229bab094434",
      "name": "4.1 mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1440,
        640
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8435fa26-e11a-482b-b3eb-c3e662739fc4",
      "name": "Cat\u00e9gorie d\u00e9finition Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1136,
        208
      ],
      "parameters": {
        "text": "=Titre : {{ $json.title }}\nDescription : {{ $json.text || $json.translatedText }}\nTranscrit : {{ $json.subtitles[0].plaintext }}",
        "options": {
          "systemMessage": "Tu es un extracteur d'entit\u00e9s pour des vid\u00e9os YouTube francophones sur le business, l'entrepreneuriat et la tech.\n\nAnalyse le titre, la description et le transcript de la vid\u00e9o et extrais :\n\n1. **topics** : Sujets/th\u00e9matiques abord\u00e9s (ex: entrepreneuriat, investissement, productivit\u00e9, marketing digital)\n\n2. **tools** : Outils, logiciels, plateformes, services mentionn\u00e9s (ex: n8n, chat gpt, notion, stripe, shopify, tiktok)\n\n3. **concepts** : Concepts, m\u00e9thodes, strat\u00e9gies, mod\u00e8les business expliqu\u00e9s (ex: dropshipping, copywriting, funnel de vente, personal branding)\n\nR\u00c8GLES :\n- Extrais uniquement ce qui est EXPLICITEMENT mentionn\u00e9\n- Normalise en lowercase\n- Pas de doublons\n- Maximum 15 items par cat\u00e9gorie\n- Priorise les \u00e9l\u00e9ments les plus importants/r\u00e9currents\n\nR\u00c9PONDS UNIQUEMENT en JSON valide, sans markdown, sans commentaires :\n{\"topics\":[],\"tools\":[],\"concepts\":[]}"
        },
        "promptType": "define",
        "needsFallback": true,
        "hasOutputParser": true
      },
      "typeVersion": 3
    },
    {
      "id": "75532cab-739f-41af-bf1f-0a596a332b3b",
      "name": "4o mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1104,
        432
      ],
      "parameters": {
        "model": "openai/gpt-4o-mini",
        "options": {
          "temperature": 0.1
        }
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "09bb672b-a246-43a3-9deb-a409c7b84bf0",
      "name": "sonnet 3.5",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1232,
        432
      ],
      "parameters": {
        "model": "anthropic/claude-3.5-sonnet",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bf0d5e00-3dd3-4b27-b3fa-cc655bcbc57f",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        880,
        336
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "cf8baa79-e04f-4a73-bdd9-c416b9469ec6",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.title }}",
              "rightValue": ""
            },
            {
              "id": "961b4941-52f0-45fa-be53-ccdd2bccddd8",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.text || $json.translatedText }}",
              "rightValue": ""
            },
            {
              "id": "07dae331-c7f0-4442-b81a-53534be89cfd",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.subtitles[0].plaintext }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "201648c3-67aa-45e2-8156-264b7becc008",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2272,
        288
      ],
      "parameters": {
        "options": {
          "systemMessage": "Tu es un assistant expert sur le contenu d'une cha\u00eene YouTube sur le business et l'entrepreneuriat.\n\nTu as acc\u00e8s \u00e0 une base de donn\u00e9es Neo4j contenant toutes les vid\u00e9os de la cha\u00eene avec leurs sujets, outils et concepts.\n\nSCHEMA DU GRAPH :\n- (Video) : videoId, title, url, publishedAt, viewCount, duration, channelName\n- (Topic) : name (sujets abord\u00e9s)\n- (Tool) : name (outils mentionn\u00e9s)\n- (Concept) : name (concepts expliqu\u00e9s)\n\nRELATIONS :\n- (Video)-[:COVERS]->(Topic)\n- (Video)-[:USES]->(Tool)\n- (Video)-[:EXPLAINS]->(Concept)\n\nCOMMENT UTILISER LE TOOL NEO4J :\nQuand l'utilisateur pose une question sur les vid\u00e9os, utilise le tool \"neo4j_query\" avec un body JSON contenant ta query Cypher.\n\nFORMAT DU BODY :\n{\n  \"statement\": \"TA_QUERY_CYPHER_ICI\"\n}\n\nEXEMPLES DE QUERIES :\n\n1. Chercher des vid\u00e9os par sujet :\n{\"statement\": \"MATCH (v:Video)-[:COVERS]->(t:Topic) WHERE toLower(t.name) CONTAINS 'dropshipping' RETURN v.title AS title, v.url AS url LIMIT 10\"}\n\n2. Chercher des vid\u00e9os par outil :\n{\"statement\": \"MATCH (v:Video)-[:USES]->(tool:Tool) WHERE toLower(tool.name) CONTAINS 'chatgpt' RETURN v.title AS title, v.url AS url LIMIT 10\"}\n\n3. Top outils les plus mentionn\u00e9s :\n{\"statement\": \"MATCH (v:Video)-[:USES]->(tool:Tool) RETURN tool.name AS tool, count(v) AS mentions ORDER BY mentions DESC LIMIT 10\"}\n\n4. Top concepts expliqu\u00e9s :\n{\"statement\": \"MATCH (v:Video)-[:EXPLAINS]->(c:Concept) RETURN c.name AS concept, count(v) AS mentions ORDER BY mentions DESC LIMIT 10\"}\n\n5. Vid\u00e9os avec plusieurs crit\u00e8res (AND) :\n{\"statement\": \"MATCH (v:Video)-[:COVERS]->(t:Topic), (v)-[:USES]->(tool:Tool) WHERE toLower(t.name) CONTAINS 'ecommerce' AND toLower(tool.name) CONTAINS 'shopify' RETURN v.title AS title, v.url AS url LIMIT 10\"}\n\n6. Toutes les vid\u00e9os :\n{\"statement\": \"MATCH (v:Video) RETURN v.title AS title, v.url AS url, v.viewCount AS views ORDER BY v.viewCount DESC LIMIT 10\"}\n\n7. Lister tous les topics/tools/concepts :\n{\"statement\": \"MATCH (t:Topic) RETURN DISTINCT t.name AS topic\"}\n\nR\u00c8GLES :\n- Utilise TOUJOURS toLower() et CONTAINS pour les recherches texte (g\u00e8re les variations)\n- Limite toujours \u00e0 10 r\u00e9sultats sauf si l'utilisateur demande plus\n- Retourne TOUJOURS title et url pour les vid\u00e9os\n- R\u00e9ponds en fran\u00e7ais de mani\u00e8re naturelle et concise\n- Formate les liens en markdown : [Titre de la vid\u00e9o](url)\n- Si aucun r\u00e9sultat, sugg\u00e8re des termes de recherche alternatifs"
        },
        "needsFallback": true
      },
      "typeVersion": 3
    },
    {
      "id": "94b2f1c2-fe48-4a62-b3d1-01c501b16d72",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        2096,
        288
      ],
      "parameters": {
        "options": {
          "responseMode": "responseNodes"
        }
      },
      "typeVersion": 1.4
    },
    {
      "id": "4ee455ee-8c76-46a6-9af9-57e52bb64efe",
      "name": "4o",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2208,
        480
      ],
      "parameters": {
        "model": "openai/chatgpt-4o-latest",
        "options": {
          "temperature": 0.1
        }
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b4d72802-f7c9-4774-a517-20dad5d7cb1b",
      "name": "sonnet 4.5",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2320,
        480
      ],
      "parameters": {
        "model": "anthropic/claude-sonnet-4.5",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f9bb0cb6-d2d4-40eb-b5e0-cb7ecdf241ee",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2448,
        480
      ],
      "parameters": {
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "ac46630f-88d6-4189-958a-0cdec6005d00",
      "name": "Respond to Chat",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        2624,
        288
      ],
      "parameters": {
        "message": "={{ $json.output }}",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "ceff4090-08f5-4824-9b22-b14200c6ad95",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -112
      ],
      "parameters": {
        "color": 5,
        "width": 2992,
        "height": 880,
        "content": "## \ud83d\udce5 Video Ingestion\n\nScrapes YouTube videos via Apify, extracts entities with GPT-4o-mini, and stores everything in Neo4j."
      },
      "typeVersion": 1
    },
    {
      "id": "c9e42c1b-722b-496a-b40d-151aa97cd83e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2000,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 848,
        "height": 496,
        "content": "## 5. \ud83e\udd16 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."
      },
      "typeVersion": 1
    },
    {
      "id": "e42f4902-7feb-4d04-a1ac-c0ed9d9f3599",
      "name": "neo4j_query",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        2640,
        464
      ],
      "parameters": {
        "url": "https://4b095dfe.databases.neo4j.io/db/neo4j/query/v2",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('JSON', ``, 'json') }}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "toolDescription": "Ex\u00e9cute une query Cypher sur la base Neo4j pour chercher des vid\u00e9os, topics, tools ou concepts",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "Application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "f472eb4e-ac35-49e0-8bed-259dc3620c0a",
      "name": "Parseur",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1360,
        432
      ],
      "parameters": {
        "autoFix": true,
        "jsonSchemaExample": "{\n  \"topics\": [\"business\", \"entrepreneuriat\", \"d\u00e9butants\", \"2026\", \"revenus\"],\n  \"tools\": [\"chat gpt\", \"n8n\", \"hostinger\", \"tiktok shop\", \"google maps\"],\n  \"concepts\": [\"dropshipping\", \"freelance\", \"ugc\", \"automatisation\", \"coaching\", \"saas\", \"e-commerce\", \"closer\", \"drop servicing\"]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "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 **concepts** automatically extracted by an LLM. The agent generates Cypher queries to answer questions about the channel's content.\n\n### Setup steps\n1. Create a Neo4j Aura instance (free tier) and save the credentials\n2. Configure HTTP Header Auth credential with `Authorization: Basic [base64]`\n3. Run the ingestion workflow to populate the database with your videos\n4. Test the agent via the built-in chat\n\n### Customization\n- Modify the system prompt to adapt the response tone\n- Add additional relations (e.g., RELATED_TO between topics)\n- Connect to other sources (Notion, blog posts, etc.)\n- Modify the form input for more control over video filtering"
      },
      "typeVersion": 1
    },
    {
      "id": "47cc9de7-b485-4ee9-a0df-8e1f693c74e3",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1696,
        256
      ],
      "parameters": {
        "color": 3,
        "width": 256,
        "height": 352,
        "content": "##  \u26a0\ufe0f 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/)"
      },
      "typeVersion": 1
    },
    {
      "id": "4fb6e349-751d-43e7-9199-877b4ea8c131",
      "name": "Vers Neo4j",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        1760,
        432
      ],
      "parameters": {
        "url": "https://4b095dfe.databases.neo4j.io/db/neo4j/query/v2",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"statement\": \"MERGE (v:Video {videoId: $videoId}) SET v.title = $title, v.url = $url, v.publishedAt = $publishedAt, v.viewCount = $viewCount, v.duration = $duration, v.channelName = $channelName WITH v UNWIND $topics AS topicName MERGE (t:Topic {name: topicName}) MERGE (v)-[:COVERS]->(t) WITH v UNWIND $tools AS toolName MERGE (tool:Tool {name: toolName}) MERGE (v)-[:USES]->(tool) WITH v UNWIND $concepts AS conceptName MERGE (c:Concept {name: conceptName}) MERGE (v)-[:EXPLAINS]->(c)\",\n  \"parameters\": {\n    \"videoId\": \"{{ $('Scraping of each URLs').item.json.id }}\",\n    \"title\": \"{{ $('Scraping of each URLs').item.json.title }}\",\n    \"url\": \"{{ $('Scraping of each URLs').item.json.url }}\",\n    \"publishedAt\": \"{{ $('Scraping of each URLs').item.json.date }}\",\n    \"viewCount\": {{ $('Scraping of each URLs').item.json.viewCount }},\n    \"duration\": \"{{ $('Scraping of each URLs').item.json.duration }}\",\n    \"channelName\": \"{{ $('Scraping of each URLs').item.json.channelName }}\",\n    \"topics\": {{ JSON.stringify($json.output.topics) }},\n    \"tools\": {{ JSON.stringify($json.output.tools) }},\n    \"concepts\": {{ JSON.stringify($json.output.concepts) }}\n  }\n}\n\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "7b9fea92-c4e7-4794-bc59-a6ff9b75fb30",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        192
      ],
      "parameters": {
        "color": 7,
        "width": 1104,
        "height": 304,
        "content": "## 1. Scrape Channel & Video URLs\n\nFetches the YouTube channel and retrieves all video URLs using Apify YouTube Scraper."
      },
      "typeVersion": 1
    },
    {
      "id": "e1c58b5f-5e13-44c0-a313-91217efdce4c",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        80
      ],
      "parameters": {
        "color": 7,
        "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."
      },
      "typeVersion": 1
    },
    {
      "id": "7ef94294-6a37-439d-bbe1-fe687437a945",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1664,
        64
      ],
      "parameters": {
        "color": 7,
        "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."
      },
      "typeVersion": 1
    },
    {
      "id": "06fc6d3d-7c69-4100-8683-28f7ff6d104b",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        -48
      ],
      "parameters": {
        "color": 7,
        "width": 310,
        "height": 224,
        "content": "## 4. Show completion screen\n"
      },
      "typeVersion": 1
    },
    {
      "id": "69837a64-3442-4832-ac5f-4f725f38e180",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2864,
        -112
      ],
      "parameters": {
        "color": 2,
        "width": 752,
        "height": 880,
        "content": "## \ud83d\udcca 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 & explains\n\n**2. Auto-Generated Dashboards**\n- Top tools & topics visualizations\n- Content relationship network\n- Tool co-occurrence analysis\n\n**3. Conversational AI Agent**\n- Ask natural language questions about the channel\n- Get video recommendations with direct links\n- Discover content patterns and insights\n\n![Dashboard Preview](https://bdcahdjartshknrvdnxq.supabase.co/storage/v1/object/public/gpt-images/neo4j_dash_1.png)\n![Dashboard Preview](https://bdcahdjartshknrvdnxq.supabase.co/storage/v1/object/public/gpt-images/neo4j-dash-2.png)"
      },
      "typeVersion": 1
    },
    {
      "id": "d6212140-79d4-40b4-a4d9-a6ee728ccb04",
      "name": "Wich creator ? How many videos ?",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -16,
        320
      ],
      "parameters": {
        "options": {},
        "formTitle": "Quel youtubeur veux tu cloner ?",
        "formFields": {
          "values": [
            {
              "fieldLabel": "URL",
              "requiredField": true
            },
            {
              "fieldType": "number",
              "fieldLabel": "Nombre de vid\u00e9os \u00e0 r\u00e9cup\u00e9rer ? ",
              "placeholder": "1000",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Input l'URL de sa cha\u00eene YouTube ci dessous."
      },
      "typeVersion": 2.3
    },
    {
      "id": "e7691955-2df5-43d0-a1c4-550869c8dca1",
      "name": "Get channel videos URLs",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        208,
        320
      ],
      "parameters": {
        "actorId": {
          "__rl": true,
          "mode": "list",
          "value": "h7sDV53CddomktSi5",
          "cachedResultUrl": "https://console.apify.com/actors/h7sDV53CddomktSi5/input",
          "cachedResultName": "YouTube Scraper (streamers/youtube-scraper)"
        },
        "timeout": {},
        "operation": "Run actor and get dataset",
        "customBody": "={\n  \"dateFilter\": \"year\",\n  \"downloadSubtitles\": true,\n  \"hasCC\": false,\n  \"hasLocation\": false,\n  \"hasSubtitles\": false,\n  \"is360\": false,\n  \"is3D\": false,\n  \"is4K\": false,\n  \"isBought\": false,\n  \"isHD\": false,\n  \"isHDR\": false,\n  \"isLive\": false,\n  \"isVR180\": false,\n  \"maxResultStreams\": 0,\n  \"maxResults\": {{ $json['Nombre de vid\u00e9os \u00e0 r\u00e9cup\u00e9rer ? '] }},\n  \"maxResultsShorts\": 0,\n  \"preferAutoGeneratedSubtitles\": true,\n  \"saveSubsToKVS\": false,\n  \"sortingOrder\": \"views\",\n  \"startUrls\": [\n    {\n      \"url\": \"{{ $json.URL }}\"\n    }\n  ],\n  \"subtitlesFormat\": \"plaintext\",\n  \"subtitlesLanguage\": \"fr\",\n  \"videoType\": \"video\"\n}"
      },
      "credentials": {
        "apifyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b97a69a7-7d9e-4ea4-bbb0-3605ce2e9dcb",
      "name": "Scraping of each URLs",
      "type": "@apify/n8n-nodes-apify.apify",
      "onError": "continueRegularOutput",
      "position": [
        656,
        336
      ],
      "parameters": {
        "memory": 8192,
        "actorId": {
          "__rl": true,
          "mode": "list",
          "value": "h7sDV53CddomktSi5",
          "cachedResultUrl": "https://console.apify.com/actors/h7sDV53CddomktSi5/input",
          "cachedResultName": "YouTube Scraper (streamers/youtube-scraper)"
        },
        "timeout": {},
        "operation": "Run actor and get dataset",
        "customBody": "={\n    \"dateFilter\": \"year\",\n    \"downloadSubtitles\": true,\n    \"hasCC\": false,\n    \"hasLocation\": false,\n    \"hasSubtitles\": false,\n    \"is360\": false,\n    \"is3D\": false,\n    \"is4K\": false,\n    \"isBought\": false,\n    \"isHD\": false,\n    \"isHDR\": false,\n    \"isLive\": false,\n    \"isVR180\": false,\n    \"maxResultStreams\": 0,\n    \"maxResults\": 10,\n    \"maxResultsShorts\": 0,\n    \"preferAutoGeneratedSubtitles\": true,\n    \"saveSubsToKVS\": false,\n    \"sortingOrder\": \"views\",\n    \"startUrls\": [\n        {\n            \"url\": \"{{ $json.url }}\"\n        }\n    ],\n    \"subtitlesFormat\": \"plaintext\",\n    \"subtitlesLanguage\": \"fr\",\n    \"videoType\": \"video\"\n}"
      },
      "credentials": {
        "apifyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ee329995-ec5b-4f1f-a145-6ac9c9824e72",
      "name": "Results",
      "type": "n8n-nodes-base.form",
      "position": [
        848,
        16
      ],
      "parameters": {
        "options": {},
        "operation": "completion",
        "completionTitle": "=Votre deuxi\u00e8me cerveau bas\u00e9 sur {{ $json.channelName }} \u00e0 \u00e9t\u00e9 cr\u00e9\u00e9 avec succ\u00e8s !",
        "completionMessage": "Tu peux maintenant discuter avec un Agent IA entrain\u00e9 sur le data de sa cha\u00eene Youtube."
      },
      "typeVersion": 2.3
    },
    {
      "id": "1b6b06fe-ee7c-482b-a537-8f2b5fde01a0",
      "name": "loop each video",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        432,
        320
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "455e33ec-d4ed-4230-89e5-430902902d01",
  "connections": {
    "4o": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Cat\u00e9gorie d\u00e9finition Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "loop each video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4o mini": {
      "ai_languageModel": [
        [
          {
            "node": "Cat\u00e9gorie d\u00e9finition Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Parseur": {
      "ai_outputParser": [
        [
          {
            "node": "Cat\u00e9gorie d\u00e9finition 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\u00e9gorie d\u00e9finition 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\u00e9gorie d\u00e9finition Agent": {
      "main": [
        [
          {
            "node": "Vers Neo4j",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wich creator ? How many videos ?": {
      "main": [
        [
          {
            "node": "Get channel videos URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}