diff --git a/surfsense_backend/app/tasks/chat/stream_new_chat.py b/surfsense_backend/app/tasks/chat/stream_new_chat.py index 45899c2ef..99b6e8703 100644 --- a/surfsense_backend/app/tasks/chat/stream_new_chat.py +++ b/surfsense_backend/app/tasks/chat/stream_new_chat.py @@ -81,7 +81,8 @@ def format_mentioned_surfsense_docs_as_context( context_parts = [""] context_parts.append( "The user has explicitly mentioned the following SurfSense documentation pages. " - "These are official documentation about how to use SurfSense and should be used to answer questions about the application." + "These are official documentation about how to use SurfSense and should be used to answer questions about the application. " + "Use [citation:CHUNK_ID] format for citations (e.g., [citation:doc-123])." ) for doc in documents: diff --git a/surfsense_web/components/assistant-ui/markdown-text.tsx b/surfsense_web/components/assistant-ui/markdown-text.tsx index 5bc905645..a910b5739 100644 --- a/surfsense_web/components/assistant-ui/markdown-text.tsx +++ b/surfsense_web/components/assistant-ui/markdown-text.tsx @@ -90,10 +90,6 @@ function parseTextWithCitations(text: string): ReactNode[] { } const MarkdownTextImpl = () => { - // Reset citation counter at the start of each render - // This ensures consistent numbering as the message streams in - resetCitationCounter(); - return (