Skip to content

arch(knowledge): knowledge/memory_graph duplicates autobot_memory_graph — same Redis keys, incompatible entity type names #3612

@mrveiss

Description

@mrveiss

Problem

PRs #3608 and #3609 (issues #3385 and #3384) created a new knowledge/memory_graph/ package. During review it was discovered that autobot-backend/autobot_memory_graph/ already exists and:

  1. Shares the same Redis key namespace — both use memory:entity:{uuid}, memory:relations:out:{uuid}, memory:relations:in:{uuid} in Redis DB 1 (knowledge). Data written by one package is readable by the other but interpreted differently.

  2. Incompatible entity type naming:

    • autobot_memory_graph/core.py: uppercase — "BUG", "FEATURE", "CONVERSATION", "DECISION", "TASK", "USER", "SECRET", etc.
    • knowledge/memory_graph/schema.py: lowercase — "bug_fix", "feature", "conversation", "decision", "task", etc.

    FT.SEARCH queries from MemoryGraphQueryProcessor (PR feat(knowledge): memory graph semantic search — query processor and hybrid scoring (#3384) #3609) will return zero results for type-filtered queries against data written by the existing AutoBotMemoryGraph class, because @type:(bug_fix) won't match stored "BUG" values.

  3. Duplicate functionalityautobot_memory_graph already implements create_entity, create_relation, graph traversal, and hybrid search (with Ollama embeddings). The new packages re-implement the same layer.

Affected Files

Proposed Resolution

Option A (preferred): Extend autobot_memory_graph with the new Phase 1/2 capabilities from PRs #3608/#3609 rather than maintaining two packages. Migrate knowledge/memory_graph/ into autobot_memory_graph/. Normalise entity type names to a single convention (lowercase recommended — more Pythonic and consistent with ENTITY_TYPES frozensets).

Option B: Keep both packages but resolve the key/type collision by either namespacing keys differently or enforcing a single canonical type format.

Acceptance Criteria

  • Single canonical memory graph package
  • Single entity type naming convention throughout
  • FT.SEARCH type filters return correct results against stored data
  • Existing callers of autobot_memory_graph unbroken

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions