querying
Run and diagnose GraphRAG global, local, DRIFT, basic, streaming, and question-generation queries over completed indexes or BYOG tables.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- querying
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Run and diagnose GraphRAG global, local, DRIFT, basic, streaming, and question-generation queries over completed indexes or BYOG tables.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/query-api-cli.md3.9 KB
- 参考文档references/query-input-contracts.md3.4 KB
- 参考文档references/query-vector-store-contracts.md3.6 KB
- 参考文档references/troubleshooting.md3.7 KB
- 脚本scripts/validate_query_prereqs.py14.5 KB
03 SKILL.md 正文
Querying
Use this sub-skill when the task is about graphrag query, global/local/DRIFT/basic search, streaming query output, query DataFrame inputs, vector-store embedding IDs, community levels, dynamic community selection, or follow-up question generation over an existing GraphRAG index. Do not use it to create indexes, update indexes, tune prompts, or design input data; route indexing to ../indexing/ and config/data setup to ../configuration-data/.
Route by Query Task
- Use CLI for completed indexes: run
graphrag querywith--root, optional--data,--method,--community-level,--dynamic-community-selection,--response-type, and--streaming; see API and CLI. - Call Python APIs: load
GraphRagConfigwithload_config, read the required parquet tables into pandas DataFrames, then callglobal_search,local_search,drift_search,basic_search, or the matching streaming variant; see API and CLI. - Validate table prerequisites: map each method to its required
*.parquettables and columns before querying; see input contracts. - Diagnose vector retrieval: verify the configured vector-store schema includes
entity_description,community_full_content, and/ortext_unit_textas required by the selected method; see vector-store contracts. - Debug failures: handle missing reports, level mismatches, bad vector IDs, local context proportions, DRIFT report embeddings, JSON parse warnings, and token truncation; see troubleshooting.
Method Selection
- Global search answers dataset-wide or thematic questions from community reports; it needs
entities,communities, andcommunity_reports, and can use dynamic community selection. - Local search answers entity-specific questions using entities, relationships, text units, community reports, optional covariates, and
entity_descriptionvectors. - DRIFT search expands local search with community-report priming and follow-up exploration; it needs local-search tables plus
entity_descriptionandcommunity_full_contentvectors. - Basic search is baseline vector RAG over text units; it needs
text_unitsplustext_unit_textvectors. - Question generation uses the same local-context data shape as local search and produces candidate follow-up questions rather than final answers.
Bundled Helper
scripts/validate_query_prereqs.pychecks table file presence, required columns, community-level availability, query-shape risks, local proportion settings, and configured vector-store embedding names for one method without network access or credentials.
Quick Commands
python skills/graphrag/sub-skills/querying/scripts/validate_query_prereqs.py --root . --method local --data output
python skills/graphrag/sub-skills/querying/scripts/validate_query_prereqs.py --root . --method drift --community-level 2 --query "What changed?"
graphrag query "What are the major themes?" --root . --method global --community-level 2 --response-type "List of 5 Points"
graphrag query "What does entity X do?" --root . --method local --streaming
Query Mental Model
GraphRAG query APIs do not build indexes. They adapt completed index tables into query data models, create model/vector-store clients from settings.yaml, build a bounded context window, and then call the configured completion model. Most query failures are caused by stale or incomplete output tables, wrong community level, missing vector indexes, vector IDs keyed by titles instead of IDs, or token budgets that prune needed context.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).