Proposal — Agentic Plugin Loops NOT IMPLEMENTED

This page describes a proposed extension for multi-step plugin orchestration. Currently, plugins are single-pass: they receive evidence and return one result. This proposal enables iterative reasoning loops.

The Problem

Some tasks require multiple steps. Example: a Z3 solver determines a constraint set is UNSAT. To find a solution, it needs to relax a variable, which requires re-querying the KB for alternative values, then re-running Z3 with the new evidence.

Current limitation: the plugin gets one shot. If it needs more information, it can't ask for it.

Engine Plugin success → done continuation Retrieve feed new evidence back

Proposed Continuation Protocol

A plugin signals it needs more work by returning Status: continuation:

## Plugin Result
Status: continuation
Plugin: z3-solver
Confidence: low

## Continuation Request
Action: retrieve
Query: Alternative values for variable X when constraint Y is relaxed
Reason: Initial constraint set is UNSAT. Need relaxation options.

The engine would then:

  1. Parse the continuation request
  2. Run a new retrieval cycle with the plugin's query
  3. Feed the new evidence back to the same plugin on stdin
  4. Repeat until Status: success or Status: error or budget exhausted

Task Dependencies (Multi-Step)

For complex reasoning, a plugin could return multiple sub-tasks with dependencies:

## Continuation Request
Action: multi-step

### Task 1
Action: retrieve
Query: Values of variable X
DependsOn: none

### Task 2
Action: retrieve
Query: Constraints involving variable X
DependsOn: none

### Task 3
Action: plugin
Plugin: z3-solver
Input: Combine results of Task 1 and Task 2
DependsOn: task-1, task-2

The engine would build a DAG, execute independent tasks in parallel, wait for dependencies, detect cycles → error.

Proposed Budget Controls

{
  "maxPluginContinuations": 3,
  "maxPluginTotalTimeMs": 60000,
  "continuationRetrievalProfile": "fast"
}

Why Not Yet

Implementation Path

  1. Add continuation status parsing to plugin manager
  2. Add loop in engine with budget tracking
  3. Add DAG executor for multi-task continuations
  4. Create evaluation suite with multi-step scenarios