NAME
Sim::AgentSoar::Worker - Constrained LLM-backed heuristic proposal engine
SYNOPSIS
use Sim::AgentSoar::Worker;
my $worker = Sim::AgentSoar::Worker->new(
model => 'llama3.2:1b',
);
my $operator = $worker->propose(
value => 8,
target => 19,
metric => 11,
);
DESCRIPTION
Sim::AgentSoar::Worker provides a strictly constrained interface between the deterministic search controller and a locally hosted Large Language Model (LLM) via Ollama.
The Worker does not perform search, evaluation, or structural reasoning. It is limited to proposing candidate operators under tightly controlled prompts.
Design Constraints
The Worker is intentionally restricted:
It may only propose operators from the Engine's allowed list.
It does not evaluate goal satisfaction.
It cannot alter search ordering.
It cannot introduce new operators.
It cannot mutate search topology.
All outputs are validated against deterministic constraints before being accepted by the search controller.
Interaction Model
The Worker operates in two phases:
- 1. Proposal phase (propose)
-
Given current state and target, the model proposes one operator.
- 2. Optional correction phase (correct)
-
If regression exceeds a specified tolerance, the model may revise the proposal once. This constitutes bounded internal recursion.
The recursion is strictly limited to one correction pass to prevent narrative drift or uncontrolled self-reflection.
LLM Containment Philosophy
This module embodies a containment model:
Structural recursion lives in
AgentSoar.Deterministic evaluation lives in
Engine.Heuristic intuition lives in the LLM.
The LLM is treated as a stochastic heuristic oracle, not as a controller. All invariant enforcement remains deterministic.
METHODS
new
my $worker = Sim::AgentSoar::Worker->new(
model => 'llama3.2:1b',
);
Creates a new worker instance.
propose
my $op = $worker->propose(
value => $value,
target => $target,
metric => $metric,
);
Returns a single operator string.
correct
my $op = $worker->correct(
value => $value,
target => $target,
operator => $previous_op,
old_metric => $old_metric,
new_metric => $new_metric,
regression_tolerance => $tolerance,
);
Performs a single bounded correction pass.
DEPENDENCIES
Requires:
Ollama installed locally
A running Ollama daemon (
ollama serve)A local model compatible with JSON output
SECURITY AND VALIDATION
All LLM output is parsed as strict JSON and validated against the Engine's operator list. Invalid or unexpected output causes immediate failure.
RESEARCH NOTES
This module explores a hybrid architecture in which LLMs serve as heuristic bias mechanisms within deterministic symbolic search.
The design explicitly prevents:
Topological mutation
Self-modifying search logic
Operator invention
Unbounded recursive reflection
The containment boundary is intentional and architectural.
AUTHOR
Gian Luca Brunetti (2026), gianluca.brunetti@gmail.com