Logo de Investigation Dag Planner

Investigation Dag Planner

Comunidade
AnthonyAlcaraz
investigation-dag-planner

Dynamic-DAG construction for a planning node (Ch5 Example 5-15 + the DevOps "Constructing the Investigation DAG" section). Given hypotheses/tasks with dependency constraints, compute a topological-level decomposition: each level is a phase of tasks that can run concurrently, ordered within-phase by priority. The estimated duration of a parallel phase is the MAX over its concurrent tests, and execution runs phase-by-phase with early termination once a hypothesis is confirmed. Detects dependency cycles as malformed plans. Use when a planning node must decide which work is parallel-safe and in what order — incident-investigation hypothesis testing, multi-track research, multi-party claim processing. NOT for purely linear pipelines (one task per level — annotation overhead exceeds benefit), NOT for runtime fault-isolation (that is event-driven orchestration), NOT for picking a model or pipeline shape (that is architecture selection).

Visão geral

Publicado porAnthonyAlcaraz
Repositórioagentic-graph-rag-skills
Nome da habilidadeinvestigation-dag-planner
Estrelas
29
Forks
9
Arquivos incluídos
3
LicençaMIT
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Arquivos incluídos: 3

    Scripts, templates e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente para leitura e nunca são executados.

  • Código aberto

    Publicada por AnthonyAlcaraz no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Investigation Dag Planner no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/reasoning-planning/investigation-dag-planner
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills.git /tmp/agentic-graph-rag-skills
mkdir -p .claude/skills
cp -r /tmp/agentic-graph-rag-skills/skills/reasoning-planning/investigation-dag-planner .claude/skills/investigation-dag-planner
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Investigation Dag Planner em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Investigation Dag Planner automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Investigation Dag Planner não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

Investigation DAG Planner

Overview

Real investigation rarely follows a linear path. When multiple hypotheses exist, some can be tested in parallel while others have dependencies. Testing whether the database is overloaded and whether the payment service has memory pressure use different data sources — they can run simultaneously. But testing for a network partition between two services only makes sense after ruling out simpler explanations.

This is the dynamic-DAG-construction pattern (Example 5-15) applied to incident diagnosis. The planner:

  1. Analyzes dependencies between hypotheses/tasks.
  2. Identifies groups that can safely run in parallel (a topological level — the same computation bd ready performs in Beads, and parallel_groups in Example 5-15).
  3. Organizes them into phases. Within each phase, tasks are ordered by priority (the historically/structurally most-likely hypothesis first).
  4. Estimates each parallel phase's duration as the max of its concurrent tests, since they run concurrently — not the sum.

Execution then proceeds phase by phase with early termination: as soon as a hypothesis is confirmed with sufficient corroborating evidence, remaining phases are skipped. A dependency cycle raises CycleError — that is a malformed plan, surfaced rather than silently mis-executed.

In the DevOps latency investigation (account 123456789012), the checkout latency spike yields three hypotheses. The DAG groups db_pool_exhaustion and payment_memory_pressure into one parallel phase (different data sources); network_partition depends on ruling out the pool hypothesis, so it lands in a later phase. When the pool hypothesis confirms in the first phase, early termination skips the network-partition test entirely.

When to Use

  • A planning node must decide which tasks are parallel-safe and order phases
  • Incident-investigation hypothesis testing, multi-track research, multi-party claim processing (the chapter's multi-vehicle-accident example)
  • You want an explicit duration estimate and an auditable phase structure

Phrases: "construct an investigation DAG", "which hypotheses can run in parallel", "topological phases", "parallel groups", "early termination on confirmation", "task graph".

When NOT to Use

  • The work is genuinely linear (one task per level) — the DAG annotation overhead exceeds the benefit
  • You need runtime fault isolation / replay across distributed workers (that is event-driven orchestration, a different layer)
  • The decision is which model or pipeline shape to use (architecture selection)

Process

StepInputActionOutputVerification
1task rows (id, depends_on, duration_s, priority)lib.tasks_from_dicts(rows){id: Task} mapunknown-dep / self-dep raises before planning
2task maplib.topological_phases(tasks)list of levels (each a parallel group)every task appears once; deps land in an earlier level; cycle raises CycleError
3task maplib.build_investigation_dag(tasks)InvestigationDAG (phases, parallelism_factor, total/critical-path)parallel-phase duration == max of its tasks; total == sum of phase maxima
4dag + task map + test_fnlib.execute_with_early_termination(...)trace with confirmed id + phases_run/skippedonce confirmed, later phases are skipped

Rationalizations

Agent rationalizationDocumented rebuttal
"Just test every hypothesis sequentially — simpler."The chapter's whole point: parallel phases "slash latency" and early termination "can dramatically reduce investigation time." Independent hypotheses tested serially waste the parallel window.
"Sum the durations to estimate total time."Wrong for parallel phases. The chapter is explicit: "the estimated duration for a parallel phase is the maximum duration of its individual tests since they run concurrently." Summing within a phase over-estimates.
"Run all phases to be thorough."Early termination is the optimization: "As soon as a hypothesis is confirmed with sufficient corroborating evidence, there is no need to continue testing alternatives." Thoroughness past confirmation is wasted compute.
"A cycle just means re-run until it settles."A cycle is a malformed plan — there is no valid topological order. Surface it (CycleError) so the planner fixes the dependency, do not loop.

Red Flags

  • One giant phase with everything in it. No dependencies were extracted — either the task really is embarrassingly parallel, or the dependency extraction failed and you are about to test in an unsafe order.
  • Critical path == task count. Every task depends on the previous one; this is a linear pipeline wearing a DAG costume — use a sequential pipeline.
  • parallelism_factor == 0 on a multi-hypothesis investigation. The planner found no parallel-safe group; check that independent hypotheses were not given spurious dependencies.

Non-Negotiable Verification

  1. Run the benchmark battery. python cli.py benchmark must report:
    • independent tasks land in the same (first) phase
    • a dependent task lands strictly after its dependency
    • parallel-phase duration equals the max of its tasks; total equals sum of maxima
    • a cycle raises CycleError
    • early termination skips phases after a confirmation
    • within-phase ordering respects priority
  2. Verify CLI help. Exits 0 and prints the SKILL.md description.

Security Posture

  • Prompt injection. Task rows (ids, dependencies, priorities, durations) are data-only input, often LLM-proposed. The planner only sorts and groups them - nothing is executed here - but forged dependencies or inflated priorities can reorder an investigation to bury a hypothesis; malformed graphs surface as CycleError instead of silent mis-execution.
  • Data exfiltration. No network calls, no file writes. Hypothesis names and durations may describe internal infrastructure; they stay in-process and appear only in the stdout phase plan the caller owns.
  • Privilege escalation. No shell invocation, no eval. The DAG is a schedule, not an authorization: the harness that runs each phase's tests must still gate each action against the capability model (constraint-guided-plan-validator).

Source Attribution

Distilled from Agentic GraphRAG (O'Reilly, by Anthony Alcaraz and Sam Julien) Ch5 — Reasoning & Planning: "Dynamic DAG construction" (Example 5-15, GraphConstructingPlanningNode) and the DevOps agent's "Constructing the Investigation DAG" section (phases, max-duration parallel model, early termination on confirmation). The topological-sort framing connects to the chapter's "Task graphs at developer scale" (Beads bd ready).

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Investigation Dag Planner faz?

Dynamic-DAG construction for a planning node (Ch5 Example 5-15 + the DevOps "Constructing the Investigation DAG" section). Given hypotheses/tasks with dependency constraints, compute a topological-level decomposition: each level is a phase of tasks that can run concurrently, ordered within-phase by priority. The estimated duration of a parallel phase is the MAX over its concurrent tests, and execution runs phase-by-phase with early termination once a hypothesis is confirmed. Detects dependency cycles as malformed plans. Use when a planning node must decide which work is parallel-safe and in...

Por que usar Investigation Dag Planner no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Investigation Dag Planner é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Investigation Dag Planner no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/reasoning-planning/investigation-dag-planner. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Investigation Dag Planner?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Investigation Dag Planner?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Investigation Dag Planner com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Investigation Dag Planner é gratuita?

Sim. A habilidade é publicada no GitHub por AnthonyAlcaraz sob a licença MIT. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇