jpskill.com
💬 コミュニケーション コミュニティ

recursive-knowledge

大量の文書から知識グラフを構築し、文書間の複雑な関連性をたどって質問に答えることで、文書を丸ごと読み込ませるよりも効率的に、大量の文書群から必要な情報を引き出すSkill。

📜 元の英語説明(参考)

Process large document corpora (1000+ docs, millions of tokens) through knowledge graph construction and stateful multi-hop reasoning. Use when (1) User provides a large corpus exceeding context limits, (2) Questions require connections across multiple documents, (3) Multi-hop reasoning needed for complex queries, (4) User wants persistent queryable knowledge from documents. Replaces brute-force document stuffing with intelligent graph traversal.

🇯🇵 日本人クリエイター向け解説

一言でいうと

大量の文書から知識グラフを構築し、文書間の複雑な関連性をたどって質問に答えることで、文書を丸ごと読み込ませるよりも効率的に、大量の文書群から必要な情報を引き出すSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o recursive-knowledge.zip https://jpskill.com/download/18095.zip && unzip -o recursive-knowledge.zip && rm recursive-knowledge.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18095.zip -OutFile "$d\recursive-knowledge.zip"; Expand-Archive "$d\recursive-knowledge.zip" -DestinationPath $d -Force; ri "$d\recursive-knowledge.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して recursive-knowledge.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → recursive-knowledge フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
7

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

再帰的知識処理

知識グラフの構築とステートフルなマルチホップクエリを通じて、任意に大きなドキュメントセットを処理します。RLMの研究に基づいていますが、適切な状態管理と終了ロジックを備えています。

コアコンセプト

ドキュメントをコンテキストに詰め込む(これにより性能が低下する)代わりに、このスキルは以下を行います。

  1. ドキュメントを知識グラフ(エンティティ、関係)にインデックス化する
  2. グラフをトラバースしてクエリに答える
  3. 状態を追跡して冗長な探索を避ける
  4. 信頼度閾値を使用して停止するタイミングを知る

ワークフロー

フェーズ 1: インデックス作成

新しいコーパスの場合、インデクサーを実行します。

python3 scripts/index_corpus.py --input /path/to/documents --output /path/to/graph.json

これにより、以下が抽出されます。

  • エンティティ: 人物、組織、概念、日付、場所
  • 関係: 参照、言及、矛盾、支持、関連
  • メタデータ: ソースドキュメント、位置、抽出信頼度

エンティティ/関係スキーマの詳細については、references/graph-schema.md を参照してください。

フェーズ 2: クエリ

インデックス化されたコーパスに対するユーザーのクエリの場合:

python3 scripts/query.py --graph /path/to/graph.json --query "user question here"

クエリエンジンは以下を行います。

  1. クエリをターゲットエンティティ/関係に解析する
  2. グラフ内のエントリポイントを見つける
  3. 状態追跡でトラバースする
  4. 信頼度閾値が満たされたら停止する
  5. 出典とともに回答を返す

フェーズ 3: 段階的な更新

既存のグラフに新しいドキュメントを追加します。

python3 scripts/index_corpus.py --input /path/to/new_docs --output /path/to/graph.json --append

状態管理 (重要)

ナイーブな再帰的アプローチに対する重要な改善点は、ステートフルトラバーサルです。詳細については、references/state-management.md を参照してください。

クエリ実行中、以下を追跡します。

状態 目的
visited_nodes 同じエンティティの再探索を防ぐ
visited_edges 同じ関係の再トラバースを防ぐ
findings ソース付きの累積された証拠
confidence 現在の確実性レベル (0-1)
depth 現在のトラバース深度

終了条件:

STOP if:
  - confidence >= 0.85 (高い確実性)
  - len(corroborating_sources) >= 3 (複数の合意)
  - depth > max_depth (無限探索を防ぐ)
  - すべての関連パスが使い果たされた

マルチホップ推論

ドキュメント間の接続を必要とする質問の場合:

  1. クエリコンポーネントを識別する(必要なエンティティ/ファクト)
  2. 各コンポーネントのエントリポイントを見つける
  3. 各エントリポイントからトラバースする
  4. パスの交差点を探す
  5. 交差点で調査結果を合成する

例: "X はプロジェクト Y で誰と協力しましたか?"

  • エントリポイント 1: エンティティ "X" → 関係 → プロジェクト
  • エントリポイント 2: エンティティ "Project Y" → 関係 → 人々
  • 交差点: X と Project Y の両方に関連付けられた人々

パターンについては、references/traversal-patterns.md を参照してください。

このスキルを使用すべきでない場合

  • コンテキストに収まる小さなドキュメントセット (<50k トークン) - 直接コンテキストを使用するだけです
  • 単純なキーワード検索 - 代わりに grep/検索ツールを使用する
  • マルチホップ推論は不要 - より単純なアプローチが機能する
  • リアルタイムストリーミングデータ - これは静的コーパス用です

ファイルリファレンス

  • scripts/index_corpus.py - ドキュメントからグラフを構築する
  • scripts/query.py - 状態管理でクエリを実行する
  • scripts/graph_ops.py - グラフ CRUD ユーティリティ
  • references/graph-schema.md - エンティティと関係のタイプ
  • references/state-management.md - 終了と信頼度のロジック
  • references/traversal-patterns.md - マルチホップクエリパターン
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Recursive Knowledge Processing

Process arbitrarily large document sets through knowledge graph construction and stateful multi-hop queries. Based on RLM research but with proper state management and termination logic.

Core Concept

Instead of stuffing documents into context (which causes degradation), this skill:

  1. Indexes documents into a knowledge graph (entities, relationships)
  2. Answers queries by traversing the graph
  3. Tracks state to avoid redundant exploration
  4. Uses confidence thresholds to know when to stop

Workflow

Phase 1: Indexing

For a new corpus, run the indexer:

python3 scripts/index_corpus.py --input /path/to/documents --output /path/to/graph.json

This extracts:

  • Entities: People, organizations, concepts, dates, locations
  • Relationships: References, mentions, contradicts, supports, relates_to
  • Metadata: Source document, position, extraction confidence

For details on entity/relationship schema, see references/graph-schema.md.

Phase 2: Querying

For user queries against an indexed corpus:

python3 scripts/query.py --graph /path/to/graph.json --query "user question here"

The query engine:

  1. Parses query into target entities/relationships
  2. Finds entry points in graph
  3. Traverses with state tracking
  4. Stops when confidence threshold met
  5. Returns answer with provenance

Phase 3: Incremental Updates

Add new documents to existing graph:

python3 scripts/index_corpus.py --input /path/to/new_docs --output /path/to/graph.json --append

State Management (Critical)

The key improvement over naive recursive approaches is stateful traversal. See references/state-management.md for full details.

During query execution, track:

State Purpose
visited_nodes Prevent re-exploring same entities
visited_edges Prevent re-traversing same relationships
findings Accumulated evidence with sources
confidence Current certainty level (0-1)
depth Current traversal depth

Termination conditions:

STOP if:
  - confidence >= 0.85 (high certainty)
  - len(corroborating_sources) >= 3 (multiple agreement)
  - depth > max_depth (prevent infinite exploration)
  - all relevant paths exhausted

Multi-Hop Reasoning

For questions requiring connection across documents:

  1. Identify query components (what entities/facts needed)
  2. Find entry points for each component
  3. Traverse from each entry point
  4. Look for path intersections
  5. Synthesize findings at intersection points

Example: "Who worked with X on project Y?"

  • Entry point 1: Entity "X" → relationships → projects
  • Entry point 2: Entity "Project Y" → relationships → people
  • Intersection: People connected to both X and Project Y

See references/traversal-patterns.md for patterns.

When NOT to Use This Skill

  • Small document sets that fit in context (<50k tokens) - just use direct context
  • Simple keyword search - use grep/search tools instead
  • No multi-hop reasoning needed - simpler approaches work
  • Real-time streaming data - this is for static corpora

File Reference

  • scripts/index_corpus.py - Build graph from documents
  • scripts/query.py - Execute queries with state management
  • scripts/graph_ops.py - Graph CRUD utilities
  • references/graph-schema.md - Entity and relationship types
  • references/state-management.md - Termination and confidence logic
  • references/traversal-patterns.md - Multi-hop query patterns

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。