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
- 参考文档references/capability-routing.md2.2 KB
- 参考文档references/cli-command-map.md1.9 KB
- 参考文档references/repo-provenance.md3.1 KB
- 参考文档references/repo-routing-metadata.json496 B
- 参考文档references/troubleshooting.md3.3 KB
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
-
Confirm GraphRAG is installed in the target environment:
python - <<'PY' import graphrag print("graphrag import ok") PY graphrag --help -
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/
- New workspace or settings/data/auth issue →
-
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/forsettings.yaml,.envinterpolation, 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/forgraphrag init,graphrag index,graphrag update, Pythonbuild_index(...), standard vs fast indexing, custom workflow lists, BYOG tables, output table validation, embeddings, and incremental update failure recovery. - Querying: Use
sub-skills/querying/forgraphrag 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/forgraphrag prompt-tune, Pythongenerate_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, factoryregister_*andcreate_*patterns, graph helper checks, workflow factory registration, and optional dependency diagnostics.
Typical Workflows
Configure → Index → Query
- Read
sub-skills/configuration-data/to initialize or validatesettings.yaml,.env, input layout, storage, cache, and vector-store settings. - Read
sub-skills/indexing/to rungraphrag init,graphrag index, orgraphrag update, and validate output tables. - 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
- Read
sub-skills/configuration-data/for model credentials and input readiness. - Read
sub-skills/prompt-tuning/to generateextract_graph.txt,summarize_descriptions.txt, andcommunity_report_graph.txt. - Return to
sub-skills/indexing/to run an index with the updated prompts.
Add a Custom Provider
- Read
sub-skills/package-extensions/to pick the correct factory and offline mock pattern. - Read
sub-skills/configuration-data/only when the custom provider must be wired through GraphRAG YAML. - 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.mdsummarizes the verified public CLI commands and when to route to each sub-skill.references/capability-routing.mdmaps natural user requests to the owning sub-skill and notes key exclusions.references/troubleshooting.mdcovers cross-cutting install/import, credentials, optional dependencies, service, and cost-safety failures.references/repo-provenance.mdrecords 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
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).