Logo von 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).

Übersicht

HerausgeberAnthonyAlcaraz
Repositoryagentic-graph-rag-skills
Skill-Nameloop-pipeline-router
Sterne
29
Forks
9
Mitgelieferte Dateien
2
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • Mitgelieferte Dateien: 2

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von AnthonyAlcaraz auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Loop Pipeline Router in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/reasoning-planning/loop-pipeline-router
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

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
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Loop Pipeline Router in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Loop Pipeline Router automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Loop Pipeline Router nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

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.

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill 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...

Warum Loop Pipeline Router in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Loop Pipeline Router besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Loop Pipeline Router in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/reasoning-planning/loop-pipeline-router ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Loop Pipeline Router nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Loop Pipeline Router verwenden?

So viele Sie möchten. In TypingMind können Sie Loop Pipeline Router mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Loop Pipeline Router kostenlos?

Ja. Der Skill wird von AnthonyAlcaraz auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇