Dag Recallのロゴ

Dag Recall

コミュニティ
ArchieIndian
dag-recall

必要に応じてメモリDAGをたどり、詳細なコンテキストを呼び出します。階層化された要約を検索・展開し、生のトランスクリプトを読み直すことなく、出典付きの回答を組み立てます。

Add to TypingMind

概要

公開者ArchieIndian
リポジトリopenclaw-superpowers
スキル名dag-recall
スター
74
フォーク
14
同梱ファイル
3
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 3個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    ArchieIndianがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Dag Recall」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/ArchieIndian/openclaw-superpowers/tree/main/skills/openclaw-native/dag-recall
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ArchieIndian/openclaw-superpowers.git /tmp/openclaw-superpowers
mkdir -p .claude/skills
cp -r /tmp/openclaw-superpowers/skills/openclaw-native/dag-recall .claude/skills/dag-recall
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでDag Recallを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にDag Recallを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Dag Recallは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

DAG Recall

What it does

When the agent needs to recall something from past sessions, reading raw transcripts is expensive and often exceeds context limits. DAG Recall walks the hierarchical summary DAG built by memory-dag-compactor — starting from high-level (d2/d3) nodes, expanding into detailed (d0/d1) children — and assembles a focused, cited answer.

Inspired by lossless-claw's sub-agent recall pattern, where a lightweight agent fetches and expands nodes on demand rather than loading entire conversation histories.

When to invoke

  • When the agent asks "what did we decide about X?" or "how did we implement Y?"
  • When context about a past session is needed but the transcript isn't loaded
  • When searching MEMORY.md returns only high-level summaries that need expansion
  • Before starting work that depends on decisions or patterns from earlier sessions

How to use

bash
python3 recall.py --query "how did we handle auth migration"   # Walk DAG + assemble answer
python3 recall.py --query "deploy process" --depth 2           # Limit expansion depth
python3 recall.py --query "API keys" --top 5                   # Return top 5 matching nodes
python3 recall.py --expand s-d1-003                            # Expand a specific node
python3 recall.py --trace s-d0-012                             # Show full ancestor chain
python3 recall.py --recent --hours 48                          # Recall from recent nodes only
python3 recall.py --status                                     # Last recall summary
python3 recall.py --format json                                # Machine-readable output

Recall algorithm

  1. Search — FTS5 query across all DAG node summaries
  2. Rank — Score by relevance × recency × depth (deeper = more detailed = higher score for recall)
  3. Expand — For each top-N match, walk to children (lower depth = more detail)
  4. Assemble — Combine expanded content into a coherent answer with node citations
  5. Cache — Store the assembled answer for fast re-retrieval

Expansion strategy

Query: "auth migration"
  ↓
d3 node: "Infrastructure & Auth overhaul Q1" (score: 0.72)
  → expand d2: "Auth migration week of Feb 10" (score: 0.89)
    → expand d1: "Migrated JWT signing from HS256 to RS256" (score: 0.95)
      → expand d0: [raw operational detail — returned as-is]

Expansion stops when:

  • Target depth reached (default: expand to d0)
  • Token budget exhausted (default: 4000 tokens)
  • No children exist (leaf node)

DAG structure expected

Reads from ~/.openclaw/lcm-dag/ (same directory as memory-dag-compactor):

~/.openclaw/lcm-dag/
├── index.json          # Node metadata: id, depth, summary, children, created_at
├── nodes/
│   ├── s-d0-001.md     # Leaf node (operational detail)
│   ├── s-d1-001.md     # Condensed summary
│   ├── s-d2-001.md     # Arc summary
│   └── s-d3-001.md     # Durable summary
└── fts.db              # FTS5 index over node summaries

Procedure

Step 1 — Query the DAG

bash
python3 recall.py --query "how did we handle the database migration"

Searches the FTS5 index, ranks results, expands top matches, and assembles a cited answer:

Recall: "how did we handle the database migration" — 3 sources

  We migrated the database schema using Alembic with a blue-green
  deployment strategy. The key decisions were:

  1. Zero-downtime migration using shadow tables [s-d1-003]
  2. Rollback script tested against staging first [s-d0-012]
  3. Data backfill ran as async job over 2 hours [s-d0-015]

  Sources:
    [s-d1-003] "Database migration — shadow table approach" (Feb 12)
    [s-d0-012] "Alembic rollback script for users table" (Feb 12)
    [s-d0-015] "Async backfill job for legacy records" (Feb 13)

Step 2 — Expand a specific node

bash
python3 recall.py --expand s-d1-003

Shows the full content of a node and lists its children for further expansion.

Step 3 — Trace lineage

bash
python3 recall.py --trace s-d0-012

Shows the full ancestor chain from leaf to root, revealing how detail connects to high-level themes.

Integration with other skills

  • memory-dag-compactor: Produces the DAG that this skill reads — must be run first
  • session-persistence: Alternative data source — recall can fall back to SQLite search when DAG nodes are insufficient
  • context-assembly-scorer: Recall results feed into context assembly scoring
  • memory-integrity-checker: Ensures DAG is structurally sound before recall walks it

State

Recall history and cache stored in ~/.openclaw/skill-state/dag-recall/state.yaml.

Fields: last_query, last_query_at, cache_size, total_recalls, recall_history.

Notes

  • Uses Python's built-in sqlite3 and json modules — no external dependencies
  • FTS5 used for search when available; falls back to substring matching
  • Token budget prevents runaway expansion on large DAGs
  • Cache is LRU with configurable max size (default: 50 entries)
  • If DAG doesn't exist yet, prints a helpful message pointing to memory-dag-compactor

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Dag Recall」では何ができますか?

必要に応じてメモリDAGをたどり、詳細なコンテキストを呼び出します。階層化された要約を検索・展開し、生のトランスクリプトを読み直すことなく、出典付きの回答を組み立てます。

TypingMindでDag Recallを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Dag Recallはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにDag Recallをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/ArchieIndian/openclaw-superpowers/tree/main/skills/openclaw-native/dag-recallを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Dag Recallを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Dag Recallで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもDag Recallを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Dag Recall」は無料ですか?

ArchieIndianがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇