Mnemosyne.Pipeline.Retrieval.TaggedCandidate (mnemosyne v0.1.6)

Copy Markdown View Source

Internal struct representing a scored candidate with its origin phase. Replaces raw {node, score} tuples in the retrieval pipeline.

Summary

Functions

Builds a tagged candidate from the initial retrieval phase (hop 0).

Builds a tagged candidate discovered during multi-hop traversal at the given hop depth.

Builds a tagged candidate from the provenance lookup phase.

Builds a tagged candidate from the query refinement phase at the given hop.

Types

t()

@type t() :: %Mnemosyne.Pipeline.Retrieval.TaggedCandidate{
  hop: non_neg_integer() | nil,
  node: struct(),
  phase: atom(),
  score: float()
}

Functions

from_hop_0(node, score)

@spec from_hop_0(
  struct(),
  float()
) :: t()

Builds a tagged candidate from the initial retrieval phase (hop 0).

from_multi_hop(node, score, hop)

@spec from_multi_hop(struct(), float(), non_neg_integer()) :: t()

Builds a tagged candidate discovered during multi-hop traversal at the given hop depth.

from_provenance(node, score)

@spec from_provenance(
  struct(),
  float()
) :: t()

Builds a tagged candidate from the provenance lookup phase.

from_refinement(node, score, hop)

@spec from_refinement(struct(), float(), non_neg_integer()) :: t()

Builds a tagged candidate from the query refinement phase at the given hop.