Documentation
¶
Overview ¶
Package loops provides REAL/VEAL loop pattern support for multi-agent systems.
Loops are autonomous, bounded execution patterns that run without human intervention until they complete or escalate.
REAL (Read Eval Act Loop) - Mission-driven loops for open-ended tasks VEAL (Validate Eval Act Loop) - State-driven validation loops
Example usage:
// Load loops from directory
loopSet, err := loops.LoadLoopSet("specs/loops")
// Get a specific loop
qaLoop, _ := loopSet.Get("qa-fix")
// Generate loop instructions for an agent
instructions := loops.GenerateLoopInstructions(qaLoop, "validator")
// Enrich an agent with loop participation
enrichedAgent := loops.EnrichAgentWithLoop(agent, qaLoop, "actor")
Index ¶
- Constants
- func AgentsFromLoop(loop *Loop) []string
- func EnrichAgentWithLoop(agent *multiagentspec.Agent, loop *Loop, role string) *multiagentspec.Agent
- func GenerateCoordinatorInstructions(loops []*Loop) string
- func GenerateLoopInstructions(loop *Loop, role string) string
- type CheckType
- type EscalationPolicy
- type Loop
- type LoopAgentConfig
- type LoopCheck
- type LoopSet
- type LoopType
Constants ¶
const ( LoopREAL = core.LoopREAL LoopVEAL = core.LoopVEAL )
Loop type constants.
const ( CheckTypeCommand = core.CheckTypeCommand CheckTypePattern = core.CheckTypePattern CheckTypeFile = core.CheckTypeFile CheckTypeManual = core.CheckTypeManual )
Check type constants.
const ( EscalationHuman = core.EscalationHuman EscalationAbort = core.EscalationAbort EscalationContinue = core.EscalationContinue EscalationFallback = core.EscalationFallback )
Escalation policy constants.
Variables ¶
This section is empty.
Functions ¶
func AgentsFromLoop ¶
AgentsFromLoop returns the agent names involved in a loop.
func EnrichAgentWithLoop ¶
func EnrichAgentWithLoop(agent *multiagentspec.Agent, loop *Loop, role string) *multiagentspec.Agent
EnrichAgentWithLoop adds loop participation instructions to an agent.
func GenerateCoordinatorInstructions ¶
GenerateCoordinatorInstructions generates instructions for a loop coordinator.
func GenerateLoopInstructions ¶
GenerateLoopInstructions generates loop-aware instructions for an agent.
Types ¶
type EscalationPolicy ¶
type EscalationPolicy = core.EscalationPolicy
EscalationPolicy defines what to do when max attempts are reached.
type Loop ¶
Loop is the canonical loop type.
func LoadLoopFromFile ¶
LoadLoopFromFile loads a loop from a JSON or YAML file.
func LoadLoopsFromDir ¶
LoadLoopsFromDir loads all loops from a directory.
func NewREALLoop ¶
NewREALLoop creates a new REAL loop with actor agent and mission.
func NewVEALLoop ¶
NewVEALLoop creates a new VEAL loop with validator and actor agents.
type LoopAgentConfig ¶
type LoopAgentConfig = core.LoopAgentConfig
LoopAgentConfig describes how to generate agents from a loop.
func DefaultLoopAgentConfig ¶
func DefaultLoopAgentConfig() *LoopAgentConfig
DefaultLoopAgentConfig returns the default configuration.
type LoopSet ¶
LoopSet is a collection of loops indexed by name.
func LoadLoopSet ¶
LoadLoopSet loads a LoopSet from a directory.