Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

graphrag

БесплатноБез исполняемых скриптовНе проверен

GraphRAG is Microsoft's pipeline that turns a folder of text into a knowledge graph with community summaries, then answers questions over it. Use it for…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

GraphRAG — knowledge-graph RAG for whole-corpus questions

Overview

GraphRAG is a command-line pipeline from Microsoft Research. graphrag index reads text files, uses an LLM to extract entities and relationships, groups the graph into hierarchical communities (Leiden clustering), writes an LLM summary for every community, and embeds text units, entities and reports. graphrag query then answers questions with one of four strategies over those outputs.

Everything is configured from a project folder holding settings.yaml, .env, input/ and prompts/. Results are parquet tables in output/ and a LanceDB vector store in output/lancedb.

Two things to know before starting:

  • Indexing calls the LLM for every chunk, then again for summaries and community reports. On a large corpus that is thousands of calls and real money. Always try a handful of files first.
  • The README states the project is largely in maintenance mode: bug fixes and dependency updates, no new features. Treat it as a research-grade tool and pin the version.

This skill was checked against graphrag 3.3.0 on PyPI (--help output and the files generated by graphrag init); the indexing and query runs themselves need an LLM key and are described from the official docs.

Instructions

Install in a virtual environment

python3 -m venv .venv
.venv/bin/pip install "graphrag==3.3.0"
.venv/bin/graphrag --help

The commands are init, index, update, prompt-tune and query.

Initialise a project

mkdir -p ~/research/support-tickets
.venv/bin/graphrag init --root ~/research/support-tickets

init asks for the default chat model (default gpt-4.1) and embedding model (default text-embedding-3-large); you can pass them as --model and --embedding. It creates .env, settings.yaml, input/ and prompts/ (extraction, summarisation, community-report and search prompts). --force re-creates the config in an existing project and overwrites the default files, so commit your edited prompts first.

In .env replace the <API_KEY> placeholder that init writes with your key (created at platform.openai.com) and keep the file out of version control:

GRAPHRAG_API_KEY=<API_KEY>

The generated settings.yaml references it as ${GRAPHRAG_API_KEY}. Key sections of the 3.x format:

completion_models:
  default_completion_model:
    model_provider: openai
    model: gpt-4.1
    auth_method: api_key          # or azure_managed_identity
    api_key: ${GRAPHRAG_API_KEY}
embedding_models:
  default_embedding_model:
    model_provider: openai
    model: text-embedding-3-large
    auth_method: api_key
    api_key: ${GRAPHRAG_API_KEY}
input:
  type: text                      # csv, text, json, jsonl
chunking:
  type: tokens
  size: 1200
  overlap: 100
extract_graph:
  entity_types: [organization,person,geo,event]
  max_gleanings: 1
cluster_graph:
  max_cluster_size: 10
extract_claims:
  enabled: false

For Azure OpenAI set model_provider: azure, azure_deployment_name, api_base and api_version on the model entries. Older tutorials show a top-level models: key and a config.yaml; with 3.x the keys above and settings.yaml apply, so re-run init in a scratch folder after an upgrade and diff it against your file.

Add data and index

Put plain-text files in input/ (input.type: text; csv, json and jsonl are also available).

.venv/bin/graphrag index --root ~/research/support-tickets --dry-run --skip-validation   # config check, no LLM calls
.venv/bin/graphrag index --root ~/research/support-tickets

Index options: --method standard|fast (default standard; --help also lists standard-update and fast-update, which belong to graphrag update), --verbose, --no-cache (the LLM cache in cache/ makes re-runs after a failure cheap, so leave it on), and --skip-validation.

  • standard uses the LLM to extract entities, relationships and descriptions. Highest quality, highest cost; the docs estimate graph extraction at about 75 percent of indexing cost.
  • fast extracts noun phrases with NLP libraries and builds a co-occurrence graph; the LLM is used only for community reports. Much cheaper, noisier graph. The docs suggest smaller chunks (50-100 tokens) for it. Use it when your questions are mostly summary-style global ones.

When it finishes, output/ holds parquet tables such as entities, relationships, communities, community_reports, text_units and documents; read them with pandas for your own analysis.

Query

.venv/bin/graphrag query "What are the recurring causes of failed deliveries?" --root ~/research/support-tickets --method global
.venv/bin/graphrag query "What did customer Northwind Freight complain about?" --root ~/research/support-tickets --method local

--method selects the strategy (default global):

  • global: map-reduce over community reports; for questions about the dataset as a whole. The m
Полный SKILL.md на GitHub

Установить graphrag в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл graphrag?

GraphRAG is Microsoft's pipeline that turns a folder of text into a knowledge graph with community summaries, then answers questions over it. Use it for corpus-wide questions that plain vector RAG misses, such as "what are the main themes across these 500 documents". Trigger phrases - "graphrag index", "graphrag query", "global search vs local search", "build a knowledge graph from documents with an LLM", "Microsoft GraphRAG", "prompt tuning for GraphRAG".

Как установить скилл graphrag?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл graphrag запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить graphrag с