本文へ移動
cccskills
無料GitHub で公開

graph-rag

Use when needing global or relational understanding of codebases or knowledge corpora. Keywords: GraphRAG, knowledge graph, entity extraction, community summarization, graph traversal, Microsoft GraphRAG.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

GraphRAG Skill

The graph-rag skill provides structured methods for building and querying Knowledge Graphs (KG) from text and code. Unlike standard RAG, which relies on vector similarity, GraphRAG leverages structural relationships between entities to answer complex, multi-hop, and global queries.

When to Use This Skill

  • When you need to understand the "big picture" of a massive repository or documentation set.
  • When standard semantic search (vector-only) fails to retrieve relevant information for relational or aggregate questions (e.g., "What are the common design patterns used in this project?").
  • When you need to trace dependencies across codebases for safe refactoring.
  • When you need to generate high-quality summaries of knowledge clusters (communities).

Limitations of Standard Vector-Only RAG

Standard RAG (Retrieval-Augmented Generation) has significant blind spots:

  1. Global Aggregation: It cannot easily answer questions requiring knowledge synthesis across the entire corpus (e.g., "Summarize all major architectural decisions").
  2. Relational Depth: Vector similarity often misses multi-hop relationships between disparate files or concepts.
  3. Information Density: Vector chunking can lose the context of how entities are linked, leading to hallucinated or fragmented answers.

Core Capabilities

1. Entity-Relation Extraction

Ingest unstructured text or source code and transform it into a structured graph:

  • Entities: Identify classes, functions, modules, concepts, or business objects.
  • Edges: Map interactions (calls, imports, implements, extends, contains).
  • Claims: Capture assertions made in docstrings or documentation.

2. Hierarchical Community Summarization (Leiden Algorithm)

Enable global reasoning by creating levels of abstraction:

  • Detect communities using the Leiden algorithm to cluster related entities.
  • Generate hierarchical summaries for each community.
  • Allow the LLM to query these summaries for high-level synthesis rather than searching millions of raw vectors.

3. AST & Codebase Dependency Graphing

Deep analysis for software engineering tasks:

  • Call Graphs: Track function execution flows.
  • Dependency Graphs: Visualize imports and module coupling.
  • Class Hierarchies: Map inheritance and implementation patterns.
  • Refactoring Support: Use graph traversal to identify impact zones before applying changes.

4. Hybrid Graph + Vector Retrieval

Combine the best of both worlds:

  • Structural Traversal: Follow links between nodes to gather context.
  • Semantic Similarity: Use vectors to bridge gaps or locate starting points in the graph.

5. Search Modes

  • Local Search: Focuses on specific entities and their immediate neighbors (1-2 hops). Best for technical questions like "How does the UserAuth service interact with the Database provider?"
  • Global Search: Operates at the community report level to synthesize information across the entire dataset. Best for strategic questions like "What are the core architectural risks identified in the code?"

Microsoft GraphRAG Patterns

Follow established industry patterns for implementation:

  1. Index Construction: Build the graph iteratively from codebase files or documentation.
  2. Query Engine: Implement adaptive retrieval that selects the appropriate search mode (Local vs Global) based on the user's intent.
  3. Community Reports: Maintain up-to-date summaries of graph partitions to accelerate global queries.

Implementation Steps

  1. Extraction: Run parser agents on the target corpus to build nodes and edges.
  2. Clustering: Apply graph algorithms (Leiden) to identify knowledge communities.
  3. Summarization: Generate reports for each cluster level.
  4. Retrieval: Direct the user's prompt to either local graph walking or global community synthesis.
  5. Synthesis: Combine retrieved evidence into a grounded, comprehensive response.

Best Practices

  • Schema Design: Clearly define your entity and relation types before indexing.
  • Quality Control: Validate extracted edges against the source code/text to minimize noise.
  • Iterative Refinement: Re-index parts of the graph when the codebase changes significantly.

For more information on implementation, refer to the resources/ folder in this skill.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

2d-games

無料

2D game development principles. Sprites, tilemaps, physics, camera.

日本語の概要は準備中です。原文の説明を表示しています。

VoDaiLocz/kilo-kit-mcp272026年9月13日 更新

3d-games

無料

3D game development principles. Rendering, shaders, physics, cameras.

日本語の概要は準備中です。原文の説明を表示しています。

VoDaiLocz/kilo-kit-mcp272026年9月13日 更新

aesthetic

無料

Create aesthetically beautiful interfaces following proven design principles. Use when building UI/UX, analyzing designs from inspiration sites, generating design images with ai-multimodal, implementing visual hierarchy and color theory, adding micro-interactions, or creating design documentation. Includes workflows for capturing and analyzing inspiration screenshots with chrome-devtools and ai-multimodal, iterative design image generation until aesthetic standards are met, and comprehensive design system guidance covering BEAUTIFUL (aesthetic principles), RIGHT (functionality/accessibility), SATISFYING (micro-interactions), and PEAK (storytelling) stages. Integrates with chrome-devtools, ai-multimodal, media-processing, ui-styling, and web-frameworks skills.

日本語の概要は準備中です。原文の説明を表示しています。

VoDaiLocz/kilo-kit-mcp272026年9月13日 更新

Use when implementing or managing persistent, hierarchical memory systems for AI agents. Covers cross-session state, fact supersession, and self-managed memory tools to enable long-term recall and adaptive agent behavior.

日本語の概要は準備中です。原文の説明を表示しています。

VoDaiLocz/kilo-kit-mcp272026年9月13日 更新

Use when monitoring, tracing, or debugging agentic workflows in production. Keywords: observability, tracing, OpenTelemetry, Langfuse, latency, token cost, loop detection, telemetry.

日本語の概要は準備中です。原文の説明を表示しています。

VoDaiLocz/kilo-kit-mcp272026年9月13日 更新

Use when building self-correcting retrieval systems for AI agents. Keywords: RAG, retrieval, Corrective RAG, Self-RAG, query decomposition, reranking, hallucination, grounding.

日本語の概要は準備中です。原文の説明を表示しています。

VoDaiLocz/kilo-kit-mcp272026年9月13日 更新

VoDaiLocz のスキルをすべて見る

このスキルの問題を報告する