You can use InfraNodus knowledge graphs as reasoning experts. The big difference to the traditional RAG systems it that you can use these experts to tell your models how to think (instead of telling them what to think). This can be used to advance your research by introducing specific reasoning logics and ways of thinking and improve the quality of LLM responses, making them less generic and more specialized.
Some use cases include:
- Augmenting your AI chatbots with expert reasoning tactics (e.g. using EightOS principles for ecological thinking variability)
- Adding specific reasoning logics into your LLM workflows (e.g. introducing the Tarot divination logic as part of your LLM's expertise)
- Augmenting your business offers with expert advice (e.g. using Alex Hormozi's PR and sales framework to improve your content)
- Building recommendation engines for specific contexts (e.g. recommending techno clubs in Berlin)
In order to do this, you need to model an expertise you require as a knowledge graph that doubles as a reasoning‑ready ontology. This can be done using the AI Ontology Generator app in InfraNodus or manually using the [[wiki links]] syntax (PKM creator).
Once the reasoning ontology is ready, it can be implemented into your LLM workflows. Below we explain how to do that step by step using the n8n workflow automation tool. However, you can do that with any other tool, such as Crew AI or even coding your own app with the help of InfraNodus API.
1. Modeling a Knowledge Graph as a Reasoning Ontology
First, we need to set up a reasoning ontology that your LLM will be using to augment its responses.
Let's assume that we want to use the principles described in EightOS practice that are used for managing escalation and deescalation and promoting variability (following the ecological thinking framework).
This can be very useful for an AI system that deals with customer queries and needs an outside eye on the dynamics of interaction and some additional insight on dealing with it. Normally, it will be biased towards placating the users and appeasing to their every demand. You might want to use the EightOS reasoning model if you need an LLM that is ready to challenge the user and to also change the dynamics of interaction.
The easiest way to do that is to use the AI Ontology Generator import app in InfraNodus (read more about how ontologies work):
- Open the Brainstorm > AI > AI Ontology Generator app
- Add your original text into the prompt window (or use a prompt to generate an ontology for a well-known approach, e.g. "Getting to Yes" framework)
- Let the AI generate a system of functional relations derived from your text that will describe the main reasoning pathways found in your text
- The resulting graph will visualize the main entities and relations found in these ontologies
- Click on the nodes and relations to explore the context
- Use the editor to add your own relations and additional reasoning chains — this activity in itself will dramatically improve your understanding of the subject matter!
- Aim for the "optimal" topical diversity measure, which indicates that every topic is equally represented in the knowledge graph and there are no concepts that overtake attention from the rest
- Go to the Project Notes and generate a topical outline of the knowledge graph for RAG augmentation
Once these steps are complete, you can query this graph using the AI Insights chat module — simply ask random related and unrelated questions to the context to see how well it responds. If you feel there's a bias towards a specific topic you'd like to reduce or if some concepts are not mentioned when they should, you can add more nodes and connections.
2. Using an Existing Ontology Graph
You can use an existing ontology graph for your reasoning LLM workflows. You can find some examples at https://infranodus.com/knowledge-graphs
To import the graph into your account, simply open the graph you're interested in and then go to the Download menu and download the CSV file with statements and tags:
Then import this file into your own account. Make sure that you set Text Processing for [[Double Squarebrackets / Wikilinks]] is set to [[priority]]:
3. Using the Knowledge Graph as a Reasoning Expert in Your LLM Workflows
Now we can use this knowledge graph as a reasoning expert in our LLM workflows.
As an example, we will use n8n LLM workflow templates as they provide an easy way to demonstrate how these workflows work. However, you can use them as schemas to code your own applications using the InfraNodus API in combination with various LLM frameworks (e.g. OpenAI, LangChain, or Vercel's Chat SDK).
a. Using AI Agent Node in N8N with a Reasoning Expert
The easiest way to set up the reasoning workflow is to use the n8n panel of experts workflow published by InfraNodus.
It uses a simple setup where an AI Agent node is connected to an InfraNodus expert (as a tool). You would need to modify the system prompts for the AI Agent node though to ensure that it doesn't retrieve the content from the expert, but, rather, uses it as a reasoning expert to augment the original user prompt and to then send it again to the model for the final response.
Here's an example of a system prompt you could use for the AI agent node in n8n:
You are a reasoning agent. You have access to a dynamic interaction and an expert in interaction dynamics that provide you advice on how to continue your interaction. When you send a request to this expert, you need to give it an interpretation of the previous interaction and its dynamics (your interpretation of the conversation) using the language and concepts that the reasoning agent will understand. Use the response from the expert tools as an instruction to improve your response to the user's query. Give the utmost importance to the expert tool advice to improve your standard response to the client's original query.
You can get this modified workflow here: https://github.com/infranodus/n8n-infranodus-workflow-templates/blob/main/graphrag-chatbots-experts/reasoning-expert-graph-ontology.json or directly on n8n website.
As your InfraNodus expert has a description (a one-sentence summary of its expertise and the data you generated for RAG augmentation in the Step 8 of the previous section (Project Notes > Topical Summary), your n8n AI agent will know how to rephrase the question so that it gets the relevant insight from the knowledge graph you created.
It will then use this additional insight to augment its strategy of answering to the user, providing a response that incorporates the reasoning logic from your knowledge graph:
The usual workflow is:
- Get the user's request
- Using the knowledge about the InfraNodus expert tool's speciality, rephrase the user query (1st OpenAI request) and send it to the expert
- The expert sends a response that details how to deal with the request
- The AI agent receives this response and sends it along with the original user query back to OpenAI to get a response. The expert's knowledge is the additional context that we ask the model to give particular importance to.
- If you need a knowledge base, you could add an additional InfraNodus node with another graph that is the knowledge base related to the subject or use any other external knowledge base or a vector store tool for providing this context.
- The final response is then sent back to the user
- You can replace the chat message with embeddable form and add the chatbot to your website
b. Using the GraphRAG Prompt Augmentation and an Additional Expert for Better Insights
This setup doesn't even require you to use an OpenAI node or AI agent node. All you need to do is to:
- Create an expert graph for reasoning in InfraNodus
- Create another graph for knowledge in InfraNodus (e.g. Alex Hormozi's techniques)
Then when the user makes a request, it will first be augmented using the reasoning expert that will enhance this prompt to make it more suitable for the subject matter.
Then the augmented prompt is sent to the GraphRAG retrieval point (can be a different knowledge graph) that will provide the response that is influenced by the original reasoning logic derived from the first node.
c. Integrating Reasoning Logic into Your LLM Workflows
You can integrate both of those approaches into your own LLM workflows. Simply add the output of the reasoning expert / AI agent to your own model node and see how it affects the quality of responses you get.
d. Decreasing Latency for Voice Applications
If you're interested to use these nodes in real-time voice chat workflows, you might find that the latency of the InfraNodus nodes is a bit too high.
In this case, you can export the graph structure insights from the original graph and add it as knowledge into your ElevenLabs knowledge base.
The relations between the nodes can be used to improve the reasoning logic of the agent.
Comments
0 comments
Please sign in to leave a comment.