-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
Redundant Data Retrieval for Previously Fetched Time Ranges
Problem
The framework always retrieves data from the archiver/SDDS even when the same data for the same time range has already been retrieved earlier in the conversation. This causes unnecessary API calls and delays, especially for large time ranges or multiple channels.
Current Behavior
- User asks: "Plot SR beam current and SR correctors from 10/10/25 to 10/12/25"
- Framework retrieves data from archiver → creates plot successfully
- User asks: "Please make the correlation plot between the SR correctors and SR beam current"
- Framework correctly remembers the time range (10/10/25 to 10/12/25)
- But it retrieves the same data again from the archiver instead of reusing the previously fetched data
The framework is smart enough to remember the time range context, but it doesn't reuse the already-retrieved data.
Expected Behavior
The framework should:
- Cache retrieved archiver data in the conversation state
- Check if requested channels and time range overlap with previously fetched data
- Only fetch new data for channels/time ranges not already in cache
- Reuse cached data when the same channels and time range are needed for follow-up analysis (e.g., correlation plots, different visualizations)
Suggested Implementation
- Add a data cache to the conversation state that stores:
- Channel name
- Time range (start, end)
- Retrieved data (DataFrame or similar)
- Before calling archiver API, check cache for overlapping data
- Implement cache invalidation strategy (e.g., time-based or explicit refresh)
Impact
- Reduced API calls to archiver appliance
- Faster response times for follow-up queries
- Lower load on archiver infrastructure
Metadata
Metadata
Assignees
Labels
No labels