[Wiki] Add mermaid pathway diagrams to top 50 entity pages
Task ID: e64896e0-34af-42a3-89d5-97d15a2e6665
Goal
Add mermaid pathway/mechanism diagrams to the top 50 most-connected entities in the knowledge graph. Prior to this work, only 21 wiki entities had diagrams (3 of which were in the top 50). The task generates auto-generated diagrams from KG edges for the remaining 47 entities.
Acceptance Criteria
☑ Top 50 most-connected KG entities all have mermaid diagrams
☑ Diagrams stored in wiki_entities.mermaid_diagram column
☑ Entity pages render correctly at /entity/{name} with pathway diagram section
☑ Script handles missing wiki_entities rows (inserts with proper neurowiki_url)
☑ Entity types inferred from KG edge source_type/target_type when not in wiki_entities
Approach
Identified top 50 entities by edge count in knowledge_edges
Found 47 of 50 lacked mermaid diagrams
Fixed generate_mermaid_diagrams.py to:
- Include
neurowiki_url in INSERT (required NOT NULL column)
- Infer entity types from KG edge metadata when entity not in wiki_entities
Ran script to generate all 47 diagrams
Verified all 47 entity pages return HTTP 200 with mermaid contentWork Log
2026-04-02 — Slot 17
- Started task: add mermaid diagrams to top 50 entities
- Found 47 of top 50 missing diagrams, 46 not even in wiki_entities table
- Fixed generate_mermaid_diagrams.py: neurowiki_url NOT NULL constraint, entity type inference from KG edges
- Ran script: 47 generated, 3 skipped (already had diagrams)
- Verified: all 47 new entity pages return HTTP 200 with mermaid blocks
- Total entities with diagrams now: 68 (21 existing + 47 new)
- Result: Done