Documentation
¶
Overview ¶
Package plugins provides AgentPlugin implementations for optional agent features.
Each plugin wraps a runner interface from the agent package and integrates with the Pipeline via the AgentPlugin system (agent/agent_plugin.go).
Index ¶
- type EnhancedMemoryAfterPlugin
- func (p *EnhancedMemoryAfterPlugin) AfterExecute(ctx context.Context, pc *agent.PipelineContext) error
- func (p *EnhancedMemoryAfterPlugin) Init(_ context.Context) error
- func (p *EnhancedMemoryAfterPlugin) Name() string
- func (p *EnhancedMemoryAfterPlugin) Phase() agent.PluginPhase
- func (p *EnhancedMemoryAfterPlugin) Priority() int
- func (p *EnhancedMemoryAfterPlugin) Shutdown(_ context.Context) error
- type EnhancedMemoryBeforePlugin
- func (p *EnhancedMemoryBeforePlugin) BeforeExecute(ctx context.Context, pc *agent.PipelineContext) error
- func (p *EnhancedMemoryBeforePlugin) Init(_ context.Context) error
- func (p *EnhancedMemoryBeforePlugin) Name() string
- func (p *EnhancedMemoryBeforePlugin) Phase() agent.PluginPhase
- func (p *EnhancedMemoryBeforePlugin) Priority() int
- func (p *EnhancedMemoryBeforePlugin) Shutdown(_ context.Context) error
- type ObservabilityPlugin
- func (p *ObservabilityPlugin) AroundExecute(ctx context.Context, pc *agent.PipelineContext, ...) error
- func (p *ObservabilityPlugin) Init(_ context.Context) error
- func (p *ObservabilityPlugin) Name() string
- func (p *ObservabilityPlugin) Phase() agent.PluginPhase
- func (p *ObservabilityPlugin) Priority() int
- func (p *ObservabilityPlugin) Shutdown(_ context.Context) error
- type PromptEnhancerPlugin
- func (p *PromptEnhancerPlugin) BeforeExecute(_ context.Context, pc *agent.PipelineContext) error
- func (p *PromptEnhancerPlugin) Init(_ context.Context) error
- func (p *PromptEnhancerPlugin) Name() string
- func (p *PromptEnhancerPlugin) Phase() agent.PluginPhase
- func (p *PromptEnhancerPlugin) Priority() int
- func (p *PromptEnhancerPlugin) Shutdown(_ context.Context) error
- type ReflectionPlugin
- func (p *ReflectionPlugin) AroundExecute(ctx context.Context, pc *agent.PipelineContext, ...) error
- func (p *ReflectionPlugin) Init(_ context.Context) error
- func (p *ReflectionPlugin) Name() string
- func (p *ReflectionPlugin) Phase() agent.PluginPhase
- func (p *ReflectionPlugin) Priority() int
- func (p *ReflectionPlugin) Shutdown(_ context.Context) error
- type SkillsPlugin
- func (p *SkillsPlugin) BeforeExecute(ctx context.Context, pc *agent.PipelineContext) error
- func (p *SkillsPlugin) Init(_ context.Context) error
- func (p *SkillsPlugin) Name() string
- func (p *SkillsPlugin) Phase() agent.PluginPhase
- func (p *SkillsPlugin) Priority() int
- func (p *SkillsPlugin) Shutdown(_ context.Context) error
- type ToolSelectionPlugin
- func (p *ToolSelectionPlugin) BeforeExecute(ctx context.Context, pc *agent.PipelineContext) error
- func (p *ToolSelectionPlugin) Init(_ context.Context) error
- func (p *ToolSelectionPlugin) Name() string
- func (p *ToolSelectionPlugin) Phase() agent.PluginPhase
- func (p *ToolSelectionPlugin) Priority() int
- func (p *ToolSelectionPlugin) Shutdown(_ context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnhancedMemoryAfterPlugin ¶ added in v1.2.0
type EnhancedMemoryAfterPlugin struct {
// contains filtered or unexported fields
}
EnhancedMemoryAfterPlugin saves output to enhanced memory after execution. Phase: AfterExecute, Priority: 60.
func NewEnhancedMemoryAfterPlugin ¶ added in v1.2.0
func NewEnhancedMemoryAfterPlugin(runner agent.EnhancedMemoryRunner, useReflection bool) *EnhancedMemoryAfterPlugin
NewEnhancedMemoryAfterPlugin creates the after-execute memory plugin.
func (*EnhancedMemoryAfterPlugin) AfterExecute ¶ added in v1.2.0
func (p *EnhancedMemoryAfterPlugin) AfterExecute(ctx context.Context, pc *agent.PipelineContext) error
AfterExecute saves the output to enhanced memory and records an episode.
func (*EnhancedMemoryAfterPlugin) Init ¶ added in v1.2.0
func (p *EnhancedMemoryAfterPlugin) Init(_ context.Context) error
func (*EnhancedMemoryAfterPlugin) Name ¶ added in v1.2.0
func (p *EnhancedMemoryAfterPlugin) Name() string
func (*EnhancedMemoryAfterPlugin) Phase ¶ added in v1.2.0
func (p *EnhancedMemoryAfterPlugin) Phase() agent.PluginPhase
func (*EnhancedMemoryAfterPlugin) Priority ¶ added in v1.2.0
func (p *EnhancedMemoryAfterPlugin) Priority() int
type EnhancedMemoryBeforePlugin ¶ added in v1.2.0
type EnhancedMemoryBeforePlugin struct {
// contains filtered or unexported fields
}
EnhancedMemoryBeforePlugin loads working and short-term memory before execution. Phase: BeforeExecute, Priority: 20.
func NewEnhancedMemoryBeforePlugin ¶ added in v1.2.0
func NewEnhancedMemoryBeforePlugin(runner agent.EnhancedMemoryRunner, loadWorking, loadShortTerm, skipBase bool) *EnhancedMemoryBeforePlugin
NewEnhancedMemoryBeforePlugin creates the before-execute memory plugin.
func (*EnhancedMemoryBeforePlugin) BeforeExecute ¶ added in v1.2.0
func (p *EnhancedMemoryBeforePlugin) BeforeExecute(ctx context.Context, pc *agent.PipelineContext) error
BeforeExecute loads enhanced memory context into PipelineContext metadata.
func (*EnhancedMemoryBeforePlugin) Init ¶ added in v1.2.0
func (p *EnhancedMemoryBeforePlugin) Init(_ context.Context) error
func (*EnhancedMemoryBeforePlugin) Name ¶ added in v1.2.0
func (p *EnhancedMemoryBeforePlugin) Name() string
func (*EnhancedMemoryBeforePlugin) Phase ¶ added in v1.2.0
func (p *EnhancedMemoryBeforePlugin) Phase() agent.PluginPhase
func (*EnhancedMemoryBeforePlugin) Priority ¶ added in v1.2.0
func (p *EnhancedMemoryBeforePlugin) Priority() int
type ObservabilityPlugin ¶ added in v1.2.0
type ObservabilityPlugin struct {
// contains filtered or unexported fields
}
ObservabilityPlugin wraps the entire execution with tracing and metrics. Phase: AroundExecute, Priority: 0 (outermost wrapper).
func NewObservabilityPlugin ¶ added in v1.2.0
func NewObservabilityPlugin(runner agent.ObservabilityRunner, recordMetrics, recordTrace bool) *ObservabilityPlugin
NewObservabilityPlugin creates an observability plugin.
func (*ObservabilityPlugin) AroundExecute ¶ added in v1.2.0
func (p *ObservabilityPlugin) AroundExecute(ctx context.Context, pc *agent.PipelineContext, next func(context.Context, *agent.PipelineContext) error) error
AroundExecute starts a trace, calls next, then ends the trace and records metrics.
func (*ObservabilityPlugin) Init ¶ added in v1.2.0
func (p *ObservabilityPlugin) Init(_ context.Context) error
func (*ObservabilityPlugin) Name ¶ added in v1.2.0
func (p *ObservabilityPlugin) Name() string
func (*ObservabilityPlugin) Phase ¶ added in v1.2.0
func (p *ObservabilityPlugin) Phase() agent.PluginPhase
func (*ObservabilityPlugin) Priority ¶ added in v1.2.0
func (p *ObservabilityPlugin) Priority() int
type PromptEnhancerPlugin ¶ added in v1.2.0
type PromptEnhancerPlugin struct {
// contains filtered or unexported fields
}
PromptEnhancerPlugin enhances the user prompt with additional context. Phase: BeforeExecute, Priority: 30.
func NewPromptEnhancerPlugin ¶ added in v1.2.0
func NewPromptEnhancerPlugin(runner agent.PromptEnhancerRunner) *PromptEnhancerPlugin
NewPromptEnhancerPlugin creates a prompt enhancer plugin.
func (*PromptEnhancerPlugin) BeforeExecute ¶ added in v1.2.0
func (p *PromptEnhancerPlugin) BeforeExecute(_ context.Context, pc *agent.PipelineContext) error
BeforeExecute enhances the user prompt using skill instructions and memory context.
func (*PromptEnhancerPlugin) Init ¶ added in v1.2.0
func (p *PromptEnhancerPlugin) Init(_ context.Context) error
func (*PromptEnhancerPlugin) Name ¶ added in v1.2.0
func (p *PromptEnhancerPlugin) Name() string
func (*PromptEnhancerPlugin) Phase ¶ added in v1.2.0
func (p *PromptEnhancerPlugin) Phase() agent.PluginPhase
func (*PromptEnhancerPlugin) Priority ¶ added in v1.2.0
func (p *PromptEnhancerPlugin) Priority() int
type ReflectionPlugin ¶ added in v1.2.0
type ReflectionPlugin struct {
// contains filtered or unexported fields
}
ReflectionPlugin replaces the core LLM execution with reflection-based execution. Phase: AroundExecute, Priority: 50.
func NewReflectionPlugin ¶ added in v1.2.0
func NewReflectionPlugin(runner agent.ReflectionRunner) *ReflectionPlugin
NewReflectionPlugin creates a reflection plugin.
func (*ReflectionPlugin) AroundExecute ¶ added in v1.2.0
func (p *ReflectionPlugin) AroundExecute(ctx context.Context, pc *agent.PipelineContext, next func(context.Context, *agent.PipelineContext) error) error
AroundExecute intercepts execution and uses reflection-based execution instead. If reflection produces a result with GetFinalOutput(), it populates the PipelineContext and skips the normal LLM call chain. Otherwise falls through to next.
func (*ReflectionPlugin) Init ¶ added in v1.2.0
func (p *ReflectionPlugin) Init(_ context.Context) error
func (*ReflectionPlugin) Name ¶ added in v1.2.0
func (p *ReflectionPlugin) Name() string
func (*ReflectionPlugin) Phase ¶ added in v1.2.0
func (p *ReflectionPlugin) Phase() agent.PluginPhase
func (*ReflectionPlugin) Priority ¶ added in v1.2.0
func (p *ReflectionPlugin) Priority() int
type SkillsPlugin ¶ added in v1.2.0
type SkillsPlugin struct {
// contains filtered or unexported fields
}
SkillsPlugin discovers relevant skills and prepends instructions to the input. Phase: BeforeExecute, Priority: 10.
func NewSkillsPlugin ¶ added in v1.2.0
func NewSkillsPlugin(discoverer agent.SkillDiscoverer, query string) *SkillsPlugin
NewSkillsPlugin creates a skills discovery plugin.
func (*SkillsPlugin) BeforeExecute ¶ added in v1.2.0
func (p *SkillsPlugin) BeforeExecute(ctx context.Context, pc *agent.PipelineContext) error
BeforeExecute discovers skills and prepends instructions to the input content.
func (*SkillsPlugin) Name ¶ added in v1.2.0
func (p *SkillsPlugin) Name() string
func (*SkillsPlugin) Phase ¶ added in v1.2.0
func (p *SkillsPlugin) Phase() agent.PluginPhase
func (*SkillsPlugin) Priority ¶ added in v1.2.0
func (p *SkillsPlugin) Priority() int
type ToolSelectionPlugin ¶ added in v1.2.0
type ToolSelectionPlugin struct {
// contains filtered or unexported fields
}
ToolSelectionPlugin dynamically selects tools based on the task. Phase: BeforeExecute, Priority: 40.
func NewToolSelectionPlugin ¶ added in v1.2.0
func NewToolSelectionPlugin(runner agent.DynamicToolSelectorRunner, toolManager agent.ToolManager, agentID string) *ToolSelectionPlugin
NewToolSelectionPlugin creates a tool selection plugin.
func (*ToolSelectionPlugin) BeforeExecute ¶ added in v1.2.0
func (p *ToolSelectionPlugin) BeforeExecute(ctx context.Context, pc *agent.PipelineContext) error
BeforeExecute selects tools dynamically based on the input content.
func (*ToolSelectionPlugin) Init ¶ added in v1.2.0
func (p *ToolSelectionPlugin) Init(_ context.Context) error
func (*ToolSelectionPlugin) Name ¶ added in v1.2.0
func (p *ToolSelectionPlugin) Name() string
func (*ToolSelectionPlugin) Phase ¶ added in v1.2.0
func (p *ToolSelectionPlugin) Phase() agent.PluginPhase
func (*ToolSelectionPlugin) Priority ¶ added in v1.2.0
func (p *ToolSelectionPlugin) Priority() int