PostgreSQL + pgvector + PGroonga で GraphRAG を構築。自然言語でプロジェクトを説明すると、最適なEntity/Edge型、スキーマ、クエリパターンを設計・生成。Use when the user mentions "GraphRAG", "knowledge graph", or wants to build RAG with relationships.
/plugin marketplace add titabash/claude-plugins/plugin install titabash-graphrag-postgresql-graphrag-postgresql@titabash/claude-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/architecture.mdreferences/chunking-strategies.mdreferences/community-detection.mdreferences/entity-extraction.mdreferences/indexing-strategies.mdreferences/query-patterns.mdreferences/schema-design.mdreferences/use-cases.mdtemplates/indexes.sqltemplates/query-global.sqltemplates/query-hybrid.sqltemplates/query-local.sqltemplates/schema-core.sqltemplates/schema-extensions.sqlPostgreSQL単体(pgvector + PGroonga拡張)でGraphRAGを構築するためのスキル。 自然言語でプロジェクトを説明すると、最適なGraphRAGスキーマを設計・生成する。
/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/
{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
ユーザーの自然言語の説明を分析:
以下のリファレンスを参照して設計:
ユーザー要件に最適な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, Requirement, Exception | refers_to, overrides, exception_of |
これらを参考に、ユーザー要件に合わせてカスタム設計する。
AskUserQuestionで設計を確認:
templates/schema-core.sqlsql/schema.sql参照: references/indexing-strategies.md
参照: references/query-patterns.md
ユーザーの検索要件に基づいてクエリを生成:
local_search.sql - Entity中心のn-hop展開global_search.sql - Community reports検索hybrid_search.sql - PGroonga + pgvector (RRF)custom_*.sql - 要件固有(依存ツリー、因果パス、類似検索等)参照: references/entity-extraction.md
設計したEntity/Edge型に基づいてLLM抽出プロンプトを生成:
docs/prompts/entity_extraction.md - Entity抽出用docs/prompts/edge_extraction.md - Edge抽出用参照: references/chunking-strategies.md
docs/graphrag-guide.md:
生成完了を報告:
共通:
ユースケース固有:
オプション:
Use when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.