Replies: 2 comments
-
|
To add suggested questions in your Dify RAG system so that they're only extracted from the top retrieved chunks and answers are present in the text, enable the feature in your app config with To make sure suggested questions are strictly answerable from the retrieved text, customize the prompt logic in References: To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
What you’re running into is a pretty common failure mode in RAG systems — the model tends to propose “suggested questions” from a wider set of chunks than intended (semantic drift), instead of strictly limiting itself to the top-k retrieved context. The result is suggestions that look valid, but aren’t actually grounded in the retrieved text. A few practical checks that usually help: Make sure your top-k setting and Score Threshold are aligned, so you don’t accidentally allow too wide a retrieval scope. Add an explicit condition in the prompt logic (e.g. only generate suggestions that appear in the provided context). For stricter control, tag the retrieved chunks before they enter the LLM — this prevents the model from “inventing” outside of what was fetched. On our side, we’d classify this as No 11 semantic drift in retrieval. Having a small reproducible test case is often enough to confirm whether it’s the retriever leaking too much, or the LLM not following instructions. One additional approach some teams use is a kind of semantic firewall: instead of changing infrastructure, you add a lightweight semantic check layer in the pipeline to guarantee the suggestions stay inside the retrieved chunks. Would you find it useful if I sketched a minimal TXTOS test case you could throw at your setup to confirm where the drift happens? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
Content
How can I add suggested questions to my RAG system so that it only extracts questions from the top chunks that LLM has gone to, and the answers must be in the text.
Beta Was this translation helpful? Give feedback.
All reactions