Skip to content

fix: add structured metadata filtering to CZI dataset search#6

Open
LiudengZhang wants to merge 1 commit intoGenentech:mainfrom
LiudengZhang:fix/czi-metadata-filtering
Open

fix: add structured metadata filtering to CZI dataset search#6
LiudengZhang wants to merge 1 commit intoGenentech:mainfrom
LiudengZhang:fix/czi-metadata-filtering

Conversation

@LiudengZhang
Copy link

What

Fix search_czi_datasets to actually use its organism and tissue filter parameters, and warn when filters are relaxed instead of silently dropping them.

Why

When the agent calls search_czi_datasets({"query": "lung, Mus musculus", "n_datasets": 5}), the top results are irrelevant (embryo and skin datasets) because:

  1. The docstring says "input is a string containing: tissue, condition, and organism", which tells the agent to pack everything into query and never pass organism/tissue separately.
  2. Even when filters are passed, they are silently skipped if the filtered set has fewer than n_datasets rows, with no warning.

How

  1. Updated the docstring and Field descriptions to instruct the agent to pass organism and tissue as dedicated parameters, keeping query for condition/context only.
  2. Replaced the silent filter drop with controlled relaxation: try organism+tissue first, fall back to organism-only, then to unfiltered. Each relaxation step includes a warning in the output so the agent knows the results are broader than requested.
  3. Updated the embedding cache key to reflect actually-applied filters (avoids stale cache hits when a filter was relaxed).

Closes #5

…enentech#5)

Update search_czi_datasets docstring and parameter descriptions to
instruct the agent to pass organism and tissue as dedicated parameters
instead of packing them into the query string. Replace silent filter
drop with controlled relaxation (organism+tissue -> organism-only ->
unfiltered) that includes a warning in the output when filters are
relaxed.
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.

Add structured metadata filtering to CZI dataset search

1 participant