Skip to content

Multi-parent DAG: contains edges, ELK layered layout, cycle-safe add_parent API

Angelo › agent-memory › Phase 6: Web Visualizer Dashboard › Dashboard Redesign: From Viewer to Research Workbench

Type: Decision · Status: active · Created: 2026-06-10

Tags: dag,multi-parent,elk,contains-edges,cycle-detection,backend,frontend

Implemented multi-parent DAG support for the memory tree dashboard. Key design choices:

  • Backend emits contains edges as secondary has_child edges with deduplication. Entries gain a parent_ids array tracking all parents.
  • New POST /entries/{entry_id}/parents endpoint with project-scoped cycle detection (BFS from target, only following edges within the same project) and duplicate-edge guard (409 on re-add).
  • Frontend TreeView switched from mrtree to ELK layered algorithm to handle DAG topology correctly.
  • Secondary edges rendered as dashed lines. Nodes with multiple parents show a DAG badge.
  • Path-walking logic (recentPath, selectedPath, filteredEntryIds) rebuilt to be DAG-aware using an edge-derived parentsOfMap instead of single-parent traversal.
  • get_entry children list and plan-report subtree traversal made DAG-aware via contains edges.
  • ClusterView also updated for DAG rendering.

Referenced files


Source: memory entry deci-08ff9c5e.