⚒️ Create custom reasoning patterns for AI agents with GraphRAG & knowledge ontology

1,303 views · ⚒️ Engineering

Description

Teach your AI agent HOW to think, not WHAT to think

Video tutorial

This workflow demonstrates how you can build an AI agent in n8n that uses the reasoning logic you define. So an LLM learns a way of thinking, which you can then apply to multiple problems:

InfraNodus knowledge graph

How it works

This template uses the n8n AI agent node as an orchestrating agent that has access to a certain reasoning logic defined by an InfraNodus knowledge graph.

This graph contains a list of reasoning rules (ontology), which is extracted to provide an advice that is relevant to the original prompt. It uses GraphRAG under the hood to traverse the parts of the graph relevant to the query.

This advice and the reasoning logic extracted is then used by the AI agent to generate a response that is relevant to the user’s query but that uses the reasoning logic provided through the graph.

Here’s a description step by step:

InfraNodus uses GraphRAG under the hood:

How to use

You need an InfraNodus account to use this workflow.

Requirements

Customizing this workflow

You can use this same workflow with a Telegram bot, so you can interact with it using Telegram. There are many more customizations available.

Check out the complete guide at https://support.noduslabs.com/hc/en-us/articles/21429518472988-Using-Knowledge-Graphs-as-Reasoning-Experts

Also check out the video tutorial with a demo:

Video tutorial

🔗 Nodes Used

AI Agent, OpenAI Chat Model, Simple Memory, Chat Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup