Replies: 1 comment
-
|
Dify supports querying multiple knowledge bases (like Persian and English) simultaneously using the Knowledge Retrieval node in "multiWay" mode. This lets you merge and rerank results from both sources automatically—just select both datasets and enable reranking for best relevance. You can also use metadata filtering to target specific document segments or leverage your four-column structure for more precise retrievals. The output is an array of objects (with content and metadata) that you can further process downstream. If you need more control (for example, custom merging, translation, or formatting), use a Code or Template Transformer node after retrieval. These nodes let you script how to combine, translate, or synthesize the results before passing them to the LLM for final reasoning. Translation isn't handled natively in retrieval or merging, so add a translation step (via LLM or code) after merging and before synthesis if needed. The Variable Aggregator node does not merge multiple retrieval results by default; use a Code node to concatenate arrays if you want to combine outputs from separate retrieval nodes. Dify is also working on features to make multi-source context binding even easier in the future. For your workflow: use multiWay retrieval with reranking for simplicity, or combine retrieval nodes with a Code/Template node for custom logic and translation. Metadata filtering can help you target the right segments in your four-column structure. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
Content
Hi Dify Team,
I am developing an academic assistant called "Mora" and I have a specific architectural question regarding Workflow design.
The Goal: I want to create a workflow that queries two separate knowledge bases—one containing Persian documents and the other English documents—simultaneously. The final response should be a synthesized answer that extracts and translates the best insights from both languages to provide a comprehensive result to the user.
Our Preprocessing Methodology: To ensure high retrieval accuracy, we use a unique "Four-Column Preprocessing" strategy for all our documents (both languages):
Executive Summary: A concise overview of the segment.
Structural Headings: Metadata mapping the document's hierarchy (Heading 1, 2, etc.) to maintain context.
Keywords: Core concepts and terms extracted for high-precision vector search.
Original Text: The raw, high-fidelity content for final reasoning.
The Question: In Dify Workflows, what is the best approach to "merge" or "rank" findings from these two multilingual sources? Should I use a Multiple Retrieval node followed by a Template Transformer, or is there a more efficient way to let the LLM reason across these multi-layered (four-column) segments from different languages?
Looking forward to your professional guidance.
Beta Was this translation helpful? Give feedback.
All reactions