Skip to content

Redundant Data Retrieval #108

@hshang315

Description

@hshang315

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

  1. User asks: "Plot SR beam current and SR correctors from 10/10/25 to 10/12/25"
  2. Framework retrieves data from archiver → creates plot successfully
  3. User asks: "Please make the correlation plot between the SR correctors and SR beam current"
  4. Framework correctly remembers the time range (10/10/25 to 10/12/25)
  5. 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:

  1. Cache retrieved archiver data in the conversation state
  2. Check if requested channels and time range overlap with previously fetched data
  3. Only fetch new data for channels/time ranges not already in cache
  4. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions