Erstellung eines Sprach- und Telegram-Assistenten (Lookio RAG und GPT-4.1)
Experte
Dies ist ein Automatisierungsworkflow mit 21 Nodes. Hauptsächlich werden If, Set, Switch, Telegram, HttpRequest und andere Nodes verwendet. Erstelle einen Sprach- und Text-Telegram-Assistenten mit Lookio RAG und GPT-4.1
Voraussetzungen
- •Telegram Bot Token
- •Möglicherweise sind Ziel-API-Anmeldedaten erforderlich
- •OpenAI API Key
Verwendete Nodes (21)
Kategorie
-
Workflow-Vorschau
Visualisierung der Node-Verbindungen, mit Zoom und Pan
Workflow exportieren
Kopieren Sie die folgende JSON-Konfiguration und importieren Sie sie in n8n
{
"nodes": [
{
"id": "cad8de80-6b0b-430c-a3c0-8e6a6a25c393",
"name": "Telegram-Trigger",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
240,
544
],
"webhookId": "c2c0c3f3-a4d1-4ccb-af97-7269b0debcc2",
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"id": "GQHcQvX9GizW5ai3",
"name": "Duv Brain Telegram"
}
},
"typeVersion": 1.1
},
{
"id": "3ccede32-2481-454e-9ccb-9e206b32d67f",
"name": "Ich selbst?",
"type": "n8n-nodes-base.if",
"position": [
464,
544
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "fae16f10-e497-47ea-92ec-741f54cedd62",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.message.from.username }}",
"rightValue": "<Replace with your Telegram username>"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "87342e86-4f25-43ed-ae19-8a495b0888c3",
"name": "KI-Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
2256,
560
],
"parameters": {
"text": "={{ $json.final_user_message }}",
"options": {
"systemMessage": "=You are a helpful assistant that answers the user based on a knowledge base.\n\nWhenever the user query requires specific knowledge (most queries except empty queries like \"hi\"), call the tool \"Query knowledge base\" with a question to have it output an answer based on the knowledge base.\n\nIf the output from the knowledge base tool indicates that the knowledge base doesn't contain enough insights to answer, communicate this to the user transparently.\n\nAnswer considring that this conversation happens on Telegram - adapt your style/format to that platform."
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "e17cfbab-3149-45b3-9903-6b5b8b264b8f",
"name": "Einfacher Speicher",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
2272,
816
],
"parameters": {
"sessionKey": "={{ $('Telegram Trigger').item.json.message.from.username }}",
"sessionIdType": "customKey",
"contextWindowLength": 7
},
"typeVersion": 1.3
},
{
"id": "182a9d2e-8747-48bf-9c8b-ca606915ce7b",
"name": "Notizzettel5",
"type": "n8n-nodes-base.stickyNote",
"position": [
880,
240
],
"parameters": {
"color": 2,
"width": 873,
"height": 325,
"content": "# Process Audio"
},
"typeVersion": 1
},
{
"id": "5ad3276d-f713-401f-8ee2-de72243eb426",
"name": "Audio-Datei abrufen",
"type": "n8n-nodes-base.telegram",
"position": [
912,
400
],
"webhookId": "8f4d5e8a-20ed-41d9-980d-b246f016fb67",
"parameters": {
"fileId": "={{ $('Telegram Trigger').item.json.message.voice.file_id }}",
"resource": "file",
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"id": "GQHcQvX9GizW5ai3",
"name": "Duv Brain Telegram"
}
},
"typeVersion": 1.2
},
{
"id": "4ac926fe-165b-4b11-ad8d-a5ebc040c4fc",
"name": "Nachrichten-Router",
"type": "n8n-nodes-base.switch",
"position": [
688,
512
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "audio",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "b5d9f703-2a1b-4942-906c-7a7d1404a4d7",
"operator": {
"type": "object",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $('Telegram Trigger').item.json.message.voice }}",
"rightValue": ""
}
]
},
"renameOutput": true
},
{
"outputKey": "text",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "342f0883-d959-44a2-b80d-379e39c76218",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $('Telegram Trigger').item.json.message.text }}",
"rightValue": ""
}
]
},
"renameOutput": true
}
]
},
"options": {
"fallbackOutput": "extra"
}
},
"typeVersion": 3.2
},
{
"id": "49027af2-e53b-4dfc-ac8e-b849cb6c9db6",
"name": "Notizzettel",
"type": "n8n-nodes-base.stickyNote",
"position": [
2400,
768
],
"parameters": {
"color": 6,
"width": 336,
"height": 400,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Lookio tool\n\nThe agent calls this tool to get answers based on the knowledge base you've built in Lookio.\n- Add your [Lookio](https://www.lookio.app/) API key\n- Specify the ID of the Lookio assistant to query"
},
"typeVersion": 1
},
{
"id": "ce0b2d93-2276-47ca-857a-c83a72f0c3e1",
"name": "Notizzettel1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1904,
768
],
"parameters": {
"color": 5,
"width": 336,
"height": 400,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## AI model\n\nThe core AI model of your agent. Connect your OpenAI API key or switch to your favorite LLM provider."
},
"typeVersion": 1
},
{
"id": "f667095e-cf14-4784-9a55-a4261ae00f1a",
"name": "Notizzettel2",
"type": "n8n-nodes-base.stickyNote",
"position": [
2192,
320
],
"parameters": {
"color": 4,
"width": 352,
"height": 400,
"content": "## The agent\n\nThis agent will distribute the relevant questions to Lookio via the \"Query knowledge base\" tool. Feel free to provide more context in its system message and add instructions when it comes to the format or style of responses?"
},
"typeVersion": 1
},
{
"id": "615e79ce-d872-4b99-96a2-02c9436b63c2",
"name": "OpenAI Chat-Modell",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2032,
832
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "dMiSy27YCK6c6rra",
"name": "Duv's OpenAI"
}
},
"typeVersion": 1.2
},
{
"id": "a8da1688-7bfd-4c68-a1da-45523c8628a2",
"name": "Telegram Antwort",
"type": "n8n-nodes-base.telegram",
"position": [
2832,
560
],
"webhookId": "091fa9ae-790a-4f7e-86c2-b13c184951bc",
"parameters": {
"text": "={{ $json.output }}",
"chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "GQHcQvX9GizW5ai3",
"name": "Duv Brain Telegram"
}
},
"typeVersion": 1.2
},
{
"id": "1dbd7647-e5ac-449a-8e45-34126b4af8bf",
"name": "Notizzettel6",
"type": "n8n-nodes-base.stickyNote",
"position": [
1216,
272
],
"parameters": {
"color": 7,
"width": 265,
"height": 277,
"content": "### AI transcription\n\nYou can replace with another model like OpenAI's."
},
"typeVersion": 1
},
{
"id": "73f644d2-97f9-4718-b0e6-982a44129470",
"name": "Wissensdatenbank abfragen",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
2544,
832
],
"parameters": {
"url": "https://api.lookio.app/webhook/query",
"method": "POST",
"options": {},
"sendBody": true,
"sendHeaders": true,
"bodyParameters": {
"parameters": [
{
"name": "query",
"value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', `The query to the knowledge base, in the form of a question`, 'string') }}"
},
{
"name": "assistant_id",
"value": "<your-assistant-id>"
},
{
"name": "query_mode",
"value": "flash"
}
]
},
"toolDescription": "Call this tool when the knowledge base is required to answer the user query.",
"headerParameters": {
"parameters": [
{
"name": "api_key",
"value": "<your-lookio-api-key>"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "6d132f95-391c-4a97-a8fa-92663fa608f0",
"name": "Notizzettel7",
"type": "n8n-nodes-base.stickyNote",
"position": [
384,
304
],
"parameters": {
"color": 3,
"width": 265,
"height": 405,
"content": "### Make this bot private\n\nTelegram bots are public by default, so we're adding a filter here based on your unique Telegram username. Change the value to ensure only your messages can go through, or delete this step to make it 100% public"
},
"typeVersion": 1
},
{
"id": "d4f5488f-f234-4142-b561-4349550c57f5",
"name": "Notizzettel8",
"type": "n8n-nodes-base.stickyNote",
"position": [
896,
592
],
"parameters": {
"color": 2,
"width": 873,
"height": 293,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# Process text"
},
"typeVersion": 1
},
{
"id": "dd9663af-3587-42c9-bdf0-a6c3cc2ba6d1",
"name": "Nachricht aus Audio vorbereiten",
"type": "n8n-nodes-base.set",
"position": [
1584,
400
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "bffc2c1f-990e-4396-b59a-ab82b843e061",
"name": "preset_user_message",
"type": "string",
"value": "={{ $json.choices[0].message.content }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "c18dfaf8-6189-4d78-b0d1-47af2a6e17be",
"name": "Nachricht aus Text vorbereiten",
"type": "n8n-nodes-base.set",
"position": [
1168,
672
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "b37b48ba-8fef-4e6c-bbca-73e6c2e1e0a8",
"name": "preset_user_message",
"type": "string",
"value": "={{ $('Telegram Trigger').item.json.message.text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "c348dadb-0377-4a6e-9e5e-2f8ec77bd411",
"name": "Nutzer-Nachricht konsolidieren",
"type": "n8n-nodes-base.set",
"position": [
1872,
560
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "7db97ffc-b1eb-422e-8bb1-90eea55c7aa2",
"name": "final_user_message",
"type": "string",
"value": "={{ $json.preset_user_message }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "a881e44a-f8f4-456e-98e5-51850791967d",
"name": "Notizzettel3",
"type": "n8n-nodes-base.stickyNote",
"position": [
208,
-400
],
"parameters": {
"width": 880,
"height": 544,
"content": "# **RAG Telegram bot with Lookio & GPT-4.1 (text + voice)**\n\n**Summary**: A Telegram bot that answers questions using your Lookio assistant. Accepts text and voice (transcribed via **Mistral** by default) and uses an LLM agent that calls the **Query knowledge base** tool.\n\n**How it works (short)**:\n1. **Telegram Trigger** → Detects text or voice via **Message Router**.\n2. Voice: **Get Audio File** → **Mistral transcribe** → prepare text.\n3. **AI Agent** calls **Query knowledge base** (Lookio) when domain knowledge is needed and sends answers via **Telegram answer**.\n\n**How to use / Setup**:\n1. Create a Lookio assistant; get **API Key** and **Assistant ID**.\n2. In **Query knowledge base**, replace `<your-lookio-api-key>` and `<your-assistant-id>`.\n3. Add credentials: **Telegram API**, **OpenAI (or LLM)**, **Mistral Cloud**.\n4. (Optional) Edit **Myself?** to set your Telegram username for private testing or delete it to make the bot public.\n5. Activate the workflow and message your bot in Telegram.\n\n\n**Bold nodes to configure:** **Telegram Trigger**, **Query knowledge base**, **OpenAI Chat Model**, **Mistral transcribe**, **Myself?**\n\n*A template created by Guillaume Duvernay*\n"
},
"typeVersion": 1
},
{
"id": "eda43537-92a0-47f0-ba3f-377b3ba9f5a3",
"name": "Mistral Transkribieren",
"type": "n8n-nodes-base.httpRequest",
"position": [
1296,
400
],
"parameters": {
"url": "https://api.mistral.ai/v1/audio/transcriptions",
"method": "POST",
"options": {
"redirect": {
"redirect": {}
}
},
"sendBody": true,
"contentType": "multipart-form-data",
"authentication": "predefinedCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "model",
"value": "voxtral-mini-2507"
},
{
"name": "file",
"parameterType": "formBinaryData",
"inputDataFieldName": "data"
}
]
},
"nodeCredentialType": "mistralCloudApi"
},
"credentials": {
"mistralCloudApi": {
"id": "vakRnCmKyOQFpdEk",
"name": "Mistral Cloud account"
}
},
"typeVersion": 4.2
}
],
"connections": {
"3ccede32-2481-454e-9ccb-9e206b32d67f": {
"main": [
[
{
"node": "4ac926fe-165b-4b11-ad8d-a5ebc040c4fc",
"type": "main",
"index": 0
}
]
]
},
"87342e86-4f25-43ed-ae19-8a495b0888c3": {
"main": [
[
{
"node": "a8da1688-7bfd-4c68-a1da-45523c8628a2",
"type": "main",
"index": 0
}
]
]
},
"e17cfbab-3149-45b3-9903-6b5b8b264b8f": {
"ai_memory": [
[
{
"node": "87342e86-4f25-43ed-ae19-8a495b0888c3",
"type": "ai_memory",
"index": 0
}
]
]
},
"5ad3276d-f713-401f-8ee2-de72243eb426": {
"main": [
[
{
"node": "eda43537-92a0-47f0-ba3f-377b3ba9f5a3",
"type": "main",
"index": 0
}
]
]
},
"4ac926fe-165b-4b11-ad8d-a5ebc040c4fc": {
"main": [
[
{
"node": "5ad3276d-f713-401f-8ee2-de72243eb426",
"type": "main",
"index": 0
}
],
[
{
"node": "c18dfaf8-6189-4d78-b0d1-47af2a6e17be",
"type": "main",
"index": 0
}
]
]
},
"Telegram Trigger": {
"main": [
[
{
"node": "3ccede32-2481-454e-9ccb-9e206b32d67f",
"type": "main",
"index": 0
}
]
]
},
"615e79ce-d872-4b99-96a2-02c9436b63c2": {
"ai_languageModel": [
[
{
"node": "87342e86-4f25-43ed-ae19-8a495b0888c3",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"eda43537-92a0-47f0-ba3f-377b3ba9f5a3": {
"main": [
[
{
"node": "dd9663af-3587-42c9-bdf0-a6c3cc2ba6d1",
"type": "main",
"index": 0
}
]
]
},
"73f644d2-97f9-4718-b0e6-982a44129470": {
"ai_tool": [
[
{
"node": "87342e86-4f25-43ed-ae19-8a495b0888c3",
"type": "ai_tool",
"index": 0
}
]
]
},
"c348dadb-0377-4a6e-9e5e-2f8ec77bd411": {
"main": [
[
{
"node": "87342e86-4f25-43ed-ae19-8a495b0888c3",
"type": "main",
"index": 0
}
]
]
},
"c18dfaf8-6189-4d78-b0d1-47af2a6e17be": {
"main": [
[
{
"node": "c348dadb-0377-4a6e-9e5e-2f8ec77bd411",
"type": "main",
"index": 0
}
]
]
},
"dd9663af-3587-42c9-bdf0-a6c3cc2ba6d1": {
"main": [
[
{
"node": "c348dadb-0377-4a6e-9e5e-2f8ec77bd411",
"type": "main",
"index": 0
}
]
]
}
}
}Häufig gestellte Fragen
Wie verwende ich diesen Workflow?
Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.
Für welche Szenarien ist dieser Workflow geeignet?
Experte
Ist es kostenpflichtig?
Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.
Verwandte Workflows
Telegram-Frage-Antwort-Bot, der Linkup-Websuche, GPT-4.1 und Mistral-Sprache integriert, bauen
Telegram-Frage-Antwort-Bot mit integrierter Linkup-Websuche, GPT-4.1 und Mistral-Sprache bauen
If
Set
Switch
+
If
Set
Switch
21 NodesGuillaume Duvernay
Bitget KI-Handelsagent
Automatisierung von Bitget-Spot-Handel durch einen GPT-4o-mini-KI-Agenten über Telegram
Set
Code
Crypto
+
Set
Code
Crypto
156 NodesDon Jayamaha Jr
AI-Automatisierung und Agenten für Präsentations erstellen und verkaufen
Erstellen von AI-Automatisierung und Agenten für Verkaufsprozesse
If
Set
Wait
+
If
Set
Wait
74 NodesNICKYAI
Sonstiges
AI Email Triage & Alert System with GPT-4 and Telegram Notifications
If
Set
Gmail
+
If
Set
Gmail
104 NodesPeter Joslyn
Support
AI Video Generator with OpenAI, ElevenLabs & YouTube Publishing via Telegram
If
Set
Wait
+
If
Set
Wait
68 NodesFRANK LIN
Vertrieb
AI-Powered Dental Appointment System with Telegram, Google Calendar and Sheets
If
Set
Switch
+
If
Set
Switch
53 NodesAziz B
Workflow-Informationen
Schwierigkeitsgrad
Experte
Anzahl der Nodes21
Kategorie-
Node-Typen11
Autor
Externe Links
Auf n8n.io ansehen →
Diesen Workflow teilen