decisiontree

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package decisiontree maps user intent to agent execution strategies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	ID         string        `json:"id"`
	Name       string        `json:"name"`
	Condition  string        `json:"condition"`
	Action     string        `json:"action"`
	Priority   int           `json:"priority"`
	Children   []*Node       `json:"children"`
	AgentTypes []string      `json:"agent_types"`
	Parameters model.AWSData `json:"parameters"`
}

type Tree

type Tree struct {
	Root        *Node
	CurrentPath []string
	Decisions   []Node
}

func New

func New() *Tree

New constructs the default decision tree, wiring root children that match common observability scenarios.

func (*Tree) Traverse

func (t *Tree) Traverse(query string, ctx *model.AgentContext) []*Node

Traverse walks the tree depth-first and returns every node whose condition matches the query/context. The returned slice (applicable nodes) is fed to the coordinator to spawn agents, while CurrentPath/Decisions capture the rules that matched for auditing and metadata.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL