mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
feat: Add timestamps to historical prompts within the context #5486
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @CookSleep on GitHub (Jun 9, 2025).
Check Existing Issues
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.
@CookSleep commented on GitHub (Jun 13, 2025):
Alright, I still managed to make one myself, but since Open WebUI doesn't provide the
chat_idof 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