Skip to content

tech-debt(knowledge): TimingConstants missing cache TTL constants — embedding and search result caches use magic numbers #3614

@mrveiss

Description

@mrveiss

Problem

autobot-backend/knowledge/memory_graph/query_processor.py (PR #3609) defines:

_EMBEDDING_CACHE_TTL_SECONDS = 3600   # 1 hour
_RESULT_CACHE_TTL_SECONDS = 300        # 5 minutes

No matching constants exist in constants/timing_constants.py (introduced in issue #3549). These were left as local constants because there was no appropriate TimingConstants value to reference. Other files added in the same sprint use TTL_30_DAYS, TTL_24_HOURS, etc., but short-lived L2 cache TTLs (1h, 5min) are not represented.

Fix

Add to constants/timing_constants.py:

TTL_1_HOUR = 3600
TTL_5_MINUTES = 300

Then update query_processor.py (and any other files that hardcode these values) to import from TimingConstants.

Acceptance Criteria

  • TTL_1_HOUR and TTL_5_MINUTES added to timing_constants.py
  • query_processor.py updated to use the new constants
  • Audit for other files using raw 3600 or 300 as TTL values

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions