使用 InfraNodus 为 Dify RAG 提供支持:扩展 LLM 的上下文

使用 InfraNodus 为 Dify RAG 赋能:扩展 LLM 的上下文

最后更新时间 发表于 2025-03-27

著者:Dmitry Paranyushkin(InfraNodus創設者)

搜索扩展生成 (RAG) 是一种向大型语言模型 (LLM) 提供来自 Dify 知识库和文档的附加信息的有效方法。 然而,许多 RAG 系统缺乏“大局观”,导致答案不充分,尤其是对于广泛的问题。

集成到 Dify RAG 系统时,InfraNodus 有什么作用?

InfraNodus 通过从 PDF 和文本等各种内容中提取关键主题、相关性和信息的空白区域,将全局可视化。 通过将这些信息集成到 Dify 中,将有可能从 AI 中获得更深入、更广泛的答案。

主要优点:

  • 通过了解整个上下文来提高响应准确性
  • 从庞大的知识库中高效提取主题
  • 为高级抽象问题提供元数据

如何改进 RAG 管道

传统的 RAG 管道对于精确问题很有效,但它们对模糊或一般的查询提出了挑战。 通过利用 InfraNodus 的 Graph AI Prompt Generator,您可以实现以下改进:

  1. 将知识库元数据添加到提示
  2. 在搜索阶段加深对上下文的理解
  3. LLMが重要な概念を網羅的に考慮

具体示例

这一次,聊天流将分为两个版本:一个是连接到一般知识库文档的标准版本,另一个是使用 InfraNodus 特定主题数据通过 RAG 增强的版本。

IN-2.png

  • 对于标准 RAG,只需回答功能的一个方面“
    InfraNodus 能做什么”这个问题。

    InfraNodus-1.png

  • 对于 InfraNodus 集成的 RAG:通过添加
    主要主题(图形分析、AI 工作流程、想法探索等)及其与提示的关系(试用舔),根据工具的全部范围生成系统答案

    IN_3.png

用法

1. 数据收集

  • 目标内容:PDF/Markdown 文件
  • Webサイトの場合はFirecrawl(cloud or open-source)を活用
  • InfraNodus 可以直接从各种数据源(Google 搜索、RSS、YouTube 字幕等)导入
    1.png

2. 文本分析

  1. 可视化与分析:将文本上传到InfraNodus
  2. 浏览分析结果:从 Analytics 面板中识别“关键概念”、“高影响力概念”、“相关性”和“盲点”。 手动保存或让 Graph AI 生成自动摘要。
  3. RAG 提示生成:单击项目说明中的从 Analytics 生成 RAG 提示,以提取用于改进 Dify 中的 RAG 提示的数据。
  4. 深入分析(可选):识别“结构差距”,通过删除表面节点来提取隐藏的想法,或使用 InfraNodus API 实现自动化。

2.png

3. AI 工具设置

  • 在 Dify 上创建新知识库
  • 使用 Firecrawl API 上传文件或将其导入网站

3.png

4. 提示增强

  • 将 InfraNodus 生成的数据(例如,关键主题/关系)嵌入到自定义 Dify 提示中
  • 系统提示示例:

Copied!

You are an expert in InfraNodus, and your task is to provide an answer to the user question based on the context you are provided about using InfraNodus and its tool.
## IMPORTANT INSTRUCTIONS, FOLLOW WHEN ANSWERING:
When you provide a response, use the following meta information about the underlying knowledge base to have a high-level overview of the content and to provide higher quality responses that integrate this content, in cases when relevant to the query (or when the query is too general to find results):
- the main topics in the context (listed inside the  XML tag) — you should focus on them especially
- relations between the concepts (listed inside  and  XML tag) — these are the most important ideas and relations in the context
- latent topics inside (listed inside  - these are non-obvious topics that you can take into account
- conceptual entry points (listed inside  XML tag) — use them to connect topics or to connect the knowledge to the outside world

1. Graph Dynamics: graph topic node word click setting show knowledge
2. AI Workflow: infranodus text network ai data analysis workflow base
3. Idea Exploration: idea generate gap research insight discourse develop interesting
4. Search Context: search context related google keyword result import market
5. Node Relations: occur sharing information retrieve
6. Text Analysis: main content relevant extract reveal create skip

structural gap
network analysis
topical cluster

1. Conceptual Navigation: top concept cluster click menu setting statement analytics
2. Data Integration: search data research keyword import step google result
3. Insight Discovery: generate gap insight interesting find identify question specific
4. Network Strategy: network analysis use gpt base tool knowledge visualization
5. Analytical Display: discourse context structure analyze market connection term develop
6. Research Import: content main create extract reveal skip
7. Gap Identification: workflow 🎥 thinking case study start exploration tutorial
8. Knowledge Exploration: related article book product conversation original
9. Contextual Analysis: occur information sharing retrieve

retrieve, occur, influence, recommendation, node, search, setting, word, text, network, click, case, show

## CONTEXT INFORMATION:
Use the following context as your learned knowledge, inside  XML tags.

{{#context#}}

Do not hallucinate answers, ONLY use the context provided to generate responses, and provide references to all the context elements you use for your response in inline links with links to the URLs where these results can be found .
If you didn't use any of the context documents to generate your response but generated it from your own knowledge, inform the user about it at the beginning.
Keep your answers VERY SHORT and concise. Only the minimum necessary.

查询增强和优化技术

如果您提出一般性问题,则可能无法将其直接映射到单个知识库。 要解决这种情况,您可以在 Dify 聊天流中添加改进步骤。 通过整合 InfraNodus 的广泛洞察,我们消除了搜索扩展生成 (RAG) 搜索阶段的猜测。

enhance.png

以下是一些提示,可帮助您具体化用户改进步骤:

Copied!

You receive a user query relating to InfraNodus text network analysis tool.
If the user query is specific, you just pass it on without changing anything.
However, if it's too general or not too precise, you need to make it more specific by adding the following context to it.
IMPORTANT: Make sure the final query is not much longer than the original one. Just add only the most important necessary information.
## CONTEXT TO ADD
### Context Explanation:
- the main topics in the context (listed inside the  XML tag) — you should focus on them especially
- relations between the concepts (listed inside  and  XML tag) — these are the most important ideas and relations in the context
- latent topics inside (listed inside  - these are non-obvious topics that you can take into account
- conceptual entry points (listed inside  XML tag) — use them to connect topics or to connect the knowledge to the outside world
### Context Details:

1. Graph Dynamics: graph topic node word click setting show knowledge
2. AI Workflow: infranodus text network ai data analysis workflow base
3. Idea Exploration: idea generate gap research insight discourse develop interesting
4. Search Context: search context related google keyword result import market
5. Node Relations: occur sharing information retrieve
6. Text Analysis: main content relevant extract reveal create skip

structural gap
network analysis
topical cluster

1. Conceptual Navigation: top concept cluster click menu setting statement analytics
2. Data Integration: search data research keyword import step google result
3. Insight Discovery: generate gap insight interesting find identify question specific
4. Network Strategy: network analysis use gpt base tool knowledge visualization
5. Analytical Display: discourse context structure analyze market connection term develop
6. Research Import: content main create extract reveal skip
7. Gap Identification: workflow 🎥 thinking case study start exploration tutorial
8. Knowledge Exploration: related article book product conversation original
9. Contextual Analysis: occur information sharing retrieve

retrieve, occur, influence, recommendation, node, search, setting, word, text, network, click, case, show

处理速度优化方法

enhanceplus.png

Dify Chatflow 优化结构:

  1. 发起用户交互
  2. If/ElseノードがInfraNodus変数を判定
  3. 如果变量为空,则发出 InfraNodus 请求
  4. Save to Assign Variable 节点
  5. 查询扩展提示生成
  6. 执行知识搜索 RAG
  7. 通过集成搜索结果、原始查询和分析结果来生成答案
  8. 最终结果输出

单击此处获取尝试实时演示的链接,或单击此处下载示例工作流程。

結論

为了充分利用您的 RAG,必须在 InfraNodus 中创建上下文地图。 将有可能回答具体和探索性问题,并且 Dify 应用程序的答案质量(清晰度、结构和全面性)将得到显着提高。

ifyJapan%2Fitems%2F44299efddc2e456a796f%3Futm_campaign%3Dpopular_items%26utm_medium%3Dfeed%26utm_source%3Dpopular_items&realm=qiita)

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇