Skip to content

Seeding ignores node attributes, so content stored on a node is unreachable by query #3313

Open

Description

@vongohren

Summary

_score_query / _pick_seeds score nodes on their label and source path only. Arbitrary node attributes are never considered, so content stored on a node is invisible to seeding — the node can never become a seed, is therefore never traversed, and no amount of budget or reranking downstream can reach it.

This is a gap rather than a defect, but it has a sharp consequence for any emitter that puts text on a node, which is a natural thing to do.

What we hit

We emit Confluence pages and Jira issues as nodes and (recently) store the page body / issue description as a body attribute, capped. Retrieval question: "CSCA Master List". The page that answers it is titled "Masterlist/Certificate controls" — the string "CSCA" appears only in its body, and exactly one node in a ~25k-node graph has "CSCA" in its label (an unrelated ticket).

Result: the page is not in the returned window at any budget, because _pick_seeds never sees the body and the page is never seeded or traversed. Storing the text bought nothing on its own.

Where

graphify/serve.py, _score_query — the per-node visit reads:

norm_label = data.get("norm_label") or _strip_diacritics(data.get("label") or "").lower()
bare_label = norm_label.rstrip("()")
label_tokens = " ".join(_search_tokens(data.get("label") or ""))
# ... plus `source` (source_file)

No other data key is consulted.

What would help

Any of these would close it, roughly in increasing order of effort:

  1. An opt-in list of additional attributes to score, e.g. GRAPHIFY_SEED_ATTRS=body,summary or a seed_attributes field in the build config — scored at a lower weight than the label, since a match in a title is much stronger evidence than a match in paragraph seven.
  2. A documented convention for a "searchable text" attribute that _score_query includes if present.
  3. At minimum, documenting that seeding is label-and-path only, so emitter authors know that node attributes are inert for retrieval and can plan accordingly.

Option 1 with a field weight is what we ended up implementing on our side (a small body-seeding pass plus BM25F-style field weighting — a body match worth ~0.35 of a title match). Weighting mattered: at parity, adding body text made retrieval measurably worse, because a few hundred characters of prose matches many query terms and pages that merely mention the words tie with the page that is about them.

Not asking you to adopt our shape — just flagging that the seeding-ignores-attributes behaviour is easy to hit and expensive to diagnose, since everything looks correct (the data is in the graph, the ranker is fine) and the node is simply never visited.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions