-
-
Notifications
You must be signed in to change notification settings - Fork 1
arch(knowledge): knowledge/memory_graph duplicates autobot_memory_graph — same Redis keys, incompatible entity type names #3612
Description
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:
-
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. -
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 existingAutoBotMemoryGraphclass, because@type:(bug_fix)won't match stored"BUG"values. -
Duplicate functionality —
autobot_memory_graphalready implementscreate_entity,create_relation, graph traversal, and hybrid search (with Ollama embeddings). The new packages re-implement the same layer.
Affected Files
autobot-backend/autobot_memory_graph/— existing package (Issue refactor: Split autobot_memory_graph.py into modular package #716, 2,104-line refactor)autobot-backend/knowledge/memory_graph/graph_store.py— new (PR feat(knowledge): Redis memory graph schema — entity/relation indexes and chat integration (#3385) #3608)autobot-backend/knowledge/memory_graph/schema.py— new (PR feat(knowledge): Redis memory graph schema — entity/relation indexes and chat integration (#3385) #3608)autobot-backend/knowledge/memory_graph/query_processor.py— new (PR feat(knowledge): memory graph semantic search — query processor and hybrid scoring (#3384) #3609)autobot-backend/knowledge/memory_graph/hybrid_scorer.py— new (PR feat(knowledge): memory graph semantic search — query processor and hybrid scoring (#3384) #3609)
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_graphunbroken