Skip to content

Add Hybrid Search: Combine Vector similarity with keyword/tag matching #52

@kornelrabczak

Description

@kornelrabczak

Problem

Currently, the only search mechanism available is vector-based semantic search using the content of memory notes stored in LadybugDB. While this works well for semantic similarity, it has limitations:

  • Exact keyword matches may be missed if the semantic meaning differs
  • Tags and keywords stored on notes are not utilized for search ranking
  • Results may miss relevant notes that contain specific terms the user is looking for

Proposed Solution

Implement a hybrid search approach that combines:

  1. Vector search (semantic similarity via embeddings)
  2. Keyword/tag fuzzy search (text matching on keywords[] and tags[] arrays)

Score Fusion Algorithm

Use weighted score combination:
finalScore = (vectorScore * vectorWeight) + (keywordScore * keywordWeight)
Default weights: vectorWeight = 0.7, keywordWeight = 0.3

Matching Strategy

Use contains match (case-insensitive partial matching) via Cypher CONTAINS operator:

  • keywords array: match if any element contains the search term
  • tags array: match if any element contains the search term

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.1.xIssues for the 0.1 releaseenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions