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
containsedges as secondaryhas_childedges with deduplication. Entries gain aparent_idsarray tracking all parents. - New
POST /entries/{entry_id}/parentsendpoint 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
mrtreeto ELKlayeredalgorithm 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
parentsOfMapinstead of single-parent traversal. get_entrychildren list and plan-report subtree traversal made DAG-aware via contains edges.- ClusterView also updated for DAG rendering.
Referenced files¶
memory/dashboard/backend/routes.py@b00b7cfmemory/dashboard/frontend/src/types.ts@b00b7cfmemory/dashboard/frontend/src/components/TreeView.tsx@b00b7cfmemory/dashboard/frontend/src/components/EntryNode.tsx@b00b7cf
Source: memory entry deci-08ff9c5e.