Telegram AI Chatbot Agent with InfraNodus GraphRAG Knowledge Base
Using the knowledge graphs instead of RAG vector stores
This workflow creates a Telegram chatbot agent that has access to several knowledge bases at the same time (used as "experts").
These knowledge bases are provided using the InfraNodus GraphRAG using the knowledge graphs and providing high-quality responses without the need to set up complex RAG vector store workflows.
The advantages of using GraphRAG instead of the standard vector stores for knowledge are:
Easy and quick to set up and update (no complex data import workflows or vector stores needed) A knowledge graph has a holistic view of your knowledge base and knows what it's about Better retrieval of relations between the document chunks = higher quality responses
How it works This template uses the n8n AI agent node as an orchestrating agent that decides which tool (knowledge graph) to use based on the user's prompt.
Here's a description step by step:
The user submits a question using the Telegram bot, which is then received in the n8n workflow via the Telegram trigger node. The AI agent node checks a list of tools it has access to. Each tool has a description of the knowledge it has auto-generated by InfraNodus. The AI agent decides which tool should be used to generate a response. It may reformulate user's query to be more suitable for the expert. The query is then sent to the InfraNodus HTTP node endpoint, which will query the graph that corresponds to that expert. Each InfraNodus GraphRAG expert provides a rich response that takes the whole context into account and provides a response from each expert (graph) along with a list of relevant statements retrieved using a combination or RAG and GraphRAG. The n8n AI Agent node integrates the responses received from the experts to produce the final answer. The final answer is sent back to the Telegram bot who delivers it back to the private chat or a Telegram group.
How to use
You need an InfraNodus GraphRAG API account and key to use this workflow.
Create an InfraNodus account Get the API key at https://infranodus.com/api-access and create a Bearer authorization key for the InfraNodus HTTP nodes. Create a separate knowledge graph for each expert (using PDF / content import options) in InfraNodus For each graph, go to the workflow, paste the name of the graph into the body name field. Keep other settings intact or learn more about them at the InfraNodus access points page. Once you add one or more graphs as experts to your flow, add the LLM key to the OpenAI node Create a Telegram bot (the instructions are in the workflow Post note) — it takes 30 seconds. Get its API key and create the Telegram credentials to use in the Telegram nodes in this workflow.
Requirements
An InfraNodus account and API key An OpenAI (or any other LLM) API key A Telegram account
Customizing this workflow
You can use this same workflow with a standard AI chatbot via a URL that can also be embedded to any website. You can also use it with ElevenLabs AI voice agent. There are many more customizations available.
Check out the complete guide at https://support.noduslabs.com/hc/en-us/articles/20174217658396-Using-InfraNodus-Knowledge-Graphs-as-Experts-for-AI-Chatbot-Agents-in-n8n
Also check out the video tutorial with a demo:
Support
If you have any questions, contact us via the support portal at https://support.noduslabs.com or via our Discord channel.
More n8n workflows are available on our support portal: n8n x InfraNodus AI automation workflows.
Related Templates
Track Demo Bookings with Google Calendar to Meta Conversions API Integration
Who is this workflow for? If you're using Meta Ads to generate new leads to your sales pipeline, this workflow is for yo...
Build a PDF-Based RAG System with OpenAI, Pinecone and Cohere Reranking
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. This workflow prov...
Reusable and Independently Testable Sub-workflow
Reusable and Independently Testable Sub-workflow This n8n workflow provides a standardized structure for building and te...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments