SlidePub
Home
Categories
Login
Register
Home
General
這一隻D I F Y知識庫R A G的工作流等等的DS L檔案內部的程式碼的說明
這一隻D I F Y知識庫R A G的工作流等等的DS L檔案內部的程式碼的說明
KevinLiu425163
8 views
8 slides
Sep 13, 2025
Slide
1
of 8
Previous
Next
1
2
3
4
5
6
7
8
About This Presentation
講解這一隻D I F Y知識庫R A G的工作流的DS L檔案內部的程式碼的說明幫我講解有幾個圖幾個編輯幾個點節點執行什麼功能等等
Size:
36.47 KB
Language:
none
Added:
Sep 13, 2025
Slides:
8 pages
Slide Content
Slide 1
Dify 知識庫 RAG 工作流 DSL 解讀 線性管線:start → kb → llm → answer(8頁摘要,不刪減重點內容)
Slide 2
快速總覽 Graph 節點(nodes):4 個 1) start 2) kb(Knowledge Retrieval) 3) llm 4) answer Graph 邊(edges):3 條 start → kb(id: e-start-kb) kb → llm(id: e-kb-llm) llm → answer(id: e-llm-answer) 資料流:使用者 query ⇒ sys.query ⇒ kb.result ⇒ llm.text ⇒ Answer
Slide 3
節點(1)Start / (2)Knowledge Retrieval:總覽 Start(type: start) • 將使用者輸入掛在 sys.query,無自訂變數。 Knowledge Retrieval(id: kb,type: knowledge-retrieval) • 綁定單一知識庫(dataset_ids 只有一個)。 • 查詢來源:query_variable_selector = [start, sys.query]。 • 檢索模式:retrieval_mode = multiple(混合檢索)。
Slide 4
Knowledge Retrieval:混合檢索與重排 multiple_retrieval_config: • top_k: 6(先取 6 個候選片段)。 • reranking_enable: true;reranking_mode: weighted_score。 • 權重:vector_weight 0.7、keyword_weight 0.3。 • 向量嵌入模型:nomic-embed-text(provider: langgenius/ollama/ollama)。 • score_threshold: null(不設門檻)。 • reranking_model 留空(無額外學習式 re-ranker)。 輸出:檢索的上下文片段出現在 kb.result。
Slide 5
節點(3)LLM / (4)Answer LLM:gemini-2.0-flash-lite(provider: langgenius/gemini/google) • 生成參數:temperature 0.3、top_p 1。 • context.enabled = true;variable_selector = [kb, result](使用 kb.result)。 • memory.window.enabled = false(不帶對話記憶)。 • prompt_template: — system:Zemax OpticStudio (ZOS) API 專家;只能根據檢索上下文作答; 結構化回答(摘要→步驟/API→可執行碼→注意事項→延伸閱讀); 語言優先順序與 API 命名規範明確。 — user:{{#sys.query#}}(把使用者原始問題帶入)。 Answer:answer = {{#llm.text#}}(直接回傳 LLM 的文字輸出)。
Slide 6
邊(Edges)與 App/環境設定要點 Edges(皆 type: custom,isInIteration: false): • start → kb:將 sys.query 送入檢索。 • kb → llm:將 kb.result 餵給 LLM。 • llm → answer:將 llm.text 輸出為答案。 App 基本:name = ZOS-API known-good (RAG);mode = advanced-chat;單一路徑。 Dependencies: • langgenius/ollama:0.0.7(供 embedding:nomic-embed-text)。 • langgenius/gemini:0.4.1(供 LLM:Gemini 2.0 flash-lite)。 Features:retriever_resource.enabled = true;檔案上傳/STT/TTS/敏感詞/建議問題:disabled。 變數:conversation_variables / environment_variables 皆為空。
Slide 7
一圖看懂(ASCII)與執行流程 ASCII: [ Start ] │ (sys.query) ▼ [ Knowledge Retrieval (kb) ] - hybrid: vector(0.7)+keyword(0.3), top_k=6 - embedding: nomic-embed-text via Ollama │ (kb.result) ▼ [ LLM: gemini-2.0-flash-lite ] - context = kb.result - temp=0.3, no memory window - strict RAG system prompt │ (llm.text) ▼ [ Answer ] 實際流程: 1) 使用者輸入 → 形成 sys.query。 2) kb 做向量+關鍵字混檢與加權重排(top_k=6,0.7/0.3)。 3) 排序片段(kb.result)注入 LLM(無對話記憶)。 4) LLM 依 system 規則產生結構化回答 → Answer 輸出。
Slide 8
常見調整點(可調參數)與結論 常見調整點: • top_k(召回廣度),例:6→8/10。 • 權重:vector_weight / keyword_weight。 • score_threshold 設定門檻(如 0.3)。 • LLM 生成風格:temperature。 • 記憶:開啟 memory.window 並設 size。 • 外部 re-ranker:補上 reranking_model provider/model。 結論:單資料集、混合檢索、嚴格依賴上下文的 RAG;4 節點、3 邊、單一路徑,易於維護與調參。
Tags
Categories
General
Download
Download Slideshow
Get the original presentation file
Quick Actions
Embed
Share
Save
Print
Full
Report
Statistics
Views
8
Slides
8
Age
79 days
Related Slideshows
22
Pray For The Peace Of Jerusalem and You Will Prosper
RodolfoMoralesMarcuc
30 views
26
Don_t_Waste_Your_Life_God.....powerpoint
chalobrido8
32 views
31
VILLASUR_FACTORS_TO_CONSIDER_IN_PLATING_SALAD_10-13.pdf
JaiJai148317
30 views
14
Fertility awareness methods for women in the society
Isaiah47
29 views
35
Chapter 5 Arithmetic Functions Computer Organisation and Architecture
RitikSharma297999
26 views
5
syakira bhasa inggris (1) (1).pptx.......
ourcommunity56
28 views
View More in This Category
Embed Slideshow
Dimensions
Width (px)
Height (px)
Start Page
Which slide to start from (1-8)
Options
Auto-play slides
Show controls
Embed Code
Copy Code
Share Slideshow
Share on Social Media
Share on Facebook
Share on Twitter
Share on LinkedIn
Share via Email
Or copy link
Copy
Report Content
Reason for reporting
*
Select a reason...
Inappropriate content
Copyright violation
Spam or misleading
Offensive or hateful
Privacy violation
Other
Slide number
Leave blank if it applies to the entire slideshow
Additional details
*
Help us understand the problem better