In this article, we're going to demonstrate how to set up an AI chatbot agent workflow in n8n that uses your InfraNodus graphs as custom expert knowledge sources.
To set it up, we use a standard n8n AI chat agent workflow (with a Telegram chat variation for easy sharing). We then connect your existing InfraNodus graphs as the tools to the agent. We provide a description to every tool (you can use the auto-generated RAG summary from your graph's Project Notes). The agent then chooses itself which "expert" to use based on the description of the tool you provide. You can provide multiple InfraNodus graph at the same time as experts via the InfraNodus API. To query InfraNodus, we use the `graphAndAdvice` API endpoint, which receives a prompt for your existing private graph and provides an AI-generated response.
Note, that a huge advantage of using the InfraNodus graphs as your "knowledge experts" is that you don't have to set up complex vector databases or RAG vector search tools, but can simply import the content you need directly into InfraNodus and use it in your agentic workflows.
How Does this Workflow Work?
Here is the workflow description step by step. You can also download that workflow from our GitHub n8n templates repo and then see the detailed descriptions directly in the workflow diagram.
1. User activates a conversation (via n8n / public URL chat or sending a Telegram message to your bot)
2. The AI agent (orchestrated by the OpenAI / n8n node) received this message. It uses the model (OpenAI gpt-4o in our case) to analyze whether it can use any of the tools it's connected to to respond to this query.
3. If it decides to use the tool(s), it will augment the query to be more suitable for that particular tool.
4. The augmented query is sent to the InfraNodus HTTP node endpoint, querying your graph and getting a high-quality response generated by InfraNodus' GraphRAG. InfraNodus' underlying knowledge graph structure is used to ensure that the response you get is not just based on vector similarity search (RAG) but also takes the underlying graph structure and holistic understanding of the context into account.
5. After consulting the experts (via the "tool" nodes), the AI agent provides the final response to the user (via the Chat or sending a Telegram message).
Try It Yourself
Learn more about all the other n8n workflows in our GitHub repo: http://github.com/infranodus/n8n-infranodus-workflow-templates
Here's the n8n workflow file template for the AI agent chatbot: https://github.com/infranodus/n8n-infranodus-workflow-templates/blob/main/chatbot-ai-experts.json
Here's the same n8n workflow file template but for Telegram: https://github.com/infranodus/n8n-infranodus-workflow-templates/blob/main/telegram-ai-experts.json (to create a Telegram bot and get the API, you just need to message @botfather in Telegram — it takes 30 seconds)
Note, to activate those workflows, you will need to:
1) Add your texts to InfraNodus to be saved as the knowledge graphs
2) Add your InfraNodus API keys to the HTTP request nodes that query your InfraNodus graphs
3) Use the graph names in the HTTP nodes
4) Rewrite the expert descriptions to be related to your graph's content (you can use InfraNodus auto-generated RAG enhancement summary for that which can be obtained in InfraNodus)
and a full tutorial and demo:
Comments
0 comments
Please sign in to leave a comment.