feat: Add timestamps to historical prompts within the context #5486

Open
opened 2025-11-11 16:22:24 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @CookSleep on GitHub (Jun 9, 2025).

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

During long-duration conversations, the LLM struggled to accurately pinpoint when messages were sent, leading to a somewhat disjointed conversational experience.

Desired Solution you'd like

Add timestamps to historical prompts within the context

Alternatives Considered

Using a function to inject timestamps into conversation responses can sometimes interfere with model output and make the conversation look messy. This method also cannot add timestamps to historical messages that have already occurred.

Many functions implementing this feature still have issues and cannot correctly set time zones.

Therefore, I believe the best approach is for Open WebUI to directly insert the corresponding timestamp at the beginning of the prompt for historical messages when a request is sent. This way, it neither affects the normal display of historical messages nor provides accurate time references for the model.

Additional Context

Perhaps this could be an optional account-level setting.

Originally created by @CookSleep on GitHub (Jun 9, 2025). ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description During long-duration conversations, the LLM struggled to accurately pinpoint when messages were sent, leading to a somewhat disjointed conversational experience. ### Desired Solution you'd like Add timestamps to historical prompts within the context ### Alternatives Considered Using a function to inject timestamps into conversation responses can sometimes interfere with model output and make the conversation look messy. This method also cannot add timestamps to historical messages that have already occurred. Many functions implementing this feature still have issues and cannot correctly set time zones. Therefore, I believe the best approach is for Open WebUI to directly insert the corresponding timestamp at the beginning of the prompt for historical messages when a request is sent. This way, it neither affects the normal display of historical messages nor provides accurate time references for the model. ### Additional Context Perhaps this could be an optional account-level setting.
Author
Owner

@CookSleep commented on GitHub (Jun 13, 2025):

Alright, I still managed to make one myself, but since Open WebUI doesn't provide the chat_id of historical messages in the parameters available for filters, this filter might not be very efficient and requires using the user's own JWT token to initiate API requests.

https://github.com/CookSleep/Time-Awareness-Filter-for-Open-WebUI

@CookSleep commented on GitHub (Jun 13, 2025): Alright, I still managed to make one myself, but since Open WebUI doesn't provide the `chat_id` of historical messages in the parameters available for filters, this filter might not be very efficient and requires using the user's own JWT token to initiate API requests. https://github.com/CookSleep/Time-Awareness-Filter-for-Open-WebUI
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#5486