diff --git a/private_gpt/components/prompts/prompt_builder.py b/private_gpt/components/prompts/prompt_builder.py index f7665889..938db329 100644 --- a/private_gpt/components/prompts/prompt_builder.py +++ b/private_gpt/components/prompts/prompt_builder.py @@ -117,7 +117,12 @@ class PromptBuilderService: assistant_name=assistant_name or settings().chat.assistant_name, assistant_description=assistant_description or settings().chat.assistant_description, - current_date=current_date.astimezone().isoformat(), + # Use date-level granularity: a sub-second timestamp here changes on + # every request and sits at the front of the system prompt (before the + # guidelines and retrieved context), which defeats LLM prompt-prefix + # caching (e.g. OpenAI automatic prefix caching, local KV-cache reuse). + # The model only needs the calendar date for relative-date reasoning. + current_date=current_date.astimezone().date().isoformat(), ) def create_chat_context_for_system_prompt(