Retrieval-Augmented Generation (RAG) is a well-known way to give large language models (LLMs) extra context from your own knowledge base or documents. However, most RAG setups have a hard time grasping the “big picture” of all that context. This gap can lead to weaker answers—especially if someone asks a broad question.
That’s where InfraNodus comes in. It creates an overview of any PDF, text, or other content you feed it, pinpointing main themes, connections, and gaps. You can then feed these insights back into Dify for more in-depth, wide-ranging responses from your AI.
Why Add InfraNodus Insights to Dify RAG System?
Standard Dify RAG pipelines shine when a user request is very specific—say, “How do I import a CSV file in InfraNodus?” They can quickly find matching chunks of text in your knowledge base. But for more open-ended questions (“What can I do with this?” “How can I enhance my workflow?”), RAG searches may struggle because the question doesn’t strongly match any particular document chunk.
By using InfraNodus to extract contextual data such as main topics, key relationships, and “blind spots,” you can help your RAG apps build with Dify produce answers that are broad but still accurate. InfraNodus uses its own GraphRAG implementation, so it has a better holistic understanding of the context as well as a better understanding of the main concepts and relations within. This supplementary metadata clarifies the overall structure of the material, prompting the model to cover important aspects—even for open-ended prompts.

How to Improve Retrieval Augmented Generation with Topical Context
A typical RAG pipeline encodes your query into vectors, then finds the closest matches in a database of text snippets. That works perfectly for precise questions but falters when dealing with vague or general prompts.
By leveraging the InfraNodus graph AI prompt generator, we can enrich our prompt with extra metadata from the knowledge base, enabling our RAG system to retrieve information more effectively. In turn, the LLM has better insights, allowing it to produce higher-quality responses and cover all important topics during user interactions.
For Example:
Standard RAG
If your knowledge base is about InfraNodus and you simply ask, “What can it do?” the chatbot agent on this portal (try it live here) gives a decent response. However, because it lacks InfraNodus data for context, it fails to cover the full range of InfraNodus’s capabilities and instead focuses on just one aspect of the tool.

InfraNodus-augmented RAG prompt
A chatbot agent on this portal uses InfraNodus-specific topical data to enhance its RAG.This data contains information about the main topics and concepts identified in the knowledge base with InfraNodus and is added directly into the LLM node’s prompt. As a result, the model will have a better understanding of the general context and produce better results even for general queries. If you try it live here, you'll notice how the additional contextual insights from the knowledge base lead to more structured and precise answers.

Step-by-Step: Using InfraNodus to Boost Dify RAG
Below is a generic approach you can adapt to suit your data:
Collect the Data
Gather PDF or .MD files you want to use for your AI’s knowledge base.
If you’re dealing with a website, you can use Firecrawl (cloud or open-source) to crawl the pages. Firecrawl also integrates well with Dify.

You can import various data directly into InfraNodus—websites, Google search results, RSS feeds, YouTube transcripts, social media, and more. Once processed, InfraNodus can export relevant chunks or analytics.
Visualize & Analyze
Upload the text into InfraNodus and generate a text network.
From the Analytics section, explore “Main Ideas,” “Most Influential Concepts,” “Relations,” and “Blind Spots.” Save these notes or auto-generate them via InfraNodus’s Graph AI prompt generator.
You can extract the necessary data with one click if you go to the Project Notes > and click the Generate a RAG Prompt from Analytics button. This will extract all the necessary insights from the Analytics panel and you can use this to augment your RAG prompt in Dify.
(Optional) Dive further: check “Structural Gaps,” remove top layers to surface hidden ideas, or use InfraNodus API to automate the extraction of these insights.
Set Up Your AI Tool & Add Files
Within InfraNodus, you can also chat directly with the content.
For Dify, go to Knowledge and create a new Knowledge Base, upload the files there or use the Firecrawl API to ingest a website.

Augment Your Prompt
Next, incorporate the data you generated with InfraNodus into your model’s prompt. To do this, locate the area in your application where you can add custom instructions that wrap around user queries directly in the prompt field.

Below is an example of a “System Prompt” you can use in Dify. Simply replace the data inside <tags> with what you generated in InfraNodus (such as main topics, key relationships, and conceptual gateways). This ensures your AI has access to a broader, more connected view of your knowledge base:
Enhance General Queries
If your users ask very general questions that don’t directly map to a single knowledge-chunk, you can add a step that refines or “rewrites” the query in Dify chatflow. This step merges broader knowledge from InfraNodus so the RAG retrieval stage isn’t left guessing.

Here's an example of a prompt you can use to enhance user query:
Everything inside the <tags></tags> can be retrieved directly from the InfraNodus graph. Simply navigate to Project Notes > Auto Generate for RAG, or use the InfraNodus API endpoint, to obtain these insights.
Optimize for Speed
In the example above, we’re using this entire support portal as our knowledge base. As a result, when InfraNodus first processes it to retrieve the main topics and contextual graph insights, it may take around 15–20 seconds.
To avoid running that process every time, we can store the initial output in a variable and reuse it for subsequent user queries. To set this up in Dify, add a “Variable Assigner” node and assign the output of the InfraNodus Knowledge Base Enhancer tool to it. Then, include an If / Else node that checks whether “InfraNodusGraph” is empty. If it isn’t, the workflow goes straight to the LLM Prompt Augmentor.
Below is an example workflow structure in Dify chatflow:

1) User starts interaction
2) If / Else operator sees if the InfraNodus variable is empty
3) If it is empty, make the InfraNodus request (as above) to retrieve graph insights on the original context
4) Save it into the variable assigner node (so it can be reused in the If / Else condition)
5) Use the output of InfraNodus (or the variable assigner output) to create a prompt that would enrich the original user's query in case it's too general
6) Run knowledge retrieval RAG to extract the most relevant statements
7) Use the output of the RAG search AND the original query AND the InfraNodus-generated insight about the material to generate another prompt that would answer the original query.
8) Output the results
You can try this chatbot here, or download a sample Dify workflow here.
Conclusion
RAG gets a major boost when you complement it with a high-level contextual map. InfraNodus is an easy way to create that map, helping your system handle both specific and more exploratory questions. When you use Dify to build your RAG apps, consider integrating metadata from InfraNodus to dramatically improve the clarity, structure, and coverage of your AI’s answers.