Skip to content

Remove deprecated backward-compatibility methods in CacheDBInterface #2306

@Vasilije1990

Description

@Vasilije1990

Problem / Background

The CacheDBInterface in cognee/infrastructure/databases/cache/cache_db_interface.py contains three deprecated backward-compatibility methods with explicit :TODO: delete comments:

  • add_qa() (delegates to newer method)
  • get_latest_qa() (delegates to newer method)
  • get_all_qas() (delegates to newer method)

These methods add confusion and maintenance burden. The TODO comments indicate the maintainers intended to remove them.

Goal

Remove the deprecated methods and update any remaining callers to use the new API directly.

Proposed Solution

  1. Search for all callers of add_qa, get_latest_qa, get_all_qas:
rg "add_qa|get_latest_qa|get_all_qas" cognee/ --type py
  1. Update any callers to use the replacement methods
  2. Remove the deprecated methods from the interface and all implementations (RedisAdapter, FSCacheAdapter)

Acceptance Criteria

  • All three deprecated methods are removed from CacheDBInterface
  • All implementations (Redis, FS) are updated
  • All callers are migrated to the new API
  • Existing tests pass
  • ruff check . passes

Dependencies / Blockers

None — the TODO comments indicate this was already planned.

Relevant Links / Resources

  • File: cognee/infrastructure/databases/cache/cache_db_interface.py (lines ~56, ~87, ~98)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions