Repository navigation
Description
Problem
When processing a corpus of interlinked markdown documents, Graphify's semantic extraction relies entirely on the LLM to infer relationships. However, markdown files often contain explicit, human-authored links ([text](path.md)) that represent high-confidence relationships between documents.
In our test with 1,256 Intercom help articles:
- 2,905 nodes extracted, but 1,636 (56%) are isolated (≤1 connection)
- Many of these articles link to each other via standard markdown links
- The LLM-based extraction misses these because it focuses on conceptual entity extraction, not syntactic link parsing
These human-authored links are arguably the highest-quality relationship signal in a documentation corpus — someone deliberately said "this article relates to that article."
Proposed Solution
Add a deterministic pre-pass that extracts markdown links as edges before/alongside LLM semantic extraction:
-
Regex/parser scan of all
.mdfiles for:- Standard links:
[link text](relative/path.md) - Wikilinks:
[[page-name]](if applicable) - Relative URL references between files in the corpus
- Standard links:
-
Emit edges with the existing schema:
{ "source": "article_a_id", "target": "article_b_id", "relation": "links_to", "confidence": "EXTRACTED", "confidence_score": 1.0, "source_file": "path/to/a.md", "source_location": "line or section where link appears" } -
Merge these edges into the graph in the same step where AST and semantic results are combined.
Design Considerations
- Link resolution: Relative paths need to resolve to actual files in the corpus. Unresolvable links (external URLs, broken references) could either be skipped or emitted with a lower confidence score.
- Link text as context: The anchor text (
[this text here](...)) often describes the relationship — could be stored as edge metadata. - Bidirectionality: A link from A→B is directional, but you might optionally infer a
linked_fromback-edge. - Deduplication: If the LLM also infers a relationship between the same two documents, the deterministic edge should take precedence (higher confidence).
- New relation type:
links_towould join the existing set (references,cites,conceptually_related_to, etc.).
Impact
For documentation-heavy corpora (help centers, wikis, technical docs), this could dramatically reduce isolated nodes and improve community detection quality — connecting clusters that the LLM extraction treats as separate because it processes files in batches without cross-file link awareness.
Prior Art
This is analogous to how the AST extraction handles imports in code — deterministic, structural relationships that don't need an LLM to identify.
Activity
feat: extract markdown links as first-class edges
feat(markdown): turn Markdown links into references edges (Graphify-L…
feat: extract markdown links as first-class edges