diff --git a/agentstack/cli/agentstack_data.py b/agentstack/cli/agentstack_data.py index ca811423..4acd39c3 100644 --- a/agentstack/cli/agentstack_data.py +++ b/agentstack/cli/agentstack_data.py @@ -1,6 +1,6 @@ import json from datetime import datetime -from typing import Optional, Literal +from typing import Optional, Literal, List from agentstack.utils import clean_input, get_version from agentstack.logger import log @@ -53,6 +53,7 @@ class ProjectStructure: def __init__(self): self.agents = [] self.tasks = [] + self.inputs = [] def add_agent(self, agent): self.agents.append(agent) @@ -60,10 +61,14 @@ def add_agent(self, agent): def add_task(self, task): self.tasks.append(task) + def set_inputs(self, inputs): + self.inputs = inputs + def to_dict(self): return { 'agents': self.agents, 'tasks': self.tasks, + 'inputs': self.inputs, } def to_json(self): diff --git a/agentstack/cli/cli.py b/agentstack/cli/cli.py index f10866b3..11e6a630 100644 --- a/agentstack/cli/cli.py +++ b/agentstack/cli/cli.py @@ -67,7 +67,8 @@ def init_project_builder(slug_name: Optional[str] = None, template: Optional[str framework = template_data['framework'] design = { 'agents': template_data['agents'], - 'tasks': template_data['tasks'] + 'tasks': template_data['tasks'], + 'inputs': template_data['inputs'], } tools = template_data['tools'] @@ -94,7 +95,8 @@ def init_project_builder(slug_name: Optional[str] = None, template: Optional[str design = { 'agents': [], - 'tasks': [] + 'tasks': [], + 'inputs': [] } tools = [] @@ -344,6 +346,7 @@ def insert_template(project_details: dict, framework_name: str, design: dict, te project_structure = ProjectStructure() project_structure.agents = design["agents"] project_structure.tasks = design["tasks"] + project_structure.set_inputs(design["inputs"]) cookiecutter_data = CookiecutterData(project_metadata=project_metadata, structure=project_structure, diff --git a/agentstack/templates/crewai/{{cookiecutter.project_metadata.project_slug}}/src/main.py b/agentstack/templates/crewai/{{cookiecutter.project_metadata.project_slug}}/src/main.py index 277e439c..853e13bf 100644 --- a/agentstack/templates/crewai/{{cookiecutter.project_metadata.project_slug}}/src/main.py +++ b/agentstack/templates/crewai/{{cookiecutter.project_metadata.project_slug}}/src/main.py @@ -13,7 +13,9 @@ def run(): Run the crew. """ inputs = { - 'key': 'value' +{%- for input in cookiecutter.structure.inputs %} + "{{input}}": "", +{%- endfor %} } {{cookiecutter.project_metadata.project_name|replace('-', '')|replace('_', '')|capitalize}}Crew().crew().kickoff(inputs=inputs) @@ -23,7 +25,9 @@ def train(): Train the crew for a given number of iterations. """ inputs = { - 'key': 'value' +{%- for input in cookiecutter.structure.inputs %} + "{{input}}": "", +{%- endfor %} } try: {{cookiecutter.project_metadata.project_name|replace('-', '')|replace('_', '')|capitalize}}Crew().crew().train(n_iterations=int(sys.argv[1]), filename=sys.argv[2], inputs=inputs) @@ -47,9 +51,9 @@ def test(): """ Test the crew execution and returns the results. """ - inputs = { - 'key': 'value' - } +{%- for input in cookiecutter.structure.inputs %} + "{{input}}": "", +{%- endfor %} try: {{cookiecutter.project_metadata.project_name|replace('-', '')|replace('_', '')|capitalize}}Crew().crew().test(n_iterations=int(sys.argv[1]), openai_model_name=sys.argv[2], inputs=inputs) diff --git a/agentstack/templates/proj_templates/chatbot.json b/agentstack/templates/proj_templates/chatbot.json deleted file mode 100644 index 1deef694..00000000 --- a/agentstack/templates/proj_templates/chatbot.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "chatbot", - "tools": ["mem0"], - "agents": [{ - - }], - "tasks": [{ - - }], - "code_swap": [ - { - "direction": "out", - "file": - } - ] -} \ No newline at end of file diff --git a/agentstack/templates/proj_templates/content_creator.json b/agentstack/templates/proj_templates/content_creator.json new file mode 100644 index 00000000..bf63a478 --- /dev/null +++ b/agentstack/templates/proj_templates/content_creator.json @@ -0,0 +1,50 @@ +{ + "name": "content_creation", + "description": "Multi-agent system for creating high-quality content", + "template_version": 1, + "framework": "crewai", + "agents": [{ + "name": "researcher", + "role": "Research topic and gather reference material", + "goal": "Find relevant, high-quality sources and extract key information about the requested topic. Focus on authoritative sources and diverse perspectives.", + "backstory": "You are an expert content researcher with years of experience identifying quality sources and extracting valuable information. You have a keen eye for credible references and can quickly identify key concepts.", + "model": "openai/gpt-4o" + },{ + "name": "writer", + "role": "Create engaging content from research", + "goal": "Transform research materials into compelling, well-structured content that effectively communicates key ideas while maintaining accuracy.", + "backstory": "You are a skilled content writer with expertise in creating engaging, clear, and informative content. You excel at organizing information logically and maintaining a consistent tone.", + "model": "openai/gpt-4o" + },{ + "name": "editor", + "role": "Review and enhance content", + "goal": "Ensure content accuracy, clarity, and engagement while maintaining consistency with style guidelines and target audience expectations.", + "backstory": "You are an experienced editor with a sharp eye for detail and deep understanding of content quality. You excel at improving clarity, flow, and impact while preserving the writer's voice.", + "model": "openai/gpt-4o" + }], + "tasks": [{ + "name": "research_topic", + "description": "Research the given topic thoroughly: {topic}. Focus on authoritative sources and gather diverse perspectives.", + "expected_output": "Comprehensive research document with key findings, quotes, statistics, and properly cited sources.", + "agent": "researcher" + },{ + "name": "create_content", + "description": "Using the research materials, create engaging content about: {topic}. Target audience: {audience}. Content type: {content_type}.", + "expected_output": "Well-structured content draft incorporating key research findings while maintaining engagement and appropriate tone.", + "agent": "writer" + },{ + "name": "edit_content", + "description": "Review and enhance the content for: {topic}. Ensure accuracy, clarity, and alignment with style guidelines.", + "expected_output": "Polished final content with improved clarity, flow, and impact, along with an editorial summary noting major changes.", + "agent": "editor" + }], + "tools": [{ + "name": "perplexity", + "agents": ["researcher"] + },{ + "name": "firecrawl", + "agents": ["researcher"] + }], + "method": "sequential", + "inputs": ["topic", "audience", "content_type"] +} \ No newline at end of file diff --git a/agentstack/templates/proj_templates/research.json b/agentstack/templates/proj_templates/research.json index b27b19c7..cc2ea702 100644 --- a/agentstack/templates/proj_templates/research.json +++ b/agentstack/templates/proj_templates/research.json @@ -31,5 +31,6 @@ "name": "perplexity", "agents": ["researcher"] }], - "method": "sequential" + "method": "sequential", + "inputs": ["query"] } \ No newline at end of file diff --git a/agentstack/templates/proj_templates/system_analyzer.json b/agentstack/templates/proj_templates/system_analyzer.json new file mode 100644 index 00000000..dd1396ae --- /dev/null +++ b/agentstack/templates/proj_templates/system_analyzer.json @@ -0,0 +1,53 @@ +{ + "name": "system_analyzer", + "description": "Multi-agent system for analyzing codebases and system architecture", + "template_version": 1, + "framework": "crewai", + "agents": [{ + "name": "file_explorer", + "role": "Navigate and catalog system structure", + "goal": "Create a comprehensive map of the system structure, identifying key files, dependencies, and architectural patterns.", + "backstory": "You are an expert system architect with deep experience in analyzing complex codebases. You excel at understanding system organization and identifying architectural patterns.", + "model": "openai/gpt-4o" + },{ + "name": "code_analyzer", + "role": "Analyze code quality and patterns", + "goal": "Review code for quality, security issues, and architectural concerns. Document findings and potential improvements.", + "backstory": "You are a senior code reviewer with extensive experience in multiple programming languages and best practices. You have a strong focus on code quality, security, and maintainability.", + "model": "openai/gpt-4o" + },{ + "name": "documentation_writer", + "role": "Create technical documentation", + "goal": "Transform analysis findings into clear, comprehensive technical documentation that helps understand and maintain the system.", + "backstory": "You are a technical writer specializing in system documentation. You excel at explaining complex technical concepts clearly and creating maintainable documentation.", + "model": "openai/gpt-4o" + }], + "tasks": [{ + "name": "system_mapping", + "description": "Map the system structure at path: {system_path}. Identify key components, dependencies, and patterns.", + "expected_output": "Detailed system map including file structure, key components, and architectural patterns identified.", + "agent": "file_explorer" + },{ + "name": "code_analysis", + "description": "Analyze the codebase for quality, security, and architectural concerns using the system map.", + "expected_output": "Comprehensive analysis report detailing code quality, security issues, and architectural recommendations.", + "agent": "code_analyzer" + },{ + "name": "documentation_creation", + "description": "Create technical documentation based on the system map and code analysis.", + "expected_output": "Complete technical documentation including system overview, architecture details, and maintenance guidelines.", + "agent": "documentation_writer" + }], + "tools": [{ + "name": "directory_search", + "agents": ["file_explorer"] + },{ + "name": "file_read", + "agents": ["file_explorer", "code_analyzer"] + },{ + "name": "code_interpreter", + "agents": ["code_analyzer"] + }], + "method": "sequential", + "inputs": ["system_path"] +} \ No newline at end of file