Skip to content

feat: structure-aware retrieval scoring using knowledge graph #66

@salishforge

Description

@salishforge

Summary

Incorporate knowledge graph relationships into retrieval ranking. A memory that connects to entities mentioned in the query should rank higher than one with equal text similarity but no graph connections.

Design

After standard retrieval (FTS/semantic/hybrid), apply a graph-aware boost:

  • Extract entity names from the query (regex: capitalized multi-word, known entity names)
  • For each result, check how many of its linked entities overlap with query entities
  • Apply multiplicative boost: score *= (1 + 0.2 * entity_overlap_fraction)
  • Zero LLM cost — uses existing warm_tier_entities + entities tables

Inspiration

Adapted from FABLE (arXiv 2601.18116) structure-aware propagation S(v) = 1/3[S_sim + S_inh + S_child]. Simplified to use MemForge's existing knowledge graph instead of document trees.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestperformancePerformance improvements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions