Skip to content

feat: keyword-match ranking in get_relevant_experience#3

Merged
Mola-maker merged 1 commit intomainfrom
feat/exp-similarity
Apr 20, 2026
Merged

feat: keyword-match ranking in get_relevant_experience#3
Mola-maker merged 1 commit intomainfrom
feat/exp-similarity

Conversation

@Mola-maker
Copy link
Copy Markdown
Owner

Previously returned the most recent N experience entries. Now ranks by keyword-match score (substring hits against problem/model_type/body), ties broken by recency. Query source priority:

  1. explicit 'query=' argument
  2. auto-derived from context.json (competition.keywords + selected_problem + problem_type + modeling.model_type)
  3. none -> falls back to old recency-first behavior

When a query yields zero matches across all entries, falls back to recency instead of suppressing history, so a noisy query never makes the injection worse than before.

Backward-compatible: existing callers that don't pass 'query' now benefit from context-derived matching when keywords are available, and get identical output to the old code when they aren't.

Previously returned the most recent N experience entries. Now ranks by
keyword-match score (substring hits against problem/model_type/body),
ties broken by recency. Query source priority:

  1. explicit 'query=' argument
  2. auto-derived from context.json (competition.keywords +
     selected_problem + problem_type + modeling.model_type)
  3. none -> falls back to old recency-first behavior

When a query yields zero matches across all entries, falls back to
recency instead of suppressing history, so a noisy query never makes
the injection worse than before.

Backward-compatible: existing callers that don't pass 'query' now
benefit from context-derived matching when keywords are available,
and get identical output to the old code when they aren't.
@Mola-maker Mola-maker merged commit d5f979e into main Apr 20, 2026
0 of 3 checks passed
@Mola-maker Mola-maker deleted the feat/exp-similarity branch April 20, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant