Subject: Issue with selecting multiple Context variables and File parsing in Chatflow (v1.13.0) #32695
Replies: 1 comment
-
|
Hi @Desmond-Hou! I'm Dosu and I’m helping the dify team. This is a known architectural limitation in Dify, not a bug. The LLM node's context field is designed to accept only a single variable selector, which explains why selecting one context replaces the other. Recommended Solution: Use a Template Node to merge your sources Restructure your workflow like this: The Document Extractor node is essential because most LLMs cannot process raw PDF/DOCX files directly — it converts your uploaded file to text. Then in the Template Node, use Jinja2 to combine both sources: ## Technical Specification (from Knowledge Base):
{% for item in KnowledgeRetrieval.result %}
{{ item.content }}
{% endfor %}
## Requirement Document (uploaded file):
{{ DocumentExtractor.text }}Pass the Template node's output to your LLM node's context field. Additional v1.13.0 Issues: You may also be experiencing a known regression where Knowledge Retrieval variables don't appear in downstream LLM node pickers. Try reconnecting nodes or renaming them if variables aren't visible. Note: Variable Aggregator nodes won't help here — they output only the first non-null value (fallback behavior), not a true merge. Use Template or Code nodes instead. To reply, just mention @dosu. Docs are dead. Just use Dosu. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
Content:
Hi everyone, I am a beginner with Dify (v1.13.0) and I am currently struggling with a Chatflow configuration.
My Goal: I want the LLM (DeepSeek) to analyze an uploaded Requirement Document and generate test cases based on a Technical Specification (stored in my Knowledge Base).
My Workflow:
Start Node (with a File variable) -> Knowledge Retrieval (linked to the Tech Spec KB) -> LLM Node (DeepSeek).
The Problems:
Context Variable Exclusion: In the LLM node's "Context" settings, I can only select either the Knowledge Retrieval result OR the File variable. Selecting one immediately replaces the other; I cannot place them side-by-side.
UI Grays Out: When editing System or User prompts, once I select a context variable, the selection menu grays out, preventing me from adding a second one.
LLM Perception Issue: When running the workflow, DeepSeek either claims the requirement document was never uploaded or it only interprets the Technical Specification from the KB, completely ignoring the actual document I provided.
I’ve tried seeking help from AI assistants like Gemini, which suggested that these variables should be able to sit side-by-side in the Context field, but I haven't been able to achieve this in the current UI. I’m quite frustrated and would appreciate any guidance on how to correctly pass both the KB context and the uploaded file content to the LLM simultaneously.
2. Additional context or comments
Beta Was this translation helpful? Give feedback.
All reactions