feat(query): accept external seed files for traversal#1783
Open
shura-v wants to merge 1 commit into
Open
Conversation
graphify query always selected traversal seeds from the question text, which made it hard for external retrieval or reranking to hand graphify an ordered set of known node ids while still using the native traversal and output path. Add --seed-file for JSON arrays of string node ids. When provided, query skips internal seed scoring, validates the ids against the graph, preserves array order for rendered seed nodes, and logs the seed list in querylog. The normal query path is unchanged when no seed file is provided. Regressions cover string-only seed files, duplicate removal, unknown ids, rendered seed order, querylog metadata, and the generated skill reference.
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
graphify querycurrently always selects traversal seeds from the question text. That makes it hard for external retrieval or reranking tools to hand graphify an ordered set of known node ids while still using graphify's native traversal and output path.This adds
--seed-filefor JSON arrays of string node ids. When provided, query skips internal seed scoring, validates the ids against the graph, preserves array order for rendered seed nodes, and logs the seed list in querylog. Ranking is represented only by array order; graphify does not need to know scores or metadata. The normal query path is unchanged when no seed file is provided.The generated query skill reference now documents this as an external-tooling path: if ordered graph node ids already exist from external retrieval or reranking, pass them via
--seed-file.Tests
python -m tools.skillgen --checkpytest tests/test_query_cli.py tests/test_querylog.py tests/test_skillgen.pyruff check graphify/serve.py graphify/cli.py graphify/__main__.py tests/test_query_cli.py tests/test_querylog.py tests/test_skillgen.py