Logo di Loop Pipeline Router

Loop Pipeline Router

Community
AnthonyAlcaraz
loop-pipeline-router

The conditional-edge routing that turns a validate node into a bounded self-correcting loop (Ch5 Loop Pipeline + Error-handling strategies, Examples 5-6/5-9). Consumes a validation result, an error severity (correctable vs fundamental), and a retry budget, and returns exactly one of: proceed, refine (loop back with a remaining retry), fallback (alternative strategy once retries are exhausted), or terminate-with-partial (fundamental error). The finite retry budget is the explicit bound that prevents infinite loops. Use when first-attempt success is unrealistic and validation can identify correctable errors — plan refinement, documentation-gap re-requests, transient-failure recovery. NOT for strict sequential pipelines with no feedback (use a sequential pipeline), NOT for parallel branch reconciliation (that is a merge/tree concern), NOT as a substitute for the validator itself (this routes on the validator's output; it does not validate).

Panoramica

Pubblicato daAnthonyAlcaraz
Repositoryagentic-graph-rag-skills
Nome della skillloop-pipeline-router
Stelle
29
Fork
9
File inclusi
2
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 2

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da AnthonyAlcaraz su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Loop Pipeline Router in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/reasoning-planning/loop-pipeline-router
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'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/loop-pipeline-router .claude/skills/loop-pipeline-router
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Loop Pipeline Router in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Loop Pipeline Router non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Loop Pipeline Router non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Loop Pipeline Router

Overview

Loop pipelines introduce feedback for self-correction when perfect first-attempt reasoning is unrealistic. The decision that makes a loop a loop is the conditional edge after the validate node. Naively this is "valid -> proceed, else -> retry" (Example 5-6), but production needs the nuance of Example 5-9: distinguish correctable errors (refine) from fundamental ones (stop), and handle the retries-exhausted case (fall back to an alternative strategy) so the loop neither terminates prematurely nor spins forever.

The unified decision table:

valid                            -> proceed
correctable + retries remaining  -> refine (retry_count += 1, loop back)
correctable + retries exhausted  -> fallback_strategy
fundamental                      -> terminate_with_partial

The finite retry budget (Example 5-6's retry_count < 3 / recursion_limit) is the explicit termination guarantee. An invalid result with no error diagnostic is treated as fundamental — you cannot safely refine what you cannot diagnose.

In the DevOps latency investigation (account 123456789012), document verification on a related claim returns "incomplete" — the operative report lacks anesthesia-time records. That is a correctable error: refine (request the specific missing documentation, re-verify), bounded to three request cycles before escalating. A schema-level contradiction in the plan ("synchronous AND event-driven for the same operation") is fundamental: terminate with partial results rather than burn the retry budget on an unfixable error.

When to Use

  • First-attempt success is unrealistic and a validator can flag correctable errors
  • Documentation-gap re-requests, plan refinement, transient-failure recovery
  • You need a guaranteed-terminating self-correction loop with an audit trace

Phrases: "loop pipeline", "refine and re-validate", "retry with feedback", "correctable vs fundamental error", "fallback planner", "recursion limit".

When NOT to Use

  • Strict sequential pipeline with no feedback (use a sequential pipeline)
  • Parallel-branch reconciliation (that is a merge/tree concern)
  • The validator does not distinguish error kinds (then add severity to the validator first; routing on undifferentiated errors collapses to blind retry)

Process

StepInputActionOutputVerification
1is_valid, error, retry_count, max_retrieslib.route_after_validation(...)RouteResult(decision, retry_count, rationale)valid->proceed; correctable+budget->refine(+1); correctable+exhausted->fallback; fundamental->terminate
2attempt_fn, validate_fn, max_retries, fallback_fnlib.run_loop(...)dict (decision, candidate, iterations, trace)loop always terminates; iterations <= max_retries
3run_loop traceinspect traceper-iteration routing decisionseach refine increments retry_count; one terminal decision

Rationalizations

Agent rationalizationDocumented rebuttal
"Just retry until it passes."Unbounded retry is the infinite-loop failure mode. The chapter bounds it explicitly (retry_count < 3, recursion_limit=10). After the budget, fall back — do not spin.
"Any failure should retry."No — fundamental errors do not become correct by retrying (Example 5-9 routes them to terminate_with_partial). Retrying a schema contradiction wastes the whole budget on an unfixable error.
"If retries run out, just give up entirely."Exhausted correctable retries route to a fallback strategy, not termination. The chapter distinguishes "retries exhausted" (try another approach) from "fundamental" (stop).
"An invalid result with no error detail — I'll guess and refine."You cannot safely refine what you cannot diagnose. Treat missing-diagnostic-on-invalid as fundamental and terminate with partial; surfacing it beats guessing.

Red Flags

  • Every error is classified correctable. The validator is not detecting fundamental errors; the loop will exhaust the budget then fall back on genuinely unfixable inputs.
  • iterations regularly hits max_retries then falls back. The refine step is not actually improving the candidate — the feedback is not making it back into attempt_fn.
  • No terminal proceed across many runs. The validator threshold may be unsatisfiable, or refine is a no-op; the loop is theatre.

Non-Negotiable Verification

  1. Run the benchmark battery. python cli.py benchmark must report:
    • valid -> proceed; fundamental -> terminate_with_partial
    • correctable with budget -> refine and increments retry_count
    • correctable with budget exhausted -> fallback_strategy
    • invalid-with-no-error -> terminate_with_partial
    • run_loop terminates and never exceeds max_retries iterations
    • a candidate that becomes valid after N refines yields proceed at N
  2. Verify CLI help. Exits 0 and prints the SKILL.md description.

Security Posture

  • Prompt injection. Validation results and error diagnostics are untrusted input (often produced by an LLM validator over untrusted content). The router only maps them onto a fixed decision table; a spoofed severity can bias routing - mislabeling "fundamental" as "correctable" burns retries, the reverse suppresses recovery - but nothing is executed.
  • Data exfiltration. No network calls, no file writes. Candidates and error details pass through in-process; the routing trace goes to stdout and the caller owns downstream piping.
  • Privilege escalation. No shell invocation, no eval. The bounded retry budget is also a resource-abuse guard: an adversary who can keep validation failing cannot force an infinite loop, and the fallback path must not carry more privilege than the primary path.

Source Attribution

Distilled from Agentic GraphRAG (O'Reilly, by Anthony Alcaraz and Sam Julien) Ch5 — Reasoning & Planning: "Loop Pipeline: Iterative Refinement" (Example 5-6, check_plan_validity) and "Error-handling strategies" (Example 5-9, route_after_validation). The bounded-loop / recursion_limit guarantee is from Example 5-6.

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Loop Pipeline Router?

The conditional-edge routing that turns a validate node into a bounded self-correcting loop (Ch5 Loop Pipeline + Error-handling strategies, Examples 5-6/5-9). Consumes a validation result, an error severity (correctable vs fundamental), and a retry budget, and returns exactly one of: proceed, refine (loop back with a remaining retry), fallback (alternative strategy once retries are exhausted), or terminate-with-partial (fundamental error). The finite retry budget is the explicit bound that prevents infinite loops. Use when first-attempt success is unrealistic and validation can identify cor...

Perché usare Loop Pipeline Router su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Loop Pipeline Router è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Loop Pipeline Router in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/reasoning-planning/loop-pipeline-router. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Loop Pipeline Router?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Loop Pipeline Router?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Loop Pipeline Router: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Loop Pipeline Router è gratuita?

Sì. È pubblicata su GitHub da AnthonyAlcaraz con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇