Add in-repo hypaware-query skill with graph-vs-raw query routing guidance#290
Open
philcunliffe wants to merge 1 commit into
Open
Add in-repo hypaware-query skill with graph-vs-raw query routing guidance#290philcunliffe wants to merge 1 commit into
philcunliffe wants to merge 1 commit into
Conversation
…ance Brings the hypaware-query agent skill into the repo (per the tooling-lives-in-repo convention) and extends it with context-graph routing guidance distilled from a 15-query empirical comparison of the graph route (node/edge datasets, hyp graph neighbors) against raw ai_gateway_messages SQL: - A generic routing rule: route to the graph when the answer is a set of identifiers, the predicate is derived rather than stored, the question crosses 2+ relationships, it is an inventory question, or identity needs normalizing; route to raw for counts, content, ordering, and row-level attributes. - A two-stage strategy (graph picks the scope, raw reads inside it) with the graph-to-content drill-down recipe (Session natural_key = session_id; tool_result_for pairs results to calls; message_index windows for context). - Raw-route footguns found during the evaluation: LIKE on JSON-typed columns silently matches nothing, json_extract throws on malformed rows without a tool_name pre-filter, correlated IN subqueries can run past 2 minutes, and session identity is session_id (not the mostly-null conversation_id). - Graph caveats: File-node identity splits between repo-scoped and absolute keys, neighbors prints display-truncated node ids and ignores --format json, and SQL over edge tables needs literal node_id anchors to avoid pathological join plans. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
Brings the
hypaware-queryagent skill into the repo under.claude/skills/(the tooling-lives-in-repo convention, so every clone has it) and extends it with guidance on when agents should route a question through the context graph (node/edgedatasets,hyp graph neighbors) versus rawai_gateway_messagesSQL.Why
Agents querying HypAware data underuse the graph, falling back to slow and fragile scans over the messages table. The new guidance was distilled from an empirical comparison of 15 query types run both ways against a live install (143k-row messages table, 5.4k-node graph). Headline findings baked into the skill:
graph neighbors --depth 2in 0.17s either threw (malformedtool_argsrow) or ran past a 2-minute timeout as a correlated raw subquery.LIKEon the JSON-typedtool_args/attributescolumns matches zero rows without erroring;json_extractthrows on a malformed row unless pre-filtered bytool_name; session identity issession_id(theconversation_idcolumn is mostly null).owner/repo:path) and absolute-path keys;neighborsprints display-truncated node ids and ignores--format json; SQL overedgeneeds literalnode_idanchors (scalar-subquery anchors take ~33s vs ~3s literal vs ~0.2sneighbors).The skill leads with a generic routing rule (identifiers/derived/multi-hop/inventory/normalization -> graph; counts/content/ordering/attributes -> raw; graph picks the scope, raw reads inside it) and includes the full graph-to-content drill-down recipe (
Session natural_key=session_id,tool_result_forpairs results to calls,message_indexwindows for surrounding context).Notes
🤖 Generated with Claude Code