AGENT SKILL

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

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 query with --root, optional --data, --method, --community-level, --dynamic-community-selection, --response-type, and --streaming; see API and CLI.
  • Call Python APIs: load GraphRagConfig with load_config, read the required parquet tables into pandas DataFrames, then call global_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 *.parquet tables and columns before querying; see input contracts.
  • Diagnose vector retrieval: verify the configured vector-store schema includes entity_description, community_full_content, and/or text_unit_text as 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, and community_reports, and can use dynamic community selection.
  • Local search answers entity-specific questions using entities, relationships, text units, community reports, optional covariates, and entity_description vectors.
  • DRIFT search expands local search with community-report priming and follow-up exploration; it needs local-search tables plus entity_description and community_full_content vectors.
  • Basic search is baseline vector RAG over text units; it needs text_units plus text_unit_text vectors.
  • 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.py checks 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

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351