You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
build_from_json crashes on edges with 'from'/'to' keys instead of 'source'/'target' #216
build_from_json in graphify/build.py crashes with KeyError: 'source' when edges use alternate key names like from/to instead of the expected source/target.
How to reproduce
When using LLM subagents (particularly smaller/faster models) for semantic extraction, they sometimes produce edges with {"from": "node_a", "to": "node_b", ...} instead of {"source": "node_a", "target": "node_b", ...}. This is a reasonable variation that the schema doesn't enforce at the subagent level.
When these edges reach build_from_json, line 45 does:
src, tgt=edge["source"], edge["target"]
This raises KeyError and crashes the entire graph build, losing all extraction work (including paid LLM tokens).
Expected behavior
build_from_json should normalize common alternate key names (from → source, to → target) before processing, and skip edges that are truly malformed (missing both variants).
Impact
Edges with valid relationships are silently lost or cause crashes
Smaller models (Sonnet, Haiku) are more likely to produce alternate key names
The crash happens after the expensive LLM extraction, so the token cost is wasted
Activity
fix bugs #211, #216, #217, #222 and bump to 0.4.2
safishamsi commentedon Apr 11, 2026
Fixed in v0.4.2. Edges using
from/tokeys are now normalized tosource/targetbefore processing, so they are no longer silently dropped.fix bugs Graphify-Labs#211, Graphify-Labs#216, Graphify-Labs#217, Gra…
fix bugs #211, #216, #217, #222 and bump to 0.4.2
fix bugs Graphify-Labs#211, Graphify-Labs#216, Graphify-Labs#217, Gra…