Back to Skills

graphrag

verified

PostgreSQL + pgvector + PGroonga で GraphRAG を構築。自然言語でプロジェクトを説明すると、最適なEntity/Edge型、スキーマ、クエリパターンを設計・生成。Use when the user mentions "GraphRAG", "knowledge graph", or wants to build RAG with relationships.

View on GitHub

Marketplace

titabash-plugins

titabash/claude-plugins

Plugin

graphrag-postgresql

Repository

titabash/claude-plugins

graphrag-postgresql/skills/graphrag/SKILL.md

Last Verified

January 21, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/titabash/claude-plugins/blob/main/graphrag-postgresql/skills/graphrag/SKILL.md -a claude-code --skill graphrag

Installation paths:

Claude
.claude/skills/graphrag/
Powered by add-skill CLI

Instructions

# GraphRAG PostgreSQL Skill

PostgreSQL単体(pgvector + PGroonga拡張)でGraphRAGを構築するためのスキル。
**自然言語でプロジェクトを説明すると、最適なGraphRAGスキーマを設計・生成する。**

## How It Works

```
/graphrag 小説のキャラクター関係を管理したい。時系列で関係が変化する
```

↓ Claude が分析

```
Entity型: Character, Location, Organization, Event, Item
Edge型: friend_of, enemy_of, ally_of, family_of, participates_in
追加機能: 時系列サポート(events テーブル)
```

↓ ユーザー確認後、生成

```
sql/schema.sql, sql/indexes.sql, sql/queries/*.sql, docs/
```

## Output Location

```
{project}/
├── sql/
│   ├── schema.sql              # カスタマイズされたスキーマ
│   ├── indexes.sql             # インデックス定義
│   └── queries/
│       ├── local_search.sql    # Entity中心検索
│       ├── global_search.sql   # 全体俯瞰検索
│       ├── hybrid_search.sql   # Hybrid Search
│       └── custom_*.sql        # 要件固有のクエリ
└── docs/
    ├── graphrag-guide.md       # 運用ガイド
    └── prompts/
        ├── entity_extraction.md
        └── edge_extraction.md
```

## Execution Flow

### Phase 1: Analyze User Requirements

**ユーザーの自然言語の説明を分析**:

1. **データの種類**: 何を管理したいか(小説、技術文書、FAQ、障害報告...)
2. **追跡したい関係**: どんな関係が重要か(人間関係、依存関係、因果関係...)
3. **検索・分析の要件**: どんなクエリが必要か(関連検索、パス検索、影響分析...)
4. **特別な要件**: 時系列、ネタバレ制御、承認フロー、重要度など

### Phase 2: Read Reference Documents

以下のリファレンスを参照して設計:

- [references/use-cases.md](references/use-cases.md) - 既存パターンを参考に
- [references/architecture.md](references/architecture.md) - アーキテクチャ基本
- [references/schema-design.md](references/schema-design.md) - スキーマ設計
- [references/entity-extraction.md](references/entity-extraction.md) - Entity/Edge抽出

### Phase 3: Design Entity/Edge Types

**ユーザー要件に最適なEntity型とEdge型を設計**:

参考パターン(use-cases.md より):

| パターン | Entity型例 | Edge型例 |
|----------|-----------|----------|
| 物語・コンテンツ | Character, Location, Item | friend_of, enemy_of, possesses |
| 技術文書 | Technology, API, Component | depends_on, implements, extends |
| ナレッジベース | Concept, Process, Document | defines, precedes, references |
| 障害・トラブル | Symptom, Cause, Solution | causes, solved_by, affects |
| 法務・規約 | Clause, Requireme

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
4592 chars