fix: search_business_context falls through to catalog when empty#63
Closed
shawnxiao105-afk wants to merge 1 commit into
Closed
Conversation
When all four business-context sub-searches return zero hits, the skill now also fires a dataset search by name and surfaces the results as a `catalog_fallback` key. This prevents the agent from treating "no governed documentation" as "entity doesn't exist in the catalog." The SKILL.md fallback was previously a soft footnote that the LLM did not reliably follow — verified locally that, with only a hint in the tool result, the agent would skip to the SQL engine's `list_tables` and hallucinate sample content. With the fallback wired into the implementation, the agent receives the URN and metadata directly and produces an accurate catalog summary. Closes datahub-project#61
Contributor
Author
|
Closing — reconsidering the approach; the fix is over-engineered for the scope. Will revisit with a smaller scope. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
search_business_contextreturns empty across all four sub-searches (documentation / glossary terms / domains / data products), the skill now fires a dataset search by name and includes the results ascatalog_fallback. The agent receives the URN and metadata directly instead of relying on the SKILL.md's soft fall-through guidance, which the LLM was not reliably following.What changes
_search_business_context_impl: factors out_all_results_empty; when true, firessearch(query=topic, filter="entity_type = dataset")and merges the results under acatalog_fallbackkey. A_followup_hintfield points the agent at it.search-business-context/SKILL.md: replaces the end-of-doc soft footnote with a labeled section describing the new auto-fallthrough. Includes a "do not calllist_tables" note — manual testing showed the LLM otherwise routes to the SQL engine and hallucinates sample content._all_results_empty.Test plan
uv run pytest tests/unit/test_skill_business_context.py— 4 passeduv run ruff checkclean on the touched filesdatahub docker quickstart: asking "tell me about SampleHiveDataset" now produces a correct catalog summary (URN, platform Hive, owners, Legacy tag) instead of the "doesn't exist" answer documented in Agent says dataset "doesn't exist" when there's no docs for it #61. The LLM still occasionally calls SQL engine tools afterward, but the primary answer is grounded in real catalog metadata.Closes #61