Versions in this module Expand all Collapse all v0 v0.0.13 Dec 7, 2025 v0.0.12 Dec 7, 2025 v0.0.11 Dec 7, 2025 v0.0.10 Dec 7, 2025 v0.0.9 Dec 7, 2025 v0.0.8 Dec 7, 2025 v0.0.7 Dec 7, 2025 v0.0.6 Dec 7, 2025 v0.0.5 Dec 7, 2025 v0.0.4 Dec 7, 2025 v0.0.3 Dec 7, 2025 v0.0.2 Dec 7, 2025 Changes in this version + var AutoRunSettings = map[RunMode]struct{ ... } + type BootstrapFewShot struct + MaxBootstrapped int + Metric func(example map[string]interface{}, prediction map[string]interface{}, ...) bool + func NewBootstrapFewShot(...) *BootstrapFewShot + func (b *BootstrapFewShot) Compile(ctx context.Context, program core.Program, dataset core.Dataset, ...) (core.Program, error) + func (b *BootstrapFewShot) CompileLegacy(ctx context.Context, student, teacher core.Program, ...) (core.Program, error) + type COPRO struct + Breadth int + CandidateHistory []PromptCandidate + Depth int + InitTemperature float64 + Metric core.Metric + PromptGenerator *LLMPromptGenerator + PromptModel core.LLM + TrackStats bool + func NewCOPRO(metric core.Metric, options ...COPROOption) *COPRO + func (c *COPRO) Compile(ctx context.Context, program core.Program, dataset core.Dataset, ...) (core.Program, error) + type COPROOption func(*COPROOptions) + func WithBreadth(breadth int) COPROOption + func WithDepth(depth int) COPROOption + func WithInitTemperature(temp float64) COPROOption + func WithPromptModel(model core.LLM) COPROOption + func WithTrackStats(track bool) COPROOption + type COPROOptions struct + Breadth int + Depth int + InitTemperature float64 + PromptModel core.LLM + TrackStats bool + type CandidateMetadata struct + BucketAssignment int + CompositeScore float64 + DiversityScore float64 + ImprovementDelta float64 + IndividualScores []float64 + MaxScore float64 + MaxToAvgGap float64 + MaxToMinGap float64 + SelectionRank int + type CandidateMetrics struct + AverageFitness float64 + BestFitness float64 + ErrorCounts map[string]int + ExecutionTimes []time.Duration + Metadata map[string]interface{} + SuccessCount int + TotalEvaluations int + type CandidateResult struct + CreatedAt time.Time + Metadata *CandidateMetadata + Program core.Program + Score float64 + Step int + Temperature float64 + type ContextAwarePerformanceTracker struct + func NewContextAwarePerformanceTracker() *ContextAwarePerformanceTracker + type ContextPattern struct + Confidence float64 + ContextFeatures map[string]interface{} + FailureFactors []string + LastUpdated time.Time + OptimalCandidates []string + PatternID string + SuccessFactors []string + type ContextPerformanceMetrics struct + AverageLatency time.Duration + ContextType string + ErrorPatterns map[string]int + ExecutionCount int + LastUpdated time.Time + Metadata map[string]interface{} + PerformanceTrend []float64 + QualityScore float64 + SuccessRate float64 + type ConvergenceStatus struct + DiversityIndex float64 + ExplorationExploitationBalance string + IsConverged bool + PrematureConvergenceRisk string + StagnationCount int + type EmbeddingService interface + CosineSimilarity func(vec1, vec2 []float64) float64 + GenerateEmbedding func(ctx context.Context, text string) ([]float64, error) + type ExampleSelector struct + Config *MCPOptimizerConfig + SuccessHistory map[string][]bool + func (es *ExampleSelector) RecordSuccess(interaction MCPInteraction, success bool) + func (es *ExampleSelector) SelectOptimalExamples(ctx context.Context, candidates []MCPInteraction) ([]MCPInteraction, error) + type ExecutionPatterns struct + AverageResponseTime time.Duration + CommonFailures []string + ErrorDistribution map[string]int + PerformanceTrends []float64 + QualityIndicators []string + SuccessCount int + SuccessRate float64 + TotalExecutions int + type ExecutionTrace struct + CandidateID string + ContextData map[string]interface{} + Duration time.Duration + Error error + Inputs map[string]any + ModuleName string + Outputs map[string]any + Success bool + Timestamp time.Time + type GEPA struct + func NewGEPA(config *GEPAConfig) (*GEPA, error) + func (g *GEPA) Compile(ctx context.Context, program core.Program, dataset core.Dataset, ...) (core.Program, error) + func (g *GEPA) GetOptimizationState() *GEPAState + func (g *GEPA) SetProgressReporter(reporter core.ProgressReporter) + type GEPACandidate struct + CreatedAt time.Time + Demonstrations []core.Example + Fitness float64 + Generation int + ID string + Instruction string + Metadata map[string]interface{} + ModuleName string + ParentIDs []string + type GEPAConfig struct + ConcurrencyLevel int + ConvergenceThreshold float64 + CrossoverRate float64 + ElitismRate float64 + EvaluationBatchSize int + GenerationModel string + MaxGenerations int + MaxTokens int + MutationRate float64 + PopulationSize int + ReflectionDepth int + ReflectionFreq int + ReflectionModel string + SelectionStrategy string + SelfCritiqueTemp float64 + StagnationLimit int + Temperature float64 + TournamentSize int + func DefaultGEPAConfig() *GEPAConfig + type GEPAState struct + ArchiveFitnessMap map[string]*MultiObjectiveFitness + BestCandidate *GEPACandidate + BestFitness float64 + CandidateMetrics map[string]*CandidateMetrics + ConvergenceStatus *ConvergenceStatus + CurrentGeneration int + ExecutionTraces map[string][]ExecutionTrace + LastImprovement time.Time + MaxArchiveSize int + MultiObjectiveFitnessMap map[string]*MultiObjectiveFitness + ParetoArchive []*GEPACandidate + PopulationHistory []*Population + ReflectionHistory []*ReflectionResult + StartTime time.Time + func GetGEPAState(ctx context.Context) *GEPAState + func NewGEPAState() *GEPAState + func (s *GEPAState) AddTrace(trace *ExecutionTrace) + func (s *GEPAState) GetParetoArchive() []*GEPACandidate + func (s *GEPAState) GetTracesForCandidate(candidateID string) []ExecutionTrace + func (s *GEPAState) UpdateParetoArchive(candidates []*GEPACandidate, fitnessMap map[string]*MultiObjectiveFitness) + type IndividualReflectionInsights struct + CommonStrengths []string + CommonWeaknesses []string + ConfidenceDistribution map[string]int + FailurePatterns []string + ImprovementThemes []string + SuccessPatterns []string + type InstructionGenerator struct + MaxCandidates int + PromptModel core.LLM + Temperature float64 + func (g *InstructionGenerator) GenerateCandidates(ctx context.Context, program core.Program, demos []core.Example) (map[int][]string, error) + type IntrospectionResult struct + Analysis string + Confidence float64 + IdentifiedPatterns []string + Recommendations []string + SuggestedAdjustments []string + type LLMPromptGenerator struct + func NewLLMPromptGenerator(llm core.LLM, signature core.Signature) *LLMPromptGenerator + type MCPInteraction struct + Context string + ContextVector []float64 + ErrorMessage string + ExecutionTime time.Duration + ID string + Metadata map[string]interface{} + Parameters map[string]interface{} + Result core.ToolResult + Success bool + Timestamp time.Time + ToolName string + type MCPMetrics struct + AverageExecutionTime float64 + ExecutionSuccessRate float64 + InteractionsProcessed int + ParameterOptimality float64 + Timestamp time.Time + ToolSelectionAccuracy float64 + type MCPOptimizer struct + Config *MCPOptimizerConfig + ExampleSelector *ExampleSelector + MetricsEvaluator *MetricsEvaluator + PatternCollector *PatternCollector + SimilarityMatcher *SimilarityMatcher + ToolOrchestrator *ToolOrchestrator + func NewMCPOptimizer(embeddingService EmbeddingService) *MCPOptimizer + func NewMCPOptimizerWithConfig(config *MCPOptimizerConfig, embeddingService EmbeddingService) *MCPOptimizer + func (m *MCPOptimizer) Compile(ctx context.Context, program core.Program, dataset core.Dataset, ...) (core.Program, error) + func (m *MCPOptimizer) GetOptimizationStats() map[string]interface{} + func (m *MCPOptimizer) LearnFromInteraction(ctx context.Context, interaction MCPInteraction) error + func (m *MCPOptimizer) OptimizeInteraction(ctx context.Context, context string, toolName string) (*MCPInteraction, error) + type MCPOptimizerConfig struct + EmbeddingDimensions int + KNearestNeighbors int + LearningEnabled bool + MaxPatterns int + MetricsWindowSize int + OptimizationInterval int + SimilarityThreshold float64 + SuccessWeightFactor float64 + type MIPRO struct + func NewMIPRO(...) *MIPRO + func (m *MIPRO) Compile(ctx context.Context, program core.Program, dataset core.Dataset, ...) (core.Program, error) + type MIPROConfig struct + AdaptiveParams bool + MaxLabeledDemos int + MiniBatchSize int + Mode RunMode + NumModules int + NumTrials int + ScalingFactors struct{ ... } + Seed int64 + TPEGamma float64 + TPEGenerations int + TeacherSettings map[string]interface{} + ValSize int + type MIPROMetrics struct + OptimizationHistory []OptimizationStep + PromptEffectiveness map[string]float64 + StudentPerformance float64 + TeacherPerformance float64 + TokenUsage *core.TokenInfo + type MIPROOption func(*MIPRO) + func WithMaxLabeledDemos(maxDemos int) MIPROOption + func WithMiniBatchSize(size int) MIPROOption + func WithMode(mode RunMode) MIPROOption + func WithModels(promptModel, taskModel core.LLM) MIPROOption + func WithNumCandidates(num int) MIPROOption + func WithNumModules(numModules int) MIPROOption + func WithNumTrials(trials int) MIPROOption + func WithRandomSeed(seed int64) MIPROOption + func WithSearchStrategy(strategy SearchStrategy) MIPROOption + func WithTPEGamma(gamma float64) MIPROOption + func WithTPEGenerations(generations int) MIPROOption + func WithTeacherSettings(settings map[string]interface{}) MIPROOption + type MetricsEvaluator struct + Config *MCPOptimizerConfig + Metrics []MCPMetrics + func (me *MetricsEvaluator) GetAverageMetrics() *MCPMetrics + func (me *MetricsEvaluator) GetLatestMetrics() *MCPMetrics + func (me *MetricsEvaluator) RecordMetrics(ctx context.Context, metrics MCPMetrics) + type MultiObjectiveFitness struct + Diversity float64 + Efficiency float64 + Generalization float64 + Innovation float64 + OutputQuality float64 + Robustness float64 + SuccessRate float64 + WeightedScore float64 + type ObjectiveStats struct + Max float64 + Mean float64 + Min float64 + Range float64 + StdDev float64 + type OptimizationState struct + BestScore float64 + Convergence float64 + CurrentIteration int + PromptEvolution []PromptVersion + SuccessfulPatterns []string + TeacherScores map[string]float64 + type OptimizationStep struct + FailurePoints []string + Improvements []string + Performance float64 + Trial int + type ParetoFront struct + Candidates []*GEPACandidate + Rank int + Size int + type PatternCollector struct + Config *MCPOptimizerConfig + IndexByCtx map[string][]int + IndexByTool map[string][]int + Patterns []MCPInteraction + func (pc *PatternCollector) AddInteraction(ctx context.Context, interaction MCPInteraction) error + func (pc *PatternCollector) GetPatternCount() int + func (pc *PatternCollector) GetPatternsByTool(toolName string) []MCPInteraction + func (pc *PatternCollector) GetSimilarPatterns(ctx context.Context, context string, toolName string) ([]MCPInteraction, error) + type PerformanceContext struct + CandidateID string + ConcurrentTasks int + CustomData map[string]interface{} + ExecutionID string + ExecutionPhase string + Generation int + InputComplexity float64 + InputSize int + InputTypes []string + MemoryUsage float64 + ModuleName string + PopulationSize int + SelectionPressure float64 + SystemLoad float64 + TimeOfDay int + type PerformanceLogger struct + func NewPerformanceLogger() *PerformanceLogger + func (pl *PerformanceLogger) GetCandidateMetrics(candidateID string) *CandidateMetrics + func (pl *PerformanceLogger) LogCandidateMetrics(candidateID string, metrics *CandidateMetrics) + type PipelineChannels struct + BatchSampling chan *PipelineStage + CandidateEvaluation chan *PipelineStage + CandidateGeneration chan *PipelineStage + Done chan struct{} + Errors chan error + Results chan *PipelineStage + type PipelineResult struct + AllScores []float64 + BestProgram core.Program + BestScore float64 + ProcessingTime time.Duration + StageTimings map[string]time.Duration + StepIndex int + type PipelineStage struct + Batch []core.Example + Candidates []core.Program + Error error + Scores []float64 + StepIndex int + Timestamp time.Time + type Population struct + BestCandidate *GEPACandidate + BestFitness float64 + Candidates []*GEPACandidate + Generation int + Size int + type PopulationInsights struct + AverageFitness float64 + BestFitness float64 + CommonWeaknesses []string + DiversityIndex float64 + FitnessVariance float64 + HighPerformingPatterns []string + WorstFitness float64 + type PromptCandidate struct + AttemptID string + Diversity float64 + Generation int + Instruction string + Prefix string + Rank int + Score float64 + ValidationScore float64 + type PromptComponent struct + Content string + Score float64 + Type string + type PromptVersion struct + Components []PromptComponent + Performance float64 + Template string + type ReflectionResult struct + CandidateID string + ConfidenceScore float64 + ReflectionDepth int + Strengths []string + Suggestions []string + Timestamp time.Time + Weaknesses []string + type RunMode string + const HeavyMode + const LightMode + const MediumMode + type SIMBA struct + func NewSIMBA(opts ...SIMBAOption) *SIMBA + func (s *SIMBA) Compile(ctx context.Context, program core.Program, dataset core.Dataset, ...) (core.Program, error) + func (s *SIMBA) GetConfig() SIMBAConfig + func (s *SIMBA) GetState() SIMBAState + type SIMBAConfig struct + BatchSize int + BucketSortingCriteria []string + BucketSortingWeights []float64 + ConvergenceThreshold float64 + DisableInstructionPerturbation bool + DisableRuleGeneration bool + DisableTrajectoryTracking bool + EarlyStoppingPatience int + EarlyStoppingThreshold float64 + FastMode bool + IntrospectionFrequency int + LLMConcurrency int + MaxGoroutines int + MaxSteps int + MinImprovementRatio float64 + NumCandidates int + PipelineBufferSize int + SamplingTemperature float64 + StrategyMode string + StrategyRatio float64 + UseBucketSorting bool + UsePipelineProcessing bool + type SIMBAOption func(*SIMBA) + func WithBucketSorting(enabled bool) SIMBAOption + func WithBucketSortingCriteria(criteria []string) SIMBAOption + func WithBucketSortingWeights(weights []float64) SIMBAOption + func WithFastMode(enabled bool) SIMBAOption + func WithLLMConcurrency(concurrency int) SIMBAOption + func WithPipelineBufferSize(size int) SIMBAOption + func WithPipelineProcessing(enabled bool) SIMBAOption + func WithSIMBABatchSize(size int) SIMBAOption + func WithSIMBAMaxSteps(steps int) SIMBAOption + func WithSIMBANumCandidates(num int) SIMBAOption + func WithSIMBAStrategyMode(mode string) SIMBAOption + func WithSIMBAStrategyRatio(ratio float64) SIMBAOption + func WithSamplingTemperature(temperature float64) SIMBAOption + type SIMBAState struct + BestProgram core.Program + BestScore float64 + CandidateHistory []CandidateResult + CurrentStep int + IntrospectionLog []string + PerformanceLog []StepResult + StartTime time.Time + Trajectories []Trajectory + type SearchConfig struct + Constraints map[string]interface{} + MaxTrials int + ParamSpace map[string][]interface{} + Seed int64 + type SearchStrategy interface + GetBestParams func() (map[string]interface{}, float64) + Initialize func(config SearchConfig) error + SuggestParams func(ctx context.Context) (map[string]interface{}, error) + UpdateResults func(params map[string]interface{}, score float64) error + func NewTPEOptimizer(config TPEConfig) SearchStrategy + type SimilarityMatcher struct + Config *MCPOptimizerConfig + func (sm *SimilarityMatcher) FindSimilarInteractions(ctx context.Context, targetContext string, patterns []MCPInteraction) ([]MCPInteraction, error) + type SimpleEmbeddingService struct + func NewSimpleEmbeddingService(dimensions int) *SimpleEmbeddingService + func (s *SimpleEmbeddingService) CosineSimilarity(vec1, vec2 []float64) float64 + func (s *SimpleEmbeddingService) GenerateEmbedding(ctx context.Context, text string) ([]float64, error) + type StepResult struct + BatchSize int + BestScore float64 + CandidateScores []float64 + Duration time.Duration + Improvement float64 + Introspection string + Step int + Temperature float64 + type StrategyType string + const InstructionPerturbation + const RuleGeneration + type TPEConfig struct + BandwidthFactor float64 + Gamma float64 + NumEIGenerations int + PriorWeight float64 + Seed int64 + type TPEOptimizer struct + func (t *TPEOptimizer) GetBestParams() (map[string]interface{}, float64) + func (t *TPEOptimizer) Initialize(config SearchConfig) error + func (t *TPEOptimizer) SuggestParams(ctx context.Context) (map[string]interface{}, error) + func (t *TPEOptimizer) UpdateResults(params map[string]interface{}, score float64) error + type TeacherStudentOptimizer struct + MaxExamples int + Student core.LLM + Teacher core.LLM + TeacherSettings map[string]interface{} + func (t *TeacherStudentOptimizer) GenerateDemonstration(ctx context.Context, input core.Example) (core.Example, error) + func (t *TeacherStudentOptimizer) Initialize(ctx context.Context, program core.Program, dataset core.Dataset) error + type ToolOrchestrator struct + Config *MCPOptimizerConfig + Dependencies map[string][]string + Workflows []ToolWorkflow + func (to *ToolOrchestrator) GetDependencies(toolName string) []string + func (to *ToolOrchestrator) GetOptimalToolSequence(ctx context.Context, context string, availableTools []string) ([]string, error) + func (to *ToolOrchestrator) GetWorkflowCount() int + func (to *ToolOrchestrator) RecordWorkflow(ctx context.Context, workflow ToolWorkflow) error + type ToolWorkflow struct + Context string + ID string + Metadata map[string]interface{} + Steps []WorkflowStep + Success bool + Timestamp time.Time + type Trajectory struct + Example core.Example + ExecutionTime time.Duration + Prediction map[string]interface{} + ProgramID string + Score float64 + Success bool + type WorkflowStep struct + Duration time.Duration + Order int + Parameters map[string]interface{} + Result core.ToolResult + ToolName string