Documentation
¶
Index ¶
- func Run(configPath string) error
- func RunWithConfig(config *Config) error
- func RunWithConfigAndRuntime(config *Config, rt agent.Runtime) error
- func RunWithMCP(configPath string, servers ...*mcp.Server) error
- func StartAgents(agents map[string]agent.Agent, agentDefs []agent.AgentDef, rt agent.Runtime) error
- type Config
- type ConfigLoader
- type FileReader
- type MCPAuthDef
- type MCPServerDef
- type MockFileReader
- type ModelServiceDef
- type OSFileReader
- type PhasedStarter
- type SimpleRuntime
- func (r *SimpleRuntime) Broadcast(msg *agent.Message) error
- func (r *SimpleRuntime) Call(ctx context.Context, target string, input *agent.Message) (*agent.Message, error)
- func (r *SimpleRuntime) CallParallel(ctx context.Context, targets []string, input *agent.Message) (map[string]*agent.Message, map[string]error)
- func (r *SimpleRuntime) Get(name string) (agent.Agent, error)
- func (r *SimpleRuntime) List() []string
- func (r *SimpleRuntime) Recv(source string) (<-chan *agent.Message, error)
- func (r *SimpleRuntime) Register(a agent.Agent) error
- func (r *SimpleRuntime) Send(target string, msg *agent.Message) error
- func (r *SimpleRuntime) Start(ctx context.Context) error
- func (r *SimpleRuntime) StartAgentsPhased(ctx context.Context, agentDefs map[string]agent.AgentDef) error
- func (r *SimpleRuntime) Stop(ctx context.Context) error
- func (r *SimpleRuntime) Unregister(name string) error
- type SupervisorDef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunWithConfig ¶
RunWithConfig starts the aixgo agent system with the provided config
func RunWithConfigAndRuntime ¶
RunWithConfigAndRuntime starts the system with a custom runtime (useful for testing)
func RunWithMCP ¶
RunWithMCP starts the aixgo agent system with optional MCP servers
func StartAgents ¶
StartAgents starts all agents with the given runtime using dependency-aware phased startup. If the runtime supports PhasedStarter interface, agents are started in topological order based on their depends_on declarations. Otherwise, agents are started concurrently.
Types ¶
type Config ¶
type Config struct {
Supervisor SupervisorDef `yaml:"supervisor,omitempty"`
MCPServers []MCPServerDef `yaml:"mcp_servers,omitempty"`
ModelServices []ModelServiceDef `yaml:"model_services,omitempty"`
Agents []agent.AgentDef `yaml:"agents"`
}
Config represents the top-level configuration
type ConfigLoader ¶
type ConfigLoader struct {
// contains filtered or unexported fields
}
ConfigLoader loads configuration from a file
func NewConfigLoader ¶
func NewConfigLoader(fr FileReader) *ConfigLoader
NewConfigLoader creates a new config loader with default security limits
func NewConfigLoaderWithLimits ¶
func NewConfigLoaderWithLimits(fr FileReader, limits security.YAMLLimits) *ConfigLoader
NewConfigLoaderWithLimits creates a new config loader with custom YAML security limits
func (*ConfigLoader) LoadConfig ¶
func (cl *ConfigLoader) LoadConfig(configPath string) (*Config, error)
LoadConfig loads and parses a config file with security limits
type FileReader ¶
FileReader interface for reading files (testable)
type MCPAuthDef ¶
type MCPAuthDef struct {
Type string `yaml:"type"` // "bearer", "oauth"
Token string `yaml:"token,omitempty"`
TokenEnv string `yaml:"token_env,omitempty"`
}
MCPAuthDef represents MCP authentication configuration
type MCPServerDef ¶
type MCPServerDef struct {
Name string `yaml:"name"`
Transport string `yaml:"transport"` // "local" or "grpc"
Address string `yaml:"address,omitempty"`
TLS bool `yaml:"tls,omitempty"`
Auth *MCPAuthDef `yaml:"auth,omitempty"`
}
MCPServerDef represents an MCP server configuration
type MockFileReader ¶
type MockFileReader struct {
// contains filtered or unexported fields
}
MockFileReader is a mock implementation of FileReader for testing
func NewMockFileReader ¶
func NewMockFileReader() *MockFileReader
NewMockFileReader creates a new mock file reader
func (*MockFileReader) AddFile ¶
func (m *MockFileReader) AddFile(path string, content []byte)
AddFile adds a file to the mock file system
func (*MockFileReader) ReadFile ¶
func (m *MockFileReader) ReadFile(path string) ([]byte, error)
ReadFile implements FileReader.ReadFile
func (*MockFileReader) SetError ¶
func (m *MockFileReader) SetError(err error)
SetError sets an error to return from ReadFile
type ModelServiceDef ¶
type ModelServiceDef struct {
Name string `yaml:"name"`
Provider string `yaml:"provider"` // "huggingface", "openai", etc.
Model string `yaml:"model"` // Model ID
Runtime string `yaml:"runtime"` // "ollama", "vllm", "cloud"
Transport string `yaml:"transport"` // "local", "grpc"
Address string `yaml:"address,omitempty"`
Config map[string]any `yaml:"config,omitempty"`
}
ModelServiceDef represents a model service configuration
type PhasedStarter ¶ added in v0.2.3
type PhasedStarter interface {
StartAgentsPhased(ctx context.Context, agentDefs map[string]agent.AgentDef) error
}
PhasedStarter is implemented by runtimes that support phased agent startup. This enables dependency-aware startup ordering.
type SimpleRuntime ¶
type SimpleRuntime struct {
// contains filtered or unexported fields
}
SimpleRuntime is a basic in-memory implementation of the Runtime interface
func NewSimpleRuntime ¶
func NewSimpleRuntime() *SimpleRuntime
NewSimpleRuntime creates a new SimpleRuntime
func (*SimpleRuntime) Broadcast ¶
func (r *SimpleRuntime) Broadcast(msg *agent.Message) error
Broadcast sends a message to all channels (stub implementation for compatibility)
func (*SimpleRuntime) Call ¶
func (r *SimpleRuntime) Call(ctx context.Context, target string, input *agent.Message) (*agent.Message, error)
Call invokes an agent synchronously and waits for response
func (*SimpleRuntime) CallParallel ¶
func (r *SimpleRuntime) CallParallel(ctx context.Context, targets []string, input *agent.Message) (map[string]*agent.Message, map[string]error)
CallParallel invokes multiple agents concurrently and returns all results
func (*SimpleRuntime) Get ¶
func (r *SimpleRuntime) Get(name string) (agent.Agent, error)
Get retrieves a registered agent by name
func (*SimpleRuntime) List ¶
func (r *SimpleRuntime) List() []string
List returns all registered agent names
func (*SimpleRuntime) Recv ¶
func (r *SimpleRuntime) Recv(source string) (<-chan *agent.Message, error)
Recv returns a channel to receive messages from a source
func (*SimpleRuntime) Register ¶
func (r *SimpleRuntime) Register(a agent.Agent) error
Register registers an agent with the runtime
func (*SimpleRuntime) Send ¶
func (r *SimpleRuntime) Send(target string, msg *agent.Message) error
Send sends a message to a target channel
func (*SimpleRuntime) Start ¶
func (r *SimpleRuntime) Start(ctx context.Context) error
Start starts the runtime
func (*SimpleRuntime) StartAgentsPhased ¶ added in v0.2.3
func (r *SimpleRuntime) StartAgentsPhased(ctx context.Context, agentDefs map[string]agent.AgentDef) error
StartAgentsPhased starts all registered agents in dependency order. Agents are started in phases based on their dependencies:
- Phase 0: Agents with no dependencies
- Phase N: Agents whose dependencies are all in phases < N
Within each phase, agents are started concurrently and the method waits for all of them to report Ready() before proceeding to the next phase.
func (*SimpleRuntime) Stop ¶
func (r *SimpleRuntime) Stop(ctx context.Context) error
Stop gracefully shuts down the runtime
func (*SimpleRuntime) Unregister ¶
func (r *SimpleRuntime) Unregister(name string) error
Unregister removes an agent from the runtime
type SupervisorDef ¶
type SupervisorDef struct {
Name string `yaml:"name"`
Model string `yaml:"model"`
MaxRounds int `yaml:"max_rounds,omitempty"`
}
SupervisorDef represents supervisor configuration
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agent provides the public interfaces for building agents with Aixgo.
|
Package agent provides the public interfaces for building agents with Aixgo. |
|
cmd
|
|
|
benchmark
command
|
|
|
deploy/cloudrun
command
|
|
|
deploy/k8s
command
|
|
|
orchestrator
command
|
|
|
tools/generate-proto
command
|
|
|
deploy
|
|
|
cloudrun
command
deploy.go - Deploy aixgo to Google Cloud Run Run with: go run deploy.go
|
deploy.go - Deploy aixgo to Google Cloud Run Run with: go run deploy.go |
|
aggregator-workflow
command
|
|
|
classifier-workflow
command
|
|
|
huggingface-mcp
command
|
|
|
parallel-research
command
|
|
|
rag-agent
command
|
|
|
rag-documentation
command
|
|
|
reflection-code-generation
command
|
|
|
router-cost-optimization
command
|
|
|
internal
|
|
|
graph
Package graph provides dependency graph operations for agent startup ordering.
|
Package graph provides dependency graph operations for agent startup ordering. |
|
pkg
|
|
|
security
Package security provides security utilities for the aixgo framework.
|
Package security provides security utilities for the aixgo framework. |
|
tests
|
|