Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion agentstack/cli/agentstack_data.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -53,17 +53,22 @@ class ProjectStructure:
def __init__(self):
self.agents = []
self.tasks = []
self.inputs = []

def add_agent(self, agent):
self.agents.append(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):
Expand Down
7 changes: 5 additions & 2 deletions agentstack/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -94,7 +95,8 @@ def init_project_builder(slug_name: Optional[str] = None, template: Optional[str

design = {
'agents': [],
'tasks': []
'tasks': [],
'inputs': []
}

tools = []
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand All @@ -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)

Expand Down
16 changes: 0 additions & 16 deletions agentstack/templates/proj_templates/chatbot.json

This file was deleted.

50 changes: 50 additions & 0 deletions agentstack/templates/proj_templates/content_creator.json
Original file line number Diff line number Diff line change
@@ -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"]
}
3 changes: 2 additions & 1 deletion agentstack/templates/proj_templates/research.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
"name": "perplexity",
"agents": ["researcher"]
}],
"method": "sequential"
"method": "sequential",
"inputs": ["query"]
}
53 changes: 53 additions & 0 deletions agentstack/templates/proj_templates/system_analyzer.json
Original file line number Diff line number Diff line change
@@ -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"]
}
Loading