Creating Software Teams with AI Agents and Bedrock

Imagine having a complete engineering team at your fingertips - an engineering lead, a backend developer, a frontend engineer, and a test engineer - all working in perfect harmony to build your application. Now imagine this entire team is powered by AI. In this blog post, I'll walk you through building an AI-powered engineering team using CrewAI and Amazon Bedrock to develop a stock management application. Let's turn this sci-fi concept into reality! What is CrewAI? CrewAI is a game-changing open-source framework that lets you create a team of specialized AI agents working together on complex projects. Unlike traditional single-agent approaches, CrewAI mimics how human teams operate - with different specialists handling specific aspects of a project. Think of it as assembling your dream engineering team, where each AI agent brings unique skills to the table: The visionary Engineering Lead creates detailed designs The meticulous Backend Engineer writes clean, efficient code The creative Frontend Engineer crafts intuitive user interfaces The thorough Test Engineer ensures everything works perfectly Our Mission: Build a Stock Management App Our AI team will build a comprehensive stock management application that: Manages user accounts and funds Handles buying and selling of shares Tracks portfolio value and calculates profits/losses Enforces sensible constraints (no overdrafts or overselling) Let's dive into how we'll make this happen! Project Setup: The Skeleton of Our AI Team Before we write a single line of code, let's understand the architecture of our project: engineering_team/ ├── config/ │ ├── agents.yaml (Defines our AI team members) │ └── tasks.yaml (Specifies what each team member will do) ├── output/ (Where our finished application will go) ├── src/ │ ├── crew.py (Orchestrates team collaboration) │ └── main.py (Starting point for our project) └── ... Each file plays a crucial role in bringing our AI team to life. Getting Started: Setup in 3 Easy Steps Let's roll up our sleeves and get started: 1. Install the essentials # Install uv (a faster Python package installer) $ curl -LsSf https://astral.sh/uv/install.sh | sh # Verify installation $ uv --version # Install CrewAI $ uv tool install crewai 2. Create your AI crew $ crewai create my_engg_team When prompted, select Amazon Bedrock as your provider and choose Claude 3.5 Sonnet as your model. You'll need to provide your AWS credentials to access these powerful models. 3. Configure your team Now comes the fun part - defining our AI team members and their responsibilities! The Dream Team: Configuring Our AI Engineers The Engineering Lead (agents.yaml) Our engineering lead takes high-level requirements and turns them into detailed designs: engineering_lead: role: > Engineering Lead for the engineering team, directing the work of the engineer goal: > Take the high level requirements described here and prepare a detailed design for the backend developer; everything should be in 1 python module; describe the function and method signatures in the module. The python module must be completely self-contained, and ready so that it can be tested or have a simple UI built for it. Here are the requirements: {requirements} The module should be named {module_name} and the class should be named {class_name} backstory: > You're a seasoned engineering lead with a knack for writing clear and concise designs. llm: bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0 backend_engineer: role: > Python Engineer who can write code to achieve the design described by the engineering lead goal: > Write a python module that implements the design described by the engineering lead, in order to achieve the requirements. The python module must be completely self-contained, and ready so that it can be tested or have a simple UI built for it. Here are the requirements: {requirements} The module should be named {module_name} and the class should be named {class_name} backstory: > You're a seasoned python engineer with a knack for writing clean, efficient code. You follow the design instructions carefully. You produce 1 python module named {module_name} that implements the design and achieves the requirements. llm: bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0 frontend_engineer: role: > A Gradio expert to who can write a simple frontend to demonstrate a backend goal: > Write a gradio UI that demonstrates the given backend, all in one file to be in the same directory as the backend module {module_name}. Here are the requirements: {requirements}. backstory: > You're a seasoned python engineer highly skilled at writing simple Gradio UIs for a backend class. You produce a simple gradio UI that demonstrates the

Apr 28, 2025 - 23:10
 0
Creating Software Teams with AI Agents and Bedrock

Imagine having a complete engineering team at your fingertips - an engineering lead, a backend developer, a frontend engineer, and a test engineer - all working in perfect harmony to build your application. Now imagine this entire team is powered by AI.

In this blog post, I'll walk you through building an AI-powered engineering team using CrewAI and Amazon Bedrock to develop a stock management application. Let's turn this sci-fi concept into reality!

What is CrewAI?

CrewAI is a game-changing open-source framework that lets you create a team of specialized AI agents working together on complex projects. Unlike traditional single-agent approaches, CrewAI mimics how human teams operate - with different specialists handling specific aspects of a project.

Think of it as assembling your dream engineering team, where each AI agent brings unique skills to the table:

  • The visionary Engineering Lead creates detailed designs
  • The meticulous Backend Engineer writes clean, efficient code
  • The creative Frontend Engineer crafts intuitive user interfaces
  • The thorough Test Engineer ensures everything works perfectly

Our Mission: Build a Stock Management App

Our AI team will build a comprehensive stock management application that:

  • Manages user accounts and funds
  • Handles buying and selling of shares
  • Tracks portfolio value and calculates profits/losses
  • Enforces sensible constraints (no overdrafts or overselling)

Let's dive into how we'll make this happen!

Project Setup: The Skeleton of Our AI Team

Before we write a single line of code, let's understand the architecture of our project:

engineering_team/
├── config/
│   ├── agents.yaml  (Defines our AI team members)
│   └── tasks.yaml   (Specifies what each team member will do)
├── output/          (Where our finished application will go)
├── src/
│   ├── crew.py      (Orchestrates team collaboration)
│   └── main.py      (Starting point for our project)
└── ...

Each file plays a crucial role in bringing our AI team to life.

Getting Started: Setup in 3 Easy Steps

Let's roll up our sleeves and get started:

1. Install the essentials

# Install uv (a faster Python package installer)
$ curl -LsSf https://astral.sh/uv/install.sh | sh

# Verify installation
$ uv --version

# Install CrewAI
$ uv tool install crewai

2. Create your AI crew

$ crewai create my_engg_team

When prompted, select Amazon Bedrock as your provider and choose Claude 3.5 Sonnet as your model. You'll need to provide your AWS credentials to access these powerful models.

3. Configure your team

Now comes the fun part - defining our AI team members and their responsibilities!

The Dream Team: Configuring Our AI Engineers

The Engineering Lead (agents.yaml)

Our engineering lead takes high-level requirements and turns them into detailed designs:

engineering_lead:
  role: >
    Engineering Lead for the engineering team, directing the work of the engineer
  goal: >
    Take the high level requirements described here and prepare a detailed design for the backend developer;
    everything should be in 1 python module; describe the function and method signatures in the module.
    The python module must be completely self-contained, and ready so that it can be tested or have a simple UI built for it.
    Here are the requirements: {requirements}
    The module should be named {module_name} and the class should be named {class_name}
  backstory: >
    You're a seasoned engineering lead with a knack for writing clear and concise designs.
  llm: bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0

backend_engineer:
  role: >
    Python Engineer who can write code to achieve the design described by the engineering lead
  goal: >
    Write a python module that implements the design described by the engineering lead, in order to achieve the requirements.
    The python module must be completely self-contained, and ready so that it can be tested or have a simple UI built for it.
    Here are the requirements: {requirements}
    The module should be named {module_name} and the class should be named {class_name}
  backstory: >
    You're a seasoned python engineer with a knack for writing clean, efficient code.
    You follow the design instructions carefully.
    You produce 1 python module named {module_name} that implements the design and achieves the requirements.
  llm: bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0

frontend_engineer:
  role: >
    A Gradio expert to who can write a simple frontend to demonstrate a backend
  goal: >
    Write a gradio UI that demonstrates the given backend, all in one file to be in the same directory as the backend module {module_name}.
    Here are the requirements: {requirements}.
  backstory: >
    You're a seasoned python engineer highly skilled at writing simple Gradio UIs for a backend class.
    You produce a simple gradio UI that demonstrates the given backend class; you write the gradio UI in a module app.py that is in the same directory as the backend module {module_name}.
  llm: bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0

test_engineer:
  role: >
    An engineer with python coding skills who can write unit tests for the given backend module {module_name}
  goal: >
    Write unit tests for the given backend module {module_name} and create a test_{module_name} in the same directory as the backend module.
  backstory: >
    You're a seasoned QA engineer and software developer who writes great unit tests for python code.
  llm: bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0

Each agent configuration includes:

Role: Describes the agent's position in the team
Goal: Specifies what the agent needs to accomplish
Backstory: Provides context that shapes the agent's approach
LLM: Specifies which language model powers the agent (in this case, Claude 3.5 Sonnet via Amazon Bedrock)

Our team includes four agents, each serving a distinct role:

Engineering Lead: Creates detailed design specifications
Backend Engineer: Implements the core functionality in Python
Frontend Engineer: Develops a Gradio-based UI
Test Engineer: Writes unit tests for quality assurance

Assigning Tasks (tasks.yaml)

Each team member needs clear instructions on what to do:

Crew Definition (crew.py)

The crew.py file organizes the agents and tasks into a cohesive team:

from crewai import Agent, Crew, Process, Task
from crewai.project import CrewBase, agent, crew, task

# If you want to run a snippet of code before or after the crew starts,
# you can use the @before_kickoff and @after_kickoff decorators
# https://docs.crewai.com/concepts/crews#example-crew-class-with-decorators

@CrewBase
class MyEnggTeam():
    """EngineeringTeam3 crew"""

    agents_config = 'config/agents.yaml'
    tasks_config = 'config/tasks.yaml'

    @agent
    def engineering_lead(self) -> Agent:
        return Agent(
            config=self.agents_config['engineering_lead'],
            verbose=True,
        )

    @agent
    def backend_engineer(self) -> Agent:
        return Agent(
            config=self.agents_config['backend_engineer'],
            verbose=True,
            allow_code_execution=True,
            code_execution_mode="safe",  # Uses Docker for safety
            max_execution_time=120, 
            max_retry_limit=3 
        )

    @agent
    def frontend_engineer(self) -> Agent:
        return Agent(
            config=self.agents_config['frontend_engineer'],
            verbose=True,
        )

    @agent
    def test_engineer(self) -> Agent:
        return Agent(
            config=self.agents_config['test_engineer'],
            verbose=True,
            allow_code_execution=True,
            code_execution_mode="safe",  # Uses Docker for safety
            max_execution_time=120, 
            max_retry_limit=3 
        )

    @task
    def design_task(self) -> Task:
        return Task(
            config=self.tasks_config['design_task']
        )

    @task
    def code_task(self) -> Task:
        return Task(
            config=self.tasks_config['code_task'],
        )

    @task
    def frontend_task(self) -> Task:
        return Task(
            config=self.tasks_config['frontend_task'],
        )

    @task
    def test_task(self) -> Task:
        return Task(
            config=self.tasks_config['test_task'],
        )   

    @crew
    def crew(self) -> Crew:
        """Creates the research crew"""
        return Crew(
            agents=self.agents,
            tasks=self.tasks,
            process=Process.sequential,
            verbose=True,
        )

The Starting Gun (main.py)

Finally, we kick off the development process:

#!/usr/bin/env python
import warnings
import os
import logging

from my_engg_team.crew import MyEnggTeam

warnings.filterwarnings("ignore", category=SyntaxWarning, module="pysbd")

# Disable only CrewAI telemetry
os.environ['CREWAI_DISABLE_TELEMETRY'] = 'true'

# Disable all OpenTelemetry (including CrewAI)
os.environ['OTEL_SDK_DISABLED'] = 'true'

# Create output directory if it doesn't exist
os.makedirs('output', exist_ok=True)

requirements = """
A simple account management system for a trading simulation platform.
The system should allow users to create an account, deposit funds, and withdraw funds.
The system should allow users to record that they have bought or sold shares, providing a quantity.
The system should calculate the total value of the user's portfolio, and the profit or loss from the initial deposit.
The system should be able to report the holdings of the user at any point in time.
The system should be able to report the profit or loss of the user at any point in time.
The system should be able to list the transactions that the user has made over time.
The system should prevent the user from withdrawing funds that would leave them with a negative balance, or
 from buying more shares than they can afford, or selling shares that they don't have.
 The system has access to a function get_share_price(symbol) which returns the current price of a share, and includes a test implementation that returns fixed prices for AAPL, TSLA, GOOGL.
"""
module_name = "accounts.py"
class_name = "Account"

def run():
    """
    Run the research crew.
    """
    inputs = {
        'requirements': requirements,
        'module_name': module_name,
        'class_name': class_name
    }

    # Create and run the crew
    result = MyEnggTeam().crew().kickoff(inputs=inputs)

if __name__ == "__main__":
    run()

Showtime! Watching AI Engineers in Action

With everything set up, it's time to see our AI team in action:

$ crewai run

Now sit back and watch as your AI engineering team springs to life! You'll see a cascade of activity:

  1. The Engineering Lead analyzes the requirements and crafts a detailed design
  2. The Backend Engineer takes that design and implements it in clean Python code
  3. The Frontend Engineer creates a user-friendly Gradio interface
  4. The Test Engineer ensures everything works as expected with comprehensive tests

Image description

Image description

The Grand Finale: Running Our Application

Once the AI team finishes their work, we can actually run the application they built:

$ cd output
$ uv run app.py

And voilà! A fully functional stock management application appears:

Image description

You can now deposit funds, buy and sell stocks, track your portfolio value, and more - all created by an AI engineering team!

What Just Happened? Behind the Scenes

Let's take a moment to appreciate what just happened:

  1. Design Phase: Our AI Engineering Lead analyzed requirements and created a detailed blueprint
  2. Implementation Phase: The Backend Engineer wrote clean, functional Python code
  3. UI Development: The Frontend Engineer built an intuitive Gradio interface
  4. Quality Assurance: The Test Engineer ensured everything worked correctly

All of this happened with minimal human intervention - just a few configuration files and a press of a button!

Why This Is Revolutionary

This approach to software development is groundbreaking for several reasons:

  1. Speed: Development that would take days or weeks happens in minutes
  2. Specialization: Each agent brings focused expertise to their specific role
  3. Collaboration: Information flows naturally between team members
  4. Quality: The test-driven approach ensures robust, working software
  5. Accessibility: Complex applications can be built even if you're not a coding expert

The Future of Development?

Will AI teams replace human developers? Not likely. But they will transform how we work:

  • Rapid Prototyping: Test ideas and build MVPs in record time
  • Skill Augmentation: Fill gaps in your human team's expertise
  • 24/7 Development: Your AI team never sleeps (or needs coffee breaks!)
  • Learning Tool: Watch experts at work and learn best practices

What's Next?

The possibilities are endless! You could:

  • Expand the team with more specialized roles (DevOps engineer, security specialist)
  • Tackle more complex applications
  • Customize the agents with domain-specific knowledge
  • Integrate with your existing development workflow

Conclusion

Building an AI engineering team with CrewAI and Amazon Bedrock demonstrates how far AI has come. We've moved from AI assistants that can answer questions to AI teams that can build entire applications from scratch.

This approach doesn't replace human creativity and innovation - it amplifies it. By handling routine implementation details, AI engineering teams free human developers to focus on the bigger picture: solving real-world problems and creating value.

So, are you ready to assemble your AI engineering dream team? The tools are here, and the possibilities are limitless!