agent

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: BSD-2-Clause Imports: 2 Imported by: 0

README

Agent Package

The agent package provides a simple orchestration framework for executing AI agents with dependencies.

Usage

pool := agent.NewAgentPool()
pool.WithAgent(myAgent)
results, err := pool.ExecuteAgents(initialInput)

Features

  • Dependency Management: Agents can declare dependencies on other agents.
  • Parallel Execution: Independent agents run in parallel.
  • Error Handling: Propagates errors from agents and handles missing dependencies.

Documentation

Overview

Package agent provides a simple agent orchestration framework.

It allows defining agents with dependencies and executing them in parallel while respecting the dependency graph.

Example Usage:

pool := agent.NewAgentPool()
pool.WithAgent(myAgent)
results, err := pool.ExecuteAgents(initialInput)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentInstance

type AgentInstance interface {
	Name() string
	WaitForResults() []string
	Execute(input map[string]string) (string, error)
}

AgentInstance interface for extensibility

type AgentPool

type AgentPool struct {
	// contains filtered or unexported fields
}

AgentPool to handle agent execution

func NewAgentPool

func NewAgentPool() *AgentPool

NewAgentPool initializes a new AgentPool

func (*AgentPool) ExecuteAgents

func (am *AgentPool) ExecuteAgents(initialInput map[string]string) (map[string]string, error)

ExecuteAgents runs all agents, respecting dependencies

func (*AgentPool) WithAgent

func (am *AgentPool) WithAgent(agent AgentInstance)

WithAgent adds an agent to the manager

Jump to

Keyboard shortcuts

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