mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-11-13 06:40:51 +08:00
### Summary
1. The web UI default system prompt template reads "Your answer must be derived **solely** from this dataset: `{knowledge}`", but the reasoning path rendered {knowledge} as an empty string (kws["knowledge"] = "",
mirroring Python's kwargs.setdefault("knowledge", "")). Under some LLMs, the first-turn model read the empty binding as "the dataset is empty" and refused to call the rag tool at all.
2. [ID:Slot 0] — the compose model cited slot-table rows ("Research Summary" lines) as citations. No citation regex matched the form (Slot is non-numeric), so it passed through decoration untouched.
3. [ID:1-3] — the model occasionally compressed consecutive citations into a range. Range markers cannot be resolved to a single source and are not part of the citation format. Fixed at both layers:
- prompts (citation_prompt.md ): citations must be spelled out individually ([ID:1][ID:2][ID:3]); ranges are forbidden.
- decoration: ExpandRangeCitations expands [ID:a-b] (covering space, "~", fullwidth wave and em/en dash variants; a > b swapped) into per-item [ID:n] markers when both ends are within the pool.