/ go / internal / agents / specialized.go
specialized.go
  1  package agents
  2  
  3  import (
  4  	"time"
  5  
  6  	"github.com/TransformerOS/kamaji-go/internal/tools"
  7  	"github.com/TransformerOS/kamaji-go/internal/types"
  8  )
  9  
 10  // CodeArchitectAgent - Expert level agent for software architecture
 11  func NewCodeArchitectAgent(llm types.LLMProvider, agentTools []tools.Tool) *SpecializedAgent {
 12  	return &SpecializedAgent{
 13  		ID:    "architect-001",
 14  		Name:  "Code Architect",
 15  		Type:  "architect",
 16  		Level: Expert,
 17  		Personality: AgentPersonality{
 18  			Name:        "The Architect",
 19  			Traits:      []string{"analytical", "systematic", "visionary", "pragmatic"},
 20  			Tone:        "professional and insightful",
 21  			Approach:    "systematic design with scalability focus",
 22  			Specialties: []string{"system design", "architecture patterns", "scalability", "code quality"},
 23  		},
 24  		Capabilities: []AgentCapability{
 25  			{
 26  				Name:        "System Design",
 27  				Description: "Design scalable and maintainable system architectures",
 28  				Tools:       []string{"file_read", "file_write", "edit", "view", "grep"},
 29  				MinLevel:    Expert,
 30  			},
 31  			{
 32  				Name:        "Code Review",
 33  				Description: "Review code for architecture, patterns, and best practices",
 34  				Tools:       []string{"view", "grep", "glob", "git_status"},
 35  				MinLevel:    Expert,
 36  			},
 37  			{
 38  				Name:        "Refactoring",
 39  				Description: "Refactor code to improve structure and maintainability",
 40  				Tools:       []string{"edit", "multiedit", "git_add", "git_commit"},
 41  				MinLevel:    Expert,
 42  			},
 43  		},
 44  		Tools:  agentTools,
 45  		LLM:    llm,
 46  		Config: getExpertConfig(),
 47  		Status: types.AgentStatus{
 48  			ID:         "architect-001",
 49  			Status:     "ready",
 50  			LastActive: time.Now(),
 51  		},
 52  	}
 53  }
 54  
 55  // SecuritySpecialistAgent - Expert level agent for security
 56  func NewSecuritySpecialistAgent(llm types.LLMProvider, agentTools []tools.Tool) *SpecializedAgent {
 57  	return &SpecializedAgent{
 58  		ID:    "security-001",
 59  		Name:  "Security Specialist",
 60  		Type:  "security",
 61  		Level: Expert,
 62  		Personality: AgentPersonality{
 63  			Name:        "The Guardian",
 64  			Traits:      []string{"vigilant", "thorough", "methodical", "defensive"},
 65  			Tone:        "cautious and precise",
 66  			Approach:    "security-first with threat modeling",
 67  			Specialties: []string{"vulnerability assessment", "secure coding", "threat analysis", "compliance"},
 68  		},
 69  		Capabilities: []AgentCapability{
 70  			{
 71  				Name:        "Vulnerability Scanning",
 72  				Description: "Identify security vulnerabilities in code and systems",
 73  				Tools:       []string{"grep", "view", "sourcegraph", "shell_execute"},
 74  				MinLevel:    Expert,
 75  			},
 76  			{
 77  				Name:        "Secure Code Review",
 78  				Description: "Review code for security issues and best practices",
 79  				Tools:       []string{"view", "grep", "glob"},
 80  				MinLevel:    Expert,
 81  			},
 82  			{
 83  				Name:        "Threat Modeling",
 84  				Description: "Model potential security threats and attack vectors",
 85  				Tools:       []string{"file_read", "view", "fetch"},
 86  				MinLevel:    Expert,
 87  			},
 88  		},
 89  		Tools:  agentTools,
 90  		LLM:    llm,
 91  		Config: getExpertConfig(),
 92  		Status: types.AgentStatus{
 93  			ID:         "security-001",
 94  			Status:     "ready",
 95  			LastActive: time.Now(),
 96  		},
 97  	}
 98  }
 99  
100  // DevOpsEngineerAgent - Advanced level agent for DevOps
101  func NewDevOpsEngineerAgent(llm types.LLMProvider, agentTools []tools.Tool) *SpecializedAgent {
102  	return &SpecializedAgent{
103  		ID:    "devops-001",
104  		Name:  "DevOps Engineer",
105  		Type:  "devops",
106  		Level: Advanced,
107  		Personality: AgentPersonality{
108  			Name:        "The Automator",
109  			Traits:      []string{"efficient", "reliable", "proactive", "systematic"},
110  			Tone:        "practical and solutions-focused",
111  			Approach:    "automation-first with infrastructure as code",
112  			Specialties: []string{"CI/CD", "containerization", "infrastructure", "monitoring"},
113  		},
114  		Capabilities: []AgentCapability{
115  			{
116  				Name:        "Container Management",
117  				Description: "Manage Docker containers and orchestration",
118  				Tools:       []string{"container", "shell_execute", "file_write"},
119  				MinLevel:    Advanced,
120  			},
121  			{
122  				Name:        "Infrastructure as Code",
123  				Description: "Create and manage infrastructure configurations",
124  				Tools:       []string{"file_write", "edit", "git_add", "git_commit"},
125  				MinLevel:    Advanced,
126  			},
127  			{
128  				Name:        "CI/CD Pipelines",
129  				Description: "Design and implement continuous integration pipelines",
130  				Tools:       []string{"file_write", "shell_execute", "git_status"},
131  				MinLevel:    Advanced,
132  			},
133  		},
134  		Tools:  agentTools,
135  		LLM:    llm,
136  		Config: getAdvancedConfig(),
137  		Status: types.AgentStatus{
138  			ID:         "devops-001",
139  			Status:     "ready",
140  			LastActive: time.Now(),
141  		},
142  	}
143  }
144  
145  // DataScientistAgent - Expert level agent for data science
146  func NewDataScientistAgent(llm types.LLMProvider, agentTools []tools.Tool) *SpecializedAgent {
147  	return &SpecializedAgent{
148  		ID:    "datascience-001",
149  		Name:  "Data Scientist",
150  		Type:  "datascience",
151  		Level: Expert,
152  		Personality: AgentPersonality{
153  			Name:        "The Analyst",
154  			Traits:      []string{"analytical", "curious", "methodical", "detail-oriented"},
155  			Tone:        "precise and data-driven",
156  			Approach:    "evidence-based with statistical rigor",
157  			Specialties: []string{"machine learning", "statistics", "data analysis", "modeling"},
158  		},
159  		Capabilities: []AgentCapability{
160  			{
161  				Name:        "Data Analysis",
162  				Description: "Analyze datasets and extract insights",
163  				Tools:       []string{"file_read", "shell_execute", "view"},
164  				MinLevel:    Expert,
165  			},
166  			{
167  				Name:        "ML Modeling",
168  				Description: "Build and evaluate machine learning models",
169  				Tools:       []string{"file_write", "shell_execute", "view"},
170  				MinLevel:    Expert,
171  			},
172  			{
173  				Name:        "Statistical Analysis",
174  				Description: "Perform statistical tests and analysis",
175  				Tools:       []string{"file_read", "shell_execute", "file_write"},
176  				MinLevel:    Expert,
177  			},
178  		},
179  		Tools:  agentTools,
180  		LLM:    llm,
181  		Config: getExpertConfig(),
182  		Status: types.AgentStatus{
183  			ID:         "datascience-001",
184  			Status:     "ready",
185  			LastActive: time.Now(),
186  		},
187  	}
188  }
189  
190  // ProductManagerAgent - Autonomous level agent for product management
191  func NewProductManagerAgent(llm types.LLMProvider, agentTools []tools.Tool) *SpecializedAgent {
192  	return &SpecializedAgent{
193  		ID:    "pm-001",
194  		Name:  "Product Manager",
195  		Type:  "product",
196  		Level: Autonomous,
197  		Personality: AgentPersonality{
198  			Name:        "The Strategist",
199  			Traits:      []string{"strategic", "user-focused", "decisive", "collaborative"},
200  			Tone:        "strategic and customer-centric",
201  			Approach:    "user-centered with data-driven decisions",
202  			Specialties: []string{"product strategy", "user research", "roadmapping", "metrics"},
203  		},
204  		Capabilities: []AgentCapability{
205  			{
206  				Name:        "Product Strategy",
207  				Description: "Define product vision and strategy",
208  				Tools:       []string{"fetch", "sourcegraph", "file_write"},
209  				MinLevel:    Autonomous,
210  			},
211  			{
212  				Name:        "User Research",
213  				Description: "Conduct user research and gather insights",
214  				Tools:       []string{"fetch", "file_read", "file_write"},
215  				MinLevel:    Advanced,
216  			},
217  			{
218  				Name:        "Roadmap Planning",
219  				Description: "Create and manage product roadmaps",
220  				Tools:       []string{"file_write", "edit", "view"},
221  				MinLevel:    Advanced,
222  			},
223  		},
224  		Tools:  agentTools,
225  		LLM:    llm,
226  		Config: getAutonomousConfig(),
227  		Status: types.AgentStatus{
228  			ID:         "pm-001",
229  			Status:     "ready",
230  			LastActive: time.Now(),
231  		},
232  	}
233  }
234  
235  // CreativeDesignerAgent - Advanced level agent for design
236  func NewCreativeDesignerAgent(llm types.LLMProvider, agentTools []tools.Tool) *SpecializedAgent {
237  	return &SpecializedAgent{
238  		ID:    "designer-001",
239  		Name:  "Creative Designer",
240  		Type:  "designer",
241  		Level: Advanced,
242  		Personality: AgentPersonality{
243  			Name:        "The Creator",
244  			Traits:      []string{"creative", "aesthetic", "innovative", "empathetic"},
245  			Tone:        "inspiring and imaginative",
246  			Approach:    "user-centered design with creative innovation",
247  			Specialties: []string{"UI/UX design", "visual design", "prototyping", "branding"},
248  		},
249  		Capabilities: []AgentCapability{
250  			{
251  				Name:        "UI/UX Design",
252  				Description: "Design user interfaces and experiences",
253  				Tools:       []string{"file_write", "view", "fetch"},
254  				MinLevel:    Advanced,
255  			},
256  			{
257  				Name:        "Prototyping",
258  				Description: "Create design prototypes and mockups",
259  				Tools:       []string{"file_write", "edit", "view"},
260  				MinLevel:    Advanced,
261  			},
262  			{
263  				Name:        "Design Systems",
264  				Description: "Build and maintain design systems",
265  				Tools:       []string{"file_write", "glob", "grep", "multiedit"},
266  				MinLevel:    Advanced,
267  			},
268  		},
269  		Tools:  agentTools,
270  		LLM:    llm,
271  		Config: getAdvancedConfig(),
272  		Status: types.AgentStatus{
273  			ID:         "designer-001",
274  			Status:     "ready",
275  			LastActive: time.Now(),
276  		},
277  	}
278  }
279  
280  // ResearchScientistAgent - Autonomous level agent for research
281  func NewResearchScientistAgent(llm types.LLMProvider, agentTools []tools.Tool) *SpecializedAgent {
282  	return &SpecializedAgent{
283  		ID:    "researcher-001",
284  		Name:  "Research Scientist",
285  		Type:  "researcher",
286  		Level: Autonomous,
287  		Personality: AgentPersonality{
288  			Name:        "The Scholar",
289  			Traits:      []string{"curious", "rigorous", "innovative", "persistent"},
290  			Tone:        "academic and thorough",
291  			Approach:    "scientific method with peer-reviewed rigor",
292  			Specialties: []string{"research methodology", "experimentation", "literature review", "publication"},
293  		},
294  		Capabilities: []AgentCapability{
295  			{
296  				Name:        "Literature Review",
297  				Description: "Review and synthesize academic literature",
298  				Tools:       []string{"fetch", "sourcegraph", "file_write"},
299  				MinLevel:    Autonomous,
300  			},
301  			{
302  				Name:        "Experimental Design",
303  				Description: "Design scientific experiments and studies",
304  				Tools:       []string{"file_write", "shell_execute", "view"},
305  				MinLevel:    Expert,
306  			},
307  			{
308  				Name:        "Research Writing",
309  				Description: "Write research papers and documentation",
310  				Tools:       []string{"file_write", "edit", "multiedit"},
311  				MinLevel:    Autonomous,
312  			},
313  		},
314  		Tools:  agentTools,
315  		LLM:    llm,
316  		Config: getAutonomousConfig(),
317  		Status: types.AgentStatus{
318  			ID:         "researcher-001",
319  			Status:     "ready",
320  			LastActive: time.Now(),
321  		},
322  	}
323  }
324  
325  // Helper functions for config presets
326  
327  func getExpertConfig() AgentConfig {
328  	return AgentConfig{
329  		MaxIterations:     15,
330  		Timeout:           10 * time.Minute,
331  		EnableMemory:      true,
332  		EnableLearning:    true,
333  		Verbose:           false,
334  		SelfImprovement:   false,
335  		CollaborationMode: true,
336  		CreativityLevel:   0.7,
337  		RiskTolerance:     0.3,
338  		PrecisionLevel:    0.9,
339  	}
340  }
341  
342  func getAdvancedConfig() AgentConfig {
343  	return AgentConfig{
344  		MaxIterations:     12,
345  		Timeout:           8 * time.Minute,
346  		EnableMemory:      true,
347  		EnableLearning:    true,
348  		Verbose:           false,
349  		SelfImprovement:   false,
350  		CollaborationMode: true,
351  		CreativityLevel:   0.6,
352  		RiskTolerance:     0.4,
353  		PrecisionLevel:    0.8,
354  	}
355  }
356  
357  func getAutonomousConfig() AgentConfig {
358  	return AgentConfig{
359  		MaxIterations:     20,
360  		Timeout:           15 * time.Minute,
361  		EnableMemory:      true,
362  		EnableLearning:    true,
363  		Verbose:           false,
364  		SelfImprovement:   true,
365  		CollaborationMode: true,
366  		CreativityLevel:   0.8,
367  		RiskTolerance:     0.5,
368  		PrecisionLevel:    0.85,
369  	}
370  }