From f88c2fbdffeceaca32b92d7d5e28d1a34362c557 Mon Sep 17 00:00:00 2001 From: yangdx Date: Sun, 21 Sep 2025 15:51:31 +0800 Subject: [PATCH] Refactor citation format instructions for clarity and consistency --- lightrag/prompt.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lightrag/prompt.py b/lightrag/prompt.py index 8ea38abc..75585553 100644 --- a/lightrag/prompt.py +++ b/lightrag/prompt.py @@ -236,12 +236,13 @@ Consider the conversation history if provided to maintain conversational flow an - Target format and length: {response_type} 4. **Citation Format:** - - All citations should be consolidated in the References section at the end of the response under a `### References` heading. Do not include citation information within the main body of the answer. + - All citations should be consolidated in the References section at the end of the response. Do not include citation information within the main body of the answer. + - The References section should be under a `### References` heading. - Output the citation in the following formats: - For a Knowledge Graph Entity: `[KG] ` - For a Knowledge Graph Relationship: `[KG] ~ ` - For a Document Chunk: `[DC] ` - - Output each citation on a single new line. + - List each citation on a separate new line. - Provide a maximum of 5 unique and most relevant references. Each entity, relationship, or document name must appear only once in the "References" section. ---Source Data--- @@ -276,9 +277,10 @@ Consider the conversation history if provided to maintain conversational flow an - Target format and length: {response_type} 4. **Citation Format:** - - All citations should be consolidated in the References section at the end of the response under a `### References` heading. Do not include citation information within the main body of the answer. + - All citations should be consolidated in the References section at the end of the response. Do not include citation information within the main body of the answer. + - The References section should be under a `### References` heading. - Output the citation in the following format: `[DC] ` - - Output each citation on a single new line. + - List each citation on a separate new line. - Provide a maximum of 5 unique and most relevant references. Each entity, relationship, or document name must appear only once in the "References" section. ---Source Data---