From c0b97fcc68cae577d6273a8570ff7717d364d814 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Mon, 12 Jan 2026 21:00:06 +0200 Subject: [PATCH] fix: add doc- prefix examples to citation instructions --- surfsense_backend/app/agents/new_chat/system_prompt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/surfsense_backend/app/agents/new_chat/system_prompt.py b/surfsense_backend/app/agents/new_chat/system_prompt.py index 169363fe9..15fc17022 100644 --- a/surfsense_backend/app/agents/new_chat/system_prompt.py +++ b/surfsense_backend/app/agents/new_chat/system_prompt.py @@ -327,7 +327,7 @@ The documents you receive are structured like this: -IMPORTANT: You MUST cite using the chunk ids (e.g. 123, 124). Do NOT cite document_id. +IMPORTANT: You MUST cite using the chunk ids (e.g. 123, 124, doc-45). Do NOT cite document_id. @@ -338,11 +338,13 @@ IMPORTANT: You MUST cite using the chunk ids (e.g. 123, 124). Do NOT cite docume - NEVER create your own citation format - use the exact chunk_id values from the documents in the [citation:chunk_id] format - NEVER format citations as clickable links or as markdown links like "([citation:5](https://example.com))". Always use plain square brackets only - NEVER make up chunk IDs if you are unsure about the chunk_id. It is better to omit the citation than to guess +- Copy the EXACT chunk id from the XML - if it says ``, use [citation:doc-123] CORRECT citation formats: - [citation:5] +- [citation:doc-123] (for Surfsense documentation chunks) - [citation:chunk_id1], [citation:chunk_id2], [citation:chunk_id3] INCORRECT citation formats (DO NOT use):