Skip to content

Search: --source-boost flag for relevance tuning #242

Closed

Description

@hurttlocker

Problem

Imported documentation sometimes loses to runtime noise in search results. Example: cortex search 'Cortex vs Mem0' returns SOUL.md length rule (0.854) above the actual competitive analysis from imported docs (0.849). The score difference is tiny but the intent is clearly wrong.

Solution

Add a --source-boost <prefix> flag that applies a configurable multiplier to results matching the source prefix.

Design

  • Multiplier applied at the source-weight stage in internal/search/search.go
  • Does NOT touch core BM25/semantic fusion math
  • Composable: --source-boost file: weights imported files, --source-boost github: weights connector results
  • Default multiplier: 1.5x (configurable via flag or config.yaml)

Acceptance Criteria

  • New --source-boost flag in runSearch CLI command
  • Multiplier logic in internal/search/search.go (source-weight stage only)
  • MCP tool cortex_search also accepts sourceBoost parameter
  • Tests: boosted results rank higher, unboosted unchanged, edge cases (no matches, empty prefix)
  • No breaking changes to existing search behavior when flag is omitted

Assignee

x7 — P1 after config resolver ships

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions