{
  "id": "3OTLqzi7Bv6FqOrY",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Build a Multi-Agent system with n8n, Qdrant, Gmail & OpenAI",
  "tags": [],
  "nodes": [
    {
      "id": "ceda63e4-b700-4f20-89dc-7be123bcfcc8",
      "name": "Search Documents",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        608,
        -112
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "topK": 10,
        "options": {},
        "toolDescription": "This tool searches the document knowledge base. Use it to retrieve specific information, facts, quotes, or details that are stored in the uploaded documents. This tool retrieves relevant content when answering questions that require specific facts or details from uploaded documents. The information is retrieved based on semantic similarity to your query.",
        "qdrantCollection": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-rag",
          "cachedResultName": "n8n-rag"
        }
      },
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "570f5347-5b79-436b-87d4-3c1e7e95487b",
      "name": "Summarize Document",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        896,
        -112
      ],
      "parameters": {
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $workflow.id }}",
          "cachedResultName": "={{ $workflow.id }}"
        },
        "workflowInputs": {
          "value": {
            "file_id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('file_id', ``, 'string') }}",
            "chatInput": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('chatInput', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "chatInput",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "chatInput",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "file_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "file_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "sessionId ",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "sessionId ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e6ac42a9-d6de-47e6-8478-7c8b4523f111",
      "name": "Receive Summary Request",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        384,
        336
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "chatInput"
            },
            {
              "name": "file_id"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "b1a0c49c-081f-489b-ae3a-dea05045df10",
      "name": "Get Document",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        560,
        336
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.file_id }}"
        },
        "options": {
          "googleFileConversion": {
            "conversion": {}
          }
        },
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "26c74942-23d0-4690-bc24-a69e82f5979b",
      "name": "Extract Content",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        720,
        336
      ],
      "parameters": {
        "options": {},
        "operation": "text"
      },
      "typeVersion": 1
    },
    {
      "id": "bf123b22-21ee-4400-a991-022f94675f6b",
      "name": "Convert to Markdown",
      "type": "n8n-nodes-base.markdown",
      "position": [
        880,
        336
      ],
      "parameters": {
        "html": "={{ $json.data }}",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "25c8670b-a2ce-475b-aeb4-bda16025d802",
      "name": "Process Request",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1040,
        336
      ],
      "parameters": {
        "text": "={{ $json.data }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "You are an expert summarizer. Summarize the provided document(s) (from a vector database), focusing on key points relevant to the user's query. "
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "98153925-0a47-4487-84de-f8b1e7c79be2",
      "name": "Generate Summary",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1040,
        496
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "79a30d32-8217-491b-b0b6-1f51e2c6ca64",
      "name": "Format Summary Output",
      "type": "n8n-nodes-base.set",
      "position": [
        1328,
        336
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "33bf9d4b-dc38-4e9f-b575-b0026983a39f",
              "name": "summary",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1254d824-109e-4b80-b57c-68dcea51cfa8",
      "name": "Generate Embeddings",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        608,
        32
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e5d513bc-0555-497b-9dec-2f5e1b46e754",
      "name": "RAG sub-agent",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        640,
        -272
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "=You are a helpful AI assistant with access to a document knowledge base. Your primary role is to answer user questions based strictly on the information found in the documents.\n\nCRITICAL: You MUST use the document search tool for ANY question that could be answered from documents, even if you think you know the answer from your training data.\n\nGuidelines:\n- ALWAYS search the document knowledge base first before answering questions\n- Even if a question seems general, check the documents first - they may contain specific information\n- Base your answers ONLY on information retrieved from the documents\n- If the documents contain relevant information, use it and ALWAYS CITE the source with a link\n- If you cannot find the answer in the documents after searching, clearly state: \"I searched the available documents but could not find this specific information\"\n- NEVER answer factual questions from your general knowledge if they could relate to document content\n- If the user's question is unclear, ask for clarification\n- When providing factual information (dates, numbers, names, specific facts), include a SHORT direct quote from the document to verify accuracy\n- Format quotes like this: \"According to the document: '[exact quote]'\"\n- Keep quotes concise - just enough to verify the specific fact\n\nBe accurate, concise, and honest about the limitations of the available information.\n\nAlways include brief quotes for factual claims.\n\nRemember: Your purpose is to help users find information IN THE DOCUMENTS, not to provide general knowledge. Always search first. The documents may contain specific information that differs from general knowledge.\n\nIMPORTANT for broad questions:\n- Questions like \"Do any documents mention X?\" or \"Which documents discuss Y?\" require checking ALL relevant documents\n- Review search results carefully - multiple documents may contain relevant information\n- If you find information in one document, check if others also mention the topic\n- Acknowledge ALL documents that contain relevant information, not just the first one you find\n\nThe knowledge base contains business correspondence, legal documents, and technical guides. Use the search tool to find relevant information from these sources.\n\nWhen answering:\n- Provide direct answers first\n- Reference the source document (e.g., \"According to the NIST guidelines...\")\n- Use bullet points for multiple pieces of information\n- ALWAYS CITE the source in the following format: Source: ...\n\nIf the user asks about the news, call the HTTP Requst tool.\n\nIf user asks to summarize a document or information relevant to the document:\n  \u2192 Call Sub-Workflow tool\n  \u2192 Return summary\n\nIf you are asked for a summary, please provide only the summary you receive from the workflow tool. Send the user exactly the summary you receive from the workflow tool under the heading \"Summary.\" Do not analyze or modify it; send it back to the user.\n"
        },
        "toolDescription": "Use this sub-agent for the following tasks:\n- search the document knowledge base and retrieve specific information, facts, quotes, or details that are stored in the uploaded documents\n- prepare a summary of the provided document(s) (from a vector database)"
      },
      "typeVersion": 2.2
    },
    {
      "id": "fb3e600f-30a2-466b-b0e4-f2e77c840da2",
      "name": "Gmail sub-agent",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        1776,
        -288
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', `Your task to the Gmail-subagent`, 'string') }}",
        "options": {
          "systemMessage": "You are a Gmail AI sub-agent. You will receive tasks from the top-level agent.\nIMPORTANT: When doing Email search and not getting results, try a different combination of search parameters."
        },
        "toolDescription": "Use this email sub-agent for the following tasks:\n- send an email\n- draft an email\n- get multiple emails (brief overview with optional search)\n- get a content of a single email"
      },
      "typeVersion": 2.2
    },
    {
      "id": "a4e2816d-5132-435d-b0e0-1318319ebe3f",
      "name": "Get multiple messages in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        1760,
        -96
      ],
      "parameters": {
        "limit": 20,
        "filters": {
          "q": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Search', `Gmail search filter. Blank if not used.`, 'string') }}"
        },
        "operation": "getAll"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "909b0c0a-662c-4d23-8122-509b3771efc4",
      "name": "Read a message in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        1920,
        -96
      ],
      "parameters": {
        "simple": false,
        "options": {},
        "messageId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message_ID', `Use the message ID obtained from multiple messages tool.`, 'string') }}",
        "operation": "get"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "a3ef1db8-8e3f-4218-8595-ecc1c0d2eca4",
      "name": "Send a message in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        2080,
        -96
      ],
      "parameters": {
        "sendTo": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('To', ``, 'string') }}",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', `Email body content in HTML format`, 'string') }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', `Emain subject`, 'string') }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "e40ef752-c084-486c-a84c-cf4fa4d40320",
      "name": "Create a draft in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        2224,
        -96
      ],
      "parameters": {
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', `Draft Email body in HTML format`, 'string') }}",
        "options": {
          "sendTo": "user@example.com"
        },
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', `Draft Email subject`, 'string') }}",
        "resource": "draft",
        "emailType": "html"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "549d458d-12c5-4bea-9f20-647a0fe40fed",
      "name": "Answer Questions",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1264,
        -560
      ],
      "parameters": {
        "options": {
          "systemMessage": "=You are a Multi-Agent Coordinator responsible for managing specialized sub-agents to answer user questions comprehensively.\n\nAVAILABLE SUB-AGENTS:\n1. RAG Agent - Searches and analyzes documents (Berkshire Hathaway letters, BDSG law, NIST guidelines). Can also generate document summaries.\n2. Gmail Agent - Handles email communications (sends messages, reads inbox, creates drafts, manages multiple messages). If the user asks you to send the summary by email, always call the email sub-agent.\n3. News HTTP Request Tool - Fetches recent news and current information from web sources. This tool should ONLY be called when the user explicitly requests updates; do not call it if the user needs the information available in the documents.\n\nYOUR ROLE:\n- Analyze user requests to determine which sub-agent(s) are needed\n- Route questions to appropriate specialists\n- Coordinate between multiple agents when needed\n- Synthesize responses from sub-agents into coherent answers\n- Maintain conversation context and follow up appropriately\n\nDECISION LOGIC:\n- Document-related questions \u2192 RAG Document Agent\n- Email requests or communication needs \u2192 Email Agent  \n- Current events, recent data, news \u2192 News HTTP Request Tool\n- Complex questions may require multiple agents\n\nIf the user asks you to send the summary via email, always call the email sub-agent."
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "41470927-ad29-4830-92ad-2cc8b7ffdd20",
      "name": "Generate Agent Response",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1424,
        -704
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {
          "temperature": 0.4
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3edb3a80-07bb-4e96-a9ec-721bb12ce11c",
      "name": "Store Conversation with an Agent",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1232,
        -704
      ],
      "parameters": {
        "contextWindowLength": 20
      },
      "typeVersion": 1.3
    },
    {
      "id": "c152c58f-76b3-4161-8db9-fd8d33a5a6d0",
      "name": "Generate RAG sub-agent Response",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        448,
        -112
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {
          "temperature": 0.4
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1625deae-01e4-4f6a-a1f8-7a55988ea806",
      "name": "Check News or Recent Data",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1296,
        -320
      ],
      "parameters": {
        "url": "https://newsapi.org/v2/everything",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "q",
              "value": "recent news in Germany"
            },
            {
              "name": "sortBy",
              "value": "publishedAt"
            },
            {
              "name": "apiKey",
              "value": "4b16268d7cc1449bb4a0edee979ef4df"
            }
          ]
        },
        "toolDescription": "Use HTTP for news OR ANY RECENT CASES on user query."
      },
      "credentials": {
        "httpQueryAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "302989b2-5c30-483d-8dba-985e781a530e",
      "name": "Generate Gmail sub-agent Response",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1616,
        -96
      ],
      "parameters": {
        "model": "google/gemini-2.5-flash",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "46b4f82c-8265-40ad-9a58-4d93c7cdf33c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1568,
        -400
      ],
      "parameters": {
        "color": 7,
        "width": 784,
        "height": 544,
        "content": "## Gmail sub-agent\nReads, send emails and creates drafts."
      },
      "typeVersion": 1
    },
    {
      "id": "8621d9df-05fe-468c-9e9d-3388ca243b49",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -400
      ],
      "parameters": {
        "color": 7,
        "width": 736,
        "height": 560,
        "content": "## RAG sub-agent\nSearches documents in **Qdrant vector database** and prepares document summaries."
      },
      "typeVersion": 1
    },
    {
      "id": "b3fe69a9-a066-49ca-bf32-e794889b676f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        208
      ],
      "parameters": {
        "color": 7,
        "width": 1248,
        "height": 416,
        "content": "## Full document summarization\nRetrieves documents from the [Google Drive folder](https://drive.google.com/drive/u/2/folders/1BevhU5qdgNDFbK4D9oAYGeK0Dt5sEaxQ) and generates summaries."
      },
      "typeVersion": 1
    },
    {
      "id": "3b297db5-b903-4a58-b51a-e3adee3213bc",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        -848
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 432,
        "content": "## Main AI Agent\nRoutes user queries to the corresponding Tools (**RAG** and **Gmail** sub-agents, **news tool**)."
      },
      "typeVersion": 1
    },
    {
      "id": "c3838e29-c3b1-468e-8ce0-8af093143dcb",
      "name": "Chat with an Agent",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        1120,
        -560
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "f459f29d-d1ec-4859-86ab-c1c013047bfc",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -1088
      ],
      "parameters": {
        "width": 736,
        "height": 672,
        "content": "# Build a Multi-Agent system with n8n, Qdrant, Gmail & OpenAI\n\n## How it works\n**AI Agent** receives user queries and routes them to specialized **sub-agents** or a **news tool**:\n\n1. **RAG sub-agent** searches documents in **Qdrant vector database** and prepares a summary via a sub-workflow.\n2. **Email sub-agent** performs Gmail actions (read and send emails, create drafts).\n3. [The HTTP Request Tool](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolhttprequest/) fetches current news via the dedicated API.\n\n## How to set up\n### 1. Import the template to your n8n instance and set up **credentials**\n- Google Drive & Gmail (via Google Cloud Console)\n- [Qdrant API](https://qdrant.tech/) key (create a Cluster first)\n- [OpenAI](https://platform.openai.com/api-keys), [OpenRouter](https://openrouter.ai/docs/api/reference/authentication), and \n- [News API](https://newsapi.org/) keys\n\n### 2. Import the example [Qdrant collection](https://drive.google.com/drive/u/2/folders/1BevhU5qdgNDFbK4D9oAYGeK0Dt5sEaxQ)\n- The collection is saved under the name **n8n-rag-2437367325990310-2025-11-04-10-41-54.snapshot**. \n- Alternatively, you can upload your own documents.\n\n### 3. Chat with the Agent\nAsk the Agent to search documents, prepare a summary, check emails or fetch latest news.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f224b135-0b16-4bd8-9492-17142abadf1a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1232,
        -400
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 240,
        "content": "## News Tool\nFetches latest news via API."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5242bc43-9756-4829-99f5-7cf44b13dec7",
  "connections": {
    "Get Document": {
      "main": [
        [
          {
            "node": "Extract Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RAG sub-agent": {
      "ai_tool": [
        [
          {
            "node": "Answer Questions",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Extract Content": {
      "main": [
        [
          {
            "node": "Convert to Markdown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail sub-agent": {
      "ai_tool": [
        [
          {
            "node": "Answer Questions",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Process Request": {
      "main": [
        [
          {
            "node": "Format Summary Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Summary": {
      "ai_languageModel": [
        [
          {
            "node": "Process Request",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Search Documents": {
      "ai_tool": [
        [
          {
            "node": "RAG sub-agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Chat with an Agent": {
      "main": [
        [
          {
            "node": "Answer Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Document": {
      "ai_tool": [
        [
          {
            "node": "RAG sub-agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Convert to Markdown": {
      "main": [
        [
          {
            "node": "Process Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Embeddings": {
      "ai_embedding": [
        [
          {
            "node": "Search Documents",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Create a draft in Gmail": {
      "ai_tool": [
        [
          {
            "node": "Gmail sub-agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Generate Agent Response": {
      "ai_languageModel": [
        [
          {
            "node": "Answer Questions",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Read a message in Gmail": {
      "ai_tool": [
        [
          {
            "node": "Gmail sub-agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Receive Summary Request": {
      "main": [
        [
          {
            "node": "Get Document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message in Gmail": {
      "ai_tool": [
        [
          {
            "node": "Gmail sub-agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Check News or Recent Data": {
      "ai_tool": [
        [
          {
            "node": "Answer Questions",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get multiple messages in Gmail": {
      "ai_tool": [
        [
          {
            "node": "Gmail sub-agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Generate RAG sub-agent Response": {
      "ai_languageModel": [
        [
          {
            "node": "RAG sub-agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Store Conversation with an Agent": {
      "ai_memory": [
        [
          {
            "node": "Answer Questions",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Generate Gmail sub-agent Response": {
      "ai_languageModel": [
        [
          {
            "node": "Gmail sub-agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}