Dag Recall logo

Dag Recall

Community
ArchieIndian
dag-recall

Walks the memory DAG to recall detailed context on demand — query, expand, and assemble cited answers from hierarchical summaries without re-reading raw transcripts.

Overview

PublisherArchieIndian
Repositoryopenclaw-superpowers
Skill namedag-recall
Stars
74
Forks
14
Bundled files
3
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ArchieIndian on GitHub. Read the source before you install it.

Installation

Install the Dag Recall AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ArchieIndian/openclaw-superpowers/tree/main/skills/openclaw-native/dag-recall
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Dag Recall in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Dag Recall on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Dag Recall is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Dag Recall AI skill do?

Walks the memory DAG to recall detailed context on demand — query, expand, and assemble cited answers from hierarchical summaries without re-reading raw transcripts.

Why use Dag Recall on TypingMind?

Because you install it once and use it with any model. Dag Recall is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Dag Recall in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ArchieIndian/openclaw-superpowers/tree/main/skills/openclaw-native/dag-recall. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Dag Recall?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Dag Recall?

As many as you like. As long as a model supports skills, you can use Dag Recall with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Dag Recall AI skill free?

It is published on GitHub by ArchieIndian. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇