{
  "name": "Build an AI-powered tech radar advisor with SQL DB, RAG, and routing agents",
  "nodes": [
    {
      "id": "7e0c4881-be31-4883-acbc-ceee87edfa38",
      "name": "Download Doc File From Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1220,
        420
      ]
    },
    {
      "id": "1cf5fb98-f00b-404f-a7cf-31905dfaedef",
      "name": "Doc File Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1640,
        580
      ]
    },
    {
      "id": "41206380-8854-4878-b870-035d9999b8f6",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        540,
        -20
      ],
      "parameters": {
        "width": 300,
        "height": 340,
        "content": "#1.Rag-friendly Document\n\nConvert Tech Radar Gsheet into GDoc. Read each rows and cols data then transformed it into simple paragraph rows so that it will be easy to convert into vector database.\n\n\nYo"
      }
    },
    {
      "id": "ae048c49-98a2-4bea-b74f-ee0be2433d65",
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "position": [
        2380,
        400
      ]
    },
    {
      "id": "9a072480-df59-4542-b8e7-659e7bbebef4",
      "name": "MySQL -delete all data",
      "type": "n8n-nodes-base.mySql",
      "position": [
        2480,
        580
      ]
    },
    {
      "id": "b8561634-b975-4a80-bf06-c2ae9e4bc570",
      "name": "MySQL - insert all from sheets",
      "type": "n8n-nodes-base.mySql",
      "position": [
        2820,
        400
      ]
    },
    {
      "id": "96805e63-09ab-4f2b-ac59-471f6660ebc8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -1040
      ],
      "parameters": {
        "width": 660,
        "height": 960,
        "content": " \n## Set up steps\n\n1. **Google Cloud Project and Vertex AI API**:\n   - Create a Google Cloud project.\n   - Enable the Vertex AI API for your project.\n\n2. **Google AI API Key**:\n   - Obtain a Google AI"
      }
    },
    {
      "id": "afdd7545-69cb-4d41-bb46-70e17ce49109",
      "name": "Google Sheets - Tech Radar",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        960,
        20
      ]
    },
    {
      "id": "cacab89b-dec7-4039-a990-f76eb341ffc6",
      "name": "Code - Transform table into rows",
      "type": "n8n-nodes-base.code",
      "position": [
        1280,
        20
      ]
    },
    {
      "id": "adbff4c1-83d0-472a-b4b8-83aca9e0d009",
      "name": "Google Docs - Update GDoc",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        1560,
        20
      ]
    },
    {
      "id": "9c26af22-7d29-4e69-964a-b0daf8564d48",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        540,
        420
      ],
      "parameters": {
        "width": 300,
        "height": null,
        "content": "#2. Convert Document into Vector database (RAG ingestion)\n\n\nListen for any file changes and update the vector database. The goal is that the llm agent can interact and retrieve information from it lat"
      }
    },
    {
      "id": "141feafb-66dd-4b9b-bbf3-0c24f67ba111",
      "name": "Google Drive - Doc File Updated",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        960,
        440
      ]
    },
    {
      "id": "bf93035c-3bc7-4843-b464-cec515b54876",
      "name": "Content - Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1740,
        760
      ]
    },
    {
      "id": "e3af8196-a012-423f-80c8-840a3912e289",
      "name": "Google Sheets - Read TechRadar",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2620,
        400
      ]
    },
    {
      "id": "6e6febbf-a546-4f28-9cad-0df2ea67e687",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2000,
        400
      ],
      "parameters": {
        "width": 300,
        "height": null,
        "content": "#3. Convert Gsheet into MYSQL database\n\nPeriodically sync data from gsheet tech radar into mysql database. The goal is so that the llm sql agent can interact with it for certain scenario."
      }
    },
    {
      "id": "d5586f7f-b092-4d61-bff4-8c067e19505b",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        540,
        -20
      ],
      "parameters": {
        "width": 2500,
        "height": 960,
        "content": " "
      }
    },
    {
      "id": "7c66ef98-75d5-4bde-ae30-e4b311f67363",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -120
      ],
      "parameters": {
        "width": 150,
        "height": 80,
        "content": "SETUP"
      }
    },
    {
      "id": "39cdcf03-5b67-4b09-817f-724f1ab47b52",
      "name": "Code - Simplify Mapping to Original Query",
      "type": "n8n-nodes-base.code",
      "position": [
        1440,
        1400
      ]
    },
    {
      "id": "3a1ea4a5-c4d6-4eb8-a495-4cd6e6c67a9e",
      "name": "Codes - Simplify Mapping to Original Query",
      "type": "n8n-nodes-base.code",
      "position": [
        1500,
        1680
      ]
    },
    {
      "id": "b9acb2d6-abcf-49b5-a49a-c4da8375ef65",
      "name": "Execute Workflow - Sql Agent",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        1720,
        1680
      ]
    },
    {
      "id": "17647af3-e1bf-4cc2-bee8-7ece27b41c3f",
      "name": "Execute Workflow - RAG Agent",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        1660,
        1400
      ]
    },
    {
      "id": "2d631741-f147-47ee-bd1a-b4821b1b22e7",
      "name": "AI Agent - Output Guardrail",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2260,
        1340
      ]
    },
    {
      "id": "66219f32-8845-4383-8817-834643d98fce",
      "name": "LLM - Determine - Agent Input Router",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        800,
        1460
      ]
    },
    {
      "id": "4cfd2adb-2495-4365-be6c-0dd2407e3bf3",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        1240
      ],
      "parameters": {
        "width": 840,
        "height": 980,
        "content": "## Chatting Stage :  CHAT ENDPOINT\n\n### Purpose\nThis endpoint api allows you to chat with the ai agent.\nThe ai agent input router will determine if the nature of question best answered with RAG or SQL"
      }
    },
    {
      "id": "ff93fe16-4130-499f-ab16-241ead85e938",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        1240
      ],
      "parameters": {
        "width": 2500,
        "height": 960,
        "content": " "
      }
    },
    {
      "id": "7c0bf004-b90f-4cde-9506-92fe7ad1f7d4",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        1140
      ],
      "parameters": {
        "width": 150,
        "height": 80,
        "content": "CHAT"
      }
    },
    {
      "id": "f12f5038-a669-4618-bd28-2c0419c1bd2a",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        0
      ],
      "parameters": {
        "width": 840,
        "height": 460,
        "content": "## Setup Stage :  Storing into vector and structured sql database\n\n### Purpose\nThis setup is important to ensure that the tech radar google sheets are stored and transformed into the mysql database so"
      }
    },
    {
      "id": "6ecfef1a-9ef1-4d3d-8aaf-b1795f6f8686",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -1180
      ],
      "parameters": {
        "width": 620,
        "height": 860,
        "content": "## Github frontend code\nhttps://github.com/dragonjump/techconstellation/tree/gh-pages\n\n\n## Example Demo\nhttps://raw.githubusercontent.com/dragonjump/techconstellation/refs/heads/gh-pages/build-your-ow"
      }
    },
    {
      "id": "757a397f-4ecc-49f1-9fc7-314ec05acc06",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        400,
        2960
      ]
    },
    {
      "id": "40a634be-1b64-4cb2-b5f1-32d7c94e1b51",
      "name": "1_Get DB Schema and Tables List",
      "type": "n8n-nodes-base.mySqlTool",
      "position": [
        1240,
        2840
      ]
    },
    {
      "id": "826a910f-be7a-46cd-a294-4d1754a96c7d",
      "name": "2_Get Table Definition",
      "type": "n8n-nodes-base.mySqlTool",
      "position": [
        1380,
        2840
      ]
    },
    {
      "id": "5e6ae6cb-2356-44de-b027-3e6a7f22e3ed",
      "name": "3_Execute actual query",
      "type": "n8n-nodes-base.mySqlTool",
      "position": [
        1520,
        2840
      ]
    },
    {
      "id": "8e2f455b-ad54-46a9-b66d-076cc7ade062",
      "name": "AI Agent -DB Sql Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1200,
        2500
      ]
    },
    {
      "id": "f8277e56-12df-41c4-aee1-a83482cdd2c5",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        520,
        2420
      ],
      "parameters": {
        "width": 1280,
        "height": 620,
        "content": " "
      }
    },
    {
      "id": "072e1d78-324a-4a2f-ab5a-b846d69d6380",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        2420
      ],
      "parameters": {
        "width": 540,
        "height": 440,
        "content": "## Subworkflow 1: DB SQL Agent\n\n1.Copy and paste into another workflow.\n2. Activate it.\n3. Link it back"
      }
    },
    {
      "id": "31ec5244-f656-4158-925a-f23d8dfd5576",
      "name": "Pinecone Vector Store (Retrieval)",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        940,
        3540
      ]
    },
    {
      "id": "0180c054-84ee-4e9b-98f9-1175d90b5e65",
      "name": "4_RagTool",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        1020,
        3400
      ]
    },
    {
      "id": "15c402f2-14e9-484f-bbde-d55af176f022",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        3180
      ],
      "parameters": {
        "width": 540,
        "height": 440,
        "content": "## Subworkflow 2: RAG Agent\n\n1.Copy and paste into another workflow.\n2. Activate it.\n3. Link it back"
      }
    },
    {
      "id": "2c59bfaa-5e95-430f-a7bf-1beb55636a5c",
      "name": "AI Agent - RAG",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        860,
        3200
      ]
    },
    {
      "id": "d2f15140-7707-4be1-ad7a-e8303f5a751a",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        540,
        3180
      ],
      "parameters": {
        "width": 1280,
        "height": 620,
        "content": " "
      }
    },
    {
      "id": "2deefcf5-1331-4e58-8e2c-37632d5d1005",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1220,
        -1180
      ],
      "parameters": {
        "width": 1340,
        "height": 860,
        "content": " \n![Tech Constellation](https://raw.githubusercontent.com/dragonjump/techconstellation/refs/heads/gh-pages/build-your-own-radar-master/src/images/image.png)\n\n\n \n"
      }
    },
    {
      "id": "d2536986-8946-4139-8b5e-e18a1b4e4d13",
      "name": "Embeddings - Tech Radar Data Embedding",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        1400,
        700
      ]
    },
    {
      "id": "1f3bef6f-42f0-4460-a9c3-b4f45ae9f745",
      "name": "Pinecone - Vector Store for Embedding Content",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        1440,
        420
      ]
    },
    {
      "id": "3a79979a-efb0-4518-9a9e-4a965f30b9fc",
      "name": "Retrieve Embeddings - Tech Radar Vector DB",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        940,
        3660
      ]
    },
    {
      "id": "647cfe62-a444-4f45-9bd2-1f2f604ef981",
      "name": "AI Agent - Retrieval",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1280,
        3600
      ]
    },
    {
      "id": "203c8e85-9a91-493c-8b66-996b6822be76",
      "name": "AI Chat Model - Claude 3.5 Sonnet",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        1040,
        2760
      ]
    },
    {
      "id": "0eb6995f-2b5b-49a2-899d-6204b6bfbb0a",
      "name": "AI Chat Model - QwQ 32b",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        800,
        3420
      ]
    },
    {
      "id": "7334036c-ce1c-4ef9-a9ae-6e88233c04a0",
      "name": "AI Chatmodel - Deepseek 32B",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        800,
        1680
      ]
    },
    {
      "id": "a94cf20d-3442-484f-9c6b-218fcd5564aa",
      "name": "AI Chat Model - llama3-8b",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        2180,
        1580
      ]
    },
    {
      "id": "ebe74988-4444-468a-8724-754f2e476374",
      "name": "API Response - Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        2600,
        1380
      ]
    },
    {
      "id": "4abf261b-25bb-4438-a419-1e0c32c2f449",
      "name": "API Request - Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        560,
        1440
      ]
    },
    {
      "id": "ddbca666-d216-4e37-be8c-ff0bccf55d9f",
      "name": "Determine if  is 'RAG'",
      "type": "n8n-nodes-base.if",
      "position": [
        1120,
        1460
      ]
    },
    {
      "id": "ff6be5b4-37da-47d9-8ea0-fdba6dc9359a",
      "name": "User Conversation history",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2400,
        1640
      ]
    }
  ],
  "connections": {
    "Cron": {
      "main": [
        [
          {
            "node": "MySQL -delete all data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4_RagTool": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - RAG",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent - Retrieval": {
      "ai_languageModel": [
        [
          {
            "node": "4_RagTool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Doc File Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone - Vector Store for Embedding Content",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "API Request - Webhook": {
      "main": [
        [
          {
            "node": "LLM - Determine - Agent Input Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2_Get Table Definition": {
      "ai_tool": [
        [
          {
            "node": "AI Agent -DB Sql Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "3_Execute actual query": {
      "ai_tool": [
        [
          {
            "node": "AI Agent -DB Sql Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Determine if  is 'RAG'": {
      "main": [
        [
          {
            "node": "Code - Simplify Mapping to Original Query",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Codes - Simplify Mapping to Original Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MySQL -delete all data": {
      "main": [
        [
          {
            "node": "Google Sheets - Read TechRadar",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Chat Model - QwQ 32b": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent - RAG",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Chat Model - llama3-8b": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent - Output Guardrail",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "User Conversation history": {
      "ai_memory": [
        [
          {
            "node": "AI Agent - Output Guardrail",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets - Tech Radar": {
      "main": [
        [
          {
            "node": "Code - Transform table into rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent - Output Guardrail": {
      "main": [
        [
          {
            "node": "API Response - Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Chatmodel - Deepseek 32B": {
      "ai_languageModel": [
        [
          {
            "node": "LLM - Determine - Agent Input Router",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Execute Workflow - RAG Agent": {
      "main": [
        [
          {
            "node": "AI Agent - Output Guardrail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Workflow - Sql Agent": {
      "main": [
        [
          {
            "node": "AI Agent - Output Guardrail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets - Read TechRadar": {
      "main": [
        [
          {
            "node": "MySQL - insert all from sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1_Get DB Schema and Tables List": {
      "ai_tool": [
        [
          {
            "node": "AI Agent -DB Sql Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive - Doc File Updated": {
      "main": [
        [
          {
            "node": "Download Doc File From Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - Transform table into rows": {
      "main": [
        [
          {
            "node": "Google Docs - Update GDoc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Chat Model - Claude 3.5 Sonnet": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent -DB Sql Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store (Retrieval)": {
      "ai_vectorStore": [
        [
          {
            "node": "4_RagTool",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "AI Agent -DB Sql Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Doc File From Google Drive": {
      "main": [
        [
          {
            "node": "Pinecone - Vector Store for Embedding Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM - Determine - Agent Input Router": {
      "main": [
        [
          {
            "node": "Determine if  is 'RAG'",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings - Tech Radar Data Embedding": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone - Vector Store for Embedding Content",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Code - Simplify Mapping to Original Query": {
      "main": [
        [
          {
            "node": "Execute Workflow - RAG Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Codes - Simplify Mapping to Original Query": {
      "main": [
        [
          {
            "node": "Execute Workflow - Sql Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Embeddings - Tech Radar Vector DB": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store (Retrieval)",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Content - Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Doc File Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}