AGENT SKILL

graphrag

Use Microsoft GraphRAG from CLI or Python: configure data/model/storage/vector settings, build or update indexes, query completed indexes, tune indexing prompts, and extend package factories safely.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
graphrag
license
MIT
metadata
{ "disco-role": "operating" }
description
Use Microsoft GraphRAG from CLI or Python: configure data/model/storage/vector settings, build or update indexes, query completed indexes, tune indexing prompts, and extend package factories safely.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

GraphRAG

Use this skill when a task mentions Microsoft GraphRAG, graph-based RAG, graphrag init, graphrag index, graphrag query, graphrag prompt-tune, GraphRAG settings, completed index tables, or custom GraphRAG providers.

GraphRAG is a Python package and CLI for extracting structured knowledge graphs from unstructured text, writing index tables/vector stores, and querying those completed indexes with global, local, DRIFT, or basic search.

First Steps

  1. Confirm GraphRAG is installed in the target environment:

    python - <<'PY'
    import graphrag
    print("graphrag import ok")
    PY
    graphrag --help
    
  2. Identify the user’s workflow:

    • New workspace or settings/data/auth issue → sub-skills/configuration-data/
    • Build, update, validate, or inspect an index → sub-skills/indexing/
    • Query an existing index → sub-skills/querying/
    • Generate or repair indexing prompts → sub-skills/prompt-tuning/
    • Implement custom providers/factories or graph helpers → sub-skills/package-extensions/
  3. Keep live-service calls guarded. Indexing, querying, and prompt tuning often need OpenAI/Azure credentials, model deployments, vector stores, or storage services. Prefer bundled validators and offline contract checks before running cost-incurring commands.

Common Routes

  • Configuration and data readiness: Use sub-skills/configuration-data/ for settings.yaml, .env interpolation, model/auth config, input formats (text, csv, json, jsonl, markitdown, parquet), file/blob/Cosmos storage, JSON/memory/no-op cache, LanceDB/Azure AI Search/Cosmos vector stores, and safe config/input diagnostics.
  • Indexing: Use sub-skills/indexing/ for graphrag init, graphrag index, graphrag update, Python build_index(...), standard vs fast indexing, custom workflow lists, BYOG tables, output table validation, embeddings, and incremental update failure recovery.
  • Querying: Use sub-skills/querying/ for graphrag query, global/local/DRIFT/basic search, streaming APIs, completed-index table contracts, vector-store names and ID keys, community levels, dynamic community selection, and query prerequisite checks.
  • Prompt tuning: Use sub-skills/prompt-tuning/ for graphrag prompt-tune, Python generate_indexing_prompts(...), selection methods, output prompt files, multilingual/domain/entity-type tuning, and prompt output validation.
  • Package extensions: Use sub-skills/package-extensions/ for custom cache/storage/table/input/chunker/vector/LLM providers, factory register_* and create_* patterns, graph helper checks, workflow factory registration, and optional dependency diagnostics.

Typical Workflows

Configure → Index → Query

  1. Read sub-skills/configuration-data/ to initialize or validate settings.yaml, .env, input layout, storage, cache, and vector-store settings.
  2. Read sub-skills/indexing/ to run graphrag init, graphrag index, or graphrag update, and validate output tables.
  3. Read sub-skills/querying/ to choose global/local/DRIFT/basic search and check completed-index prerequisites before running model-backed queries.

Tune Prompts Before Indexing

  1. Read sub-skills/configuration-data/ for model credentials and input readiness.
  2. Read sub-skills/prompt-tuning/ to generate extract_graph.txt, summarize_descriptions.txt, and community_report_graph.txt.
  3. Return to sub-skills/indexing/ to run an index with the updated prompts.

Add a Custom Provider

  1. Read sub-skills/package-extensions/ to pick the correct factory and offline mock pattern.
  2. Read sub-skills/configuration-data/ only when the custom provider must be wired through GraphRAG YAML.
  3. Use the bundled extension scripts as templates for isolated tests before touching live storage, vector stores, or LLM providers.

Repo-Level References

  • references/cli-command-map.md summarizes the verified public CLI commands and when to route to each sub-skill.
  • references/capability-routing.md maps natural user requests to the owning sub-skill and notes key exclusions.
  • references/troubleshooting.md covers cross-cutting install/import, credentials, optional dependencies, service, and cost-safety failures.
  • references/repo-provenance.md records the source snapshot used to generate this skill. Read it before deciding whether this skill is stale for a different checkout.

Safety Notes

  • Do not run indexing, prompt tuning, or query commands that call hosted models until credentials, model deployments, cost expectations, and data scope are explicit.
  • Do not assume docs and code are identical. Current package inspection verified GraphRAG 3.1.0; the sub-skills call out known docs drift where it affects JSONL/parquet/MarkItDown support or prompt output filenames.
  • Treat original notebooks/tests/docs as evidence only. Runtime scripts and references in this skill are self-contained and do not require the original repository checkout.

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