Module: HTM::Jobs
- Defined in:
- lib/htm/jobs/generate_tags_job.rb,
lib/htm/jobs/generate_embedding_job.rb,
lib/htm/jobs/generate_propositions_job.rb,
lib/htm/jobs/generate_relationships_job.rb
Defined Under Namespace
Classes: GenerateEmbeddingJob, GeneratePropositionsJob, GenerateRelationshipsJob, GenerateTagsJob
Constant Summary collapse
- MIN_WEIGHT_THRESHOLD =
Background job to compute and upsert weighted edges between nodes.
Runs after GenerateTagsJob so the node’s tags are already present. For each node, finds all other nodes sharing at least one tag and computes Jaccard similarity as the edge weight:
weight = |tags(A) ∩ tags(B)| / |tags(A) ∪ tags(B)|Both directions are stored (A→B and B→A) so the CTE traversal only needs WHERE source_id IN (seeds) with a plain btree index hit.
Edges with weight below MIN_WEIGHT_THRESHOLD are skipped. At most MAX_EDGES_PER_NODE edges are created (highest-weight first).
0.1- MAX_EDGES_PER_NODE =
50