Build a Local AI Development Crew
Build a multi-agent AI crew that plans, writes, and reviews code locally.
Introduction
30 Second Summary
Every software team has specialists: someone who plans the architecture, someone who writes the code, and someone who reviews it for bugs. What if you could build that entire team as AI agents running on your own computer?
In this project, you will build a local AI development crew with three collaborating agents that plan software, write code to your filesystem, and review implementations. The entire system runs through a local language model with zero API costs.
What You'll Build
A local AI development crew built with CrewAI and powered by Ollama, featuring three specialized agents that autonomously plan, write, and review code on your machine.
By the end of this project, you'll have:
- A working multi-agent system with three specialized agents (Architect, Writer, Reviewer) collaborating autonomously on your local machine.
- Custom tools that let your agents read files from your filesystem, write code to disk, and execute terminal commands.
- A CLI interface supporting both "build from scratch" and "review existing code" workflows.
- Secret Mission: A guided development mode that breaks tasks into sequential learning steps with explanations.
Are there any prerequisites?
You should be comfortable writing Python and using the terminal. This project also requires at least 16 GB of RAM to run the local language model smoothly.
Set Up Your Environment
Before your AI agents can collaborate on code, you need the infrastructure that powers them. This project runs entirely on your machine with no cloud APIs, so you need a local model server and a framework to orchestrate your agents.
In this step, you will install Ollama (a local LLM server), pull a coding-specialized model, and set up a Python environment with CrewAI (the multi-agent framework).
In this step, get ready to:
- Install Ollama and download the qwen2.5-coder:7b model.
- Install Python 3.13 and create a virtual environment.
- Install CrewAI with tools support and verify it works.
Install Ollama and pull the coding model
Ollama is a lightweight server that runs large language models locally. It handles model downloads, memory management, and exposes an API your agents will talk to.
- Open your browser and go to ollama.com/download.
- Download the Windows installer and run it.
- Follow the installer prompts to complete the installation.
What does Ollama do?
Ollama manages LLM models on your machine. It downloads model weights, loads them into memory when needed, and exposes an HTTP API at http://localhost:11434 that your Python code can call.
Models automatically unload from memory after 5 minutes of inactivity, so Ollama only uses resources when you are actively running tasks.
After installation finishes, Ollama starts running in the background. Confirm it installed correctly by checking the version.
- Open a terminal by pressing the Windows key, typing cmd, and pressing Enter.
- Check the Ollama version by running this command:
ollama -v
✔️ I see a version number
Ollama is installed and running. You should see output like ollama version is 0.x.x. Move on to pulling the model below.
ⓧ Command not found
The installer may not have added Ollama to your PATH yet.
- Close your terminal and open a new one (the PATH update only takes effect in new windows).
- Try running ollama -v again.
- If it still fails, restart your computer and try once more. The Ollama installer registers itself on startup.
Now download the coding model your agents will use. This is a 4.7 GB download that specializes in code generation and tool calling.
- Pull the qwen2.5-coder:7b model by running this command:
ollama pull qwen2.5-coder:7b
Why qwen2.5-coder:7b?
This model is specifically trained for code generation and supports native tool calling. Tool calling is essential because it lets your agents invoke custom tools (like file writers and command executors) during their work.
At 7 billion parameters it fits comfortably in 16 GB of RAM while still producing high-quality code output.
- Wait for the download to complete. You will see a progress bar in the terminal.
- Confirm the model is available by running:
ollama list
You should see qwen2.5-coder:7b listed in the output.
Download stuck or failing?
Make sure you have at least 5 GB of free disk space. If the download stalls, press Ctrl+C to cancel and run the pull command again. Ollama resumes from where it left off.
Help me troubleshoot this
Install Python 3.13 and create a virtual environment
CrewAI requires Python 3.13 or lower. It does not yet support Python 3.14. Since your system has Python 3.14, you will install Python 3.13 alongside it and use the Windows py launcher to target the correct version.
- Open your browser and go to python.org/downloads.
- Scroll down to find the latest Python 3.13 release and click on it.
- Download the Windows installer (64-bit) and run it.
- On the first screen, check the box that says Add python.exe to PATH.
- Click Install Now and wait for the installation to finish.
Why Python 3.13 when I already have 3.14?
CrewAI officially requires Python >=3.10, <3.14. Installing 3.13 alongside 3.14 is safe. Windows supports multiple Python versions side by side, and the py launcher lets you pick which version to use.
Verify that Python 3.13 is available through the py launcher.
- Check the installed Python 3.13 version by running:
py -3.13 --version
✔️ I see Python 3.13.x
Python 3.13 is installed and ready. Move on to creating your project folder below.
ⓧ I see a different version
The py launcher may be resolving to a different version.
- Run py --list to see all installed Python versions.
- If 3.13 is not listed, re-run the Python 3.13 installer and make sure Add python.exe to PATH is checked.
ⓧ Command not found
The py launcher is not on your PATH.
- Close your terminal and open a new one.
- If it still fails, re-run the Python 3.13 installer and select Modify. Make sure the py launcher option is checked, then click Install.
Now create your project directory and set up the virtual environment.
- Move to your Desktop by running this command:
cd %USERPROFILE%\Desktop
- Create your project folder and move into it by running these commands:
mkdir dev_crew
cd dev_crew
- Create a virtual environment using Python 3.13 by running:
py -3.13 -m venv .venv
- Activate the virtual environment by running:
.venv\Scripts\activate
You should see (.venv) appear at the beginning of your terminal prompt. This confirms you are working inside the isolated environment.
What is a virtual environment?
A virtual environment is an isolated Python workspace. Packages you install here stay separate from your system Python installation. This prevents version conflicts between different projects on your machine.
- Confirm the virtual environment is using Python 3.13 by running:
python --version
You should see Python 3.13.x in the output. Inside the activated venv, the python command points to 3.13 regardless of your system default.
Seeing Python 3.14 instead of 3.13?
Make sure you see (.venv) in your prompt. If not, run .venv\Scripts\activate again. If you still see 3.14, delete the .venv folder and recreate it with py -3.13 -m venv .venv.
Help me fix my virtual environment
Install CrewAI with tools support
CrewAI is the framework that lets you define multiple AI agents, assign them roles, and chain their work together. The [tools] extra installs built-in tool support your agents need to interact with files.
- Install CrewAI with tools support by running:
pip install 'crewai[tools]'
What does crewai[tools] include?
The [tools] extra installs the crewai_tools package alongside the core framework. This gives you access to built-in tools like FileReadTool that your agents will use to read files from your filesystem.
This installation pulls in several dependencies and may take a minute or two. You will see a progress bar for each package.
- Verify the installation works by importing CrewAI in Python:
python -c "from crewai import Agent, Task, Crew; print('CrewAI is ready')"
You should see CrewAI is ready printed in the terminal.
Import error or installation failure?
Make sure your virtual environment is still active (you should see (.venv) in the prompt). If you accidentally closed your terminal, navigate back to dev_crew and run .venv\Scripts\activate before trying the install again.
If pip install itself fails with a build error, confirm python --version shows 3.13. CrewAI does not support Python 3.14 yet.
Help me fix my CrewAI installation
Your local AI stack is ready. You have Ollama serving the qwen2.5-coder:7b model, and CrewAI installed in an isolated Python 3.13 environment. Next up, you will define three specialized agents that form your development crew.
Define Your Development Agents
Your environment is locked and loaded. Ollama is running, the model is pulled, and CrewAI is installed.
Now you need to tell CrewAI how to talk to your local model and define the agents that will collaborate on development tasks. Each agent gets a specialized role, a clear goal, and a backstory that shapes how it approaches problems.
In this step, get ready to:
- Create your project files and connect CrewAI to Ollama.
- Define three specialized agents for planning, writing, and reviewing code.
- Test the LLM connection with a simple single-agent task.
Create your project files and configure the LLM
Your project needs two Python files. The first, main.py, will hold the agent definitions and crew logic. The second, tools.py, will hold custom tools you build in the next step.
- Open VS Code to your dev_crew project folder by running this command in your terminal:
code .
- In VS Code, click File in the top menu bar.
- Click New File.
- Type main.py as the file name and press Enter.
- Repeat the process to create a second file named tools.py.
- Leave tools.py empty for now. You will fill it in during the next step.
- Confirm the files exist by running:
ls
You should see main.py and tools.py in the output.
- Open main.py in the VS Code editor, then add the following imports and LLM configuration:
import sys
import os
from crewai import Agent, Task, Crew, Process, LLM
from crewai_tools import FileReadTool
from tools import FileWriterTool, CommandExecutorTool
# Configure the local LLM via Ollama
llm = LLM(
model="ollama/qwen2.5-coder:7b",
base_url="http://localhost:11434",
temperature=0.2
)
What does this code do?
- The imports bring in CrewAI's core classes: Agent, Task, Crew, Process, and LLM.
- The LLM class wraps your local Ollama instance. The ollama/ prefix tells CrewAI to route requests through the Ollama provider.
- A temperature of 0.2 keeps outputs focused and deterministic. Lower values produce more predictable code generation.
- The from tools import line references the custom tools you will build in Step 3. It will cause an import error if you try to run main.py directly right now, which is expected.
- Save main.py.
You will not see any visible output yet. The next substep adds the agent definitions.
Seeing red underlines on the imports?
VS Code may show warnings for from tools import because tools.py is empty. This is expected and will resolve in Step 3 when you define those classes.
If you see errors on from crewai import, make sure your VS Code Python interpreter is set to the virtual environment inside dev_crew. Press Ctrl+Shift+P, type Python: Select Interpreter, and choose the one pointing to your venv.
Help me fix my import errors
Define your three development agents
In CrewAI, an agent is defined by three key attributes: its role (what it does), its goal (what it aims to achieve), and its backstory (how it approaches the work). These strings are injected into the system prompt behind the scenes.
Why do role, goal, and backstory matter?
CrewAI uses these three fields as system-level instructions. The role tells the LLM what persona to adopt. The goal focuses its output on a specific objective. The backstory adds depth that shapes tone, priorities, and working style.
A vague backstory produces generic output. A detailed backstory that mentions specific practices (like PEP 8, function signatures, or line-by-line analysis) significantly improves the quality of what the agent produces.
- In main.py, add the following three agent definitions below your LLM configuration:
# Define agents
architect = Agent(
role="Senior Software Architect",
goal="Design clean, scalable software architectures and break down requirements into clear implementation plans",
backstory=(
"You are a senior software architect with 15 years of experience. "
"You excel at breaking complex requirements into modular, well-structured plans. "
"You always specify file names, function signatures, and data flow between components."
),
llm=llm,
verbose=True
)
writer = Agent(
role="Expert Code Writer",
goal="Implement code based on architectural plans, writing clean, well-documented, production-ready code",
backstory=(
"You are an expert programmer who writes clean, efficient Python code. "
"You follow PEP 8 conventions, add docstrings, and handle edge cases. "
"You always write complete, runnable code, never pseudocode or placeholders."
),
llm=llm,
verbose=True
)
reviewer = Agent(
role="Senior Code Reviewer",
goal="Review code line-by-line for bugs, security issues, performance problems, and suggest specific improvements",
backstory=(
"You are a meticulous code reviewer with expertise in Python best practices. "
"You check for bugs, security vulnerabilities, performance issues, and code style. "
"You provide specific line-by-line feedback with concrete improvement suggestions."
),
llm=llm,
verbose=True
)
What does each agent specialize in?
- The architect breaks requirements into file structures, function signatures, and data flow diagrams. It plans before anything gets built.
- The writer implements the plan as actual Python code. Its backstory emphasizes writing complete, runnable code to prevent the LLM from generating pseudocode.
- The reviewer reads generated code and flags bugs, security issues, and style problems. It provides specific line references and concrete fixes.
- Setting verbose=True on each agent tells CrewAI to print detailed execution logs so you can watch the agents think and act in real time.
- Save main.py.
You will not see a visible change yet. The next substep runs a quick test to confirm everything connects.
✔️ Awesome, I've got everything!
Great. Double check you have saved main.py with the imports, LLM config, and all three agents.
ⓧ I'd like to double check the full code
Here is the complete main.py as it should look at this point:
import sys
import os
from crewai import Agent, Task, Crew, Process, LLM
from crewai_tools import FileReadTool
from tools import FileWriterTool, CommandExecutorTool
# Configure the local LLM via Ollama
llm = LLM(
model="ollama/qwen2.5-coder:7b",
base_url="http://localhost:11434",
temperature=0.2
)
# Define agents
architect = Agent(
role="Senior Software Architect",
goal="Design clean, scalable software architectures and break down requirements into clear implementation plans",
backstory=(
"You are a senior software architect with 15 years of experience. "
"You excel at breaking complex requirements into modular, well-structured plans. "
"You always specify file names, function signatures, and data flow between components."
),
llm=llm,
verbose=True
)
writer = Agent(
role="Expert Code Writer",
goal="Implement code based on architectural plans, writing clean, well-documented, production-ready code",
backstory=(
"You are an expert programmer who writes clean, efficient Python code. "
"You follow PEP 8 conventions, add docstrings, and handle edge cases. "
"You always write complete, runnable code, never pseudocode or placeholders."
),
llm=llm,
verbose=True
)
reviewer = Agent(
role="Senior Code Reviewer",
goal="Review code line-by-line for bugs, security issues, performance problems, and suggest specific improvements",
backstory=(
"You are a meticulous code reviewer with expertise in Python best practices. "
"You check for bugs, security vulnerabilities, performance issues, and code style. "
"You provide specific line-by-line feedback with concrete improvement suggestions."
),
llm=llm,
verbose=True
)
Test the LLM connection
Before building the full crew workflow, you should verify that CrewAI can actually reach your local Ollama instance and get a response. You will create a small test script that runs a single agent with a simple task.
- Create a new file called test_llm.py in VS Code by clicking File then New File.
- Name it test_llm.py and add the following code:
from crewai import Agent, Task, Crew, Process, LLM
# Configure the local LLM via Ollama
llm = LLM(
model="ollama/qwen2.5-coder:7b",
base_url="http://localhost:11434",
temperature=0.2
)
# Create a simple test agent
test_agent = Agent(
role="Helpful Assistant",
goal="Answer questions clearly and concisely",
backstory="You are a helpful AI assistant.",
llm=llm,
verbose=True
)
# Create a simple test task
test_task = Task(
description="Explain what a Python list is in exactly two sentences.",
expected_output="A clear two-sentence explanation of Python lists.",
agent=test_agent
)
# Run the test
crew = Crew(
agents=[test_agent],
tasks=[test_task],
process=Process.sequential,
verbose=True
)
result = crew.kickoff()
print("\nResult:", result.raw)
What does this test do?
This script creates a minimal agent with a trivial task (explain Python lists in two sentences). If CrewAI can reach Ollama and the model responds, you will see the agent's reasoning process followed by a short answer.
The test uses the same LLM configuration as your main project. If this works, your full crew will work too.
- Save test_llm.py.
- Run the test by executing this command in your terminal (make sure your virtual environment is still active):
python test_llm.py
You should see verbose output showing the agent receiving the task, thinking through it, and producing a two-sentence explanation. This may take 20-60 seconds on the first run as Ollama loads the model into memory.
What should I see?
The terminal will display CrewAI's verbose logs showing the agent's workflow. Look for lines showing the agent receiving its task, generating a response, and a final line starting with Result: followed by a short explanation of Python lists.
The exact wording varies each time, but any coherent response means the connection is working.
Not getting a response?
- Make sure Ollama is running. Look for the Ollama icon in your Windows system tray. If it is missing, open Ollama from your Start menu.
- Confirm the model is available by running ollama list in a separate terminal. You should see qwen2.5-coder:7b in the list.
- If you see a connection refused error, check that nothing else is using port 11434. Ollama binds to localhost:11434 by default.
Help me debug my Ollama connection
- Once you see a successful result, delete test_llm.py. You no longer need it. Right-click the file in VS Code's Explorer sidebar and select Delete.
Your local LLM is confirmed working with CrewAI. Next up, you will build custom tools that give your agents the power to read files, write code, and run commands on your machine.
Build Custom Tools
Your agents are defined, but right now they can only think and talk. They have no way to interact with your filesystem or run commands.
In this step, you will build custom tools that give your agents real power. The Writer will be able to save code files to disk, and all agents will be able to execute terminal commands to test their work.
In this step, get ready to:
- Create a FileWriterTool that saves code to files on your filesystem.
- Create a CommandExecutorTool that runs terminal commands and returns output.
- Wire tools to the appropriate agents so each one has the right capabilities.
Create the FileWriterTool
CrewAI agents use tools to interact with the outside world. A tool is a Python class that extends BaseTool and implements a _run method. You also define an input schema using Pydantic so the LLM knows exactly what arguments the tool expects.
- In tools.py, add the imports and the FileWriterTool class by pasting this code:
import os
import subprocess
from typing import Type
from crewai.tools import BaseTool
from pydantic import BaseModel, Field
class FileWriterInput(BaseModel):
"""Input schema for the FileWriterTool."""
file_path: str = Field(description="The path where the file should be written, relative to the project root.")
content: str = Field(description="The complete content to write to the file.")
class FileWriterTool(BaseTool):
name: str = "file_writer"
description: str = (
"Writes content to a file at the specified path. "
"Creates parent directories if they do not exist. "
"Use this to save code files to disk."
)
args_schema: Type[BaseModel] = FileWriterInput
def _run(self, file_path: str, content: str) -> str:
try:
full_path = os.path.join("output", file_path)
os.makedirs(os.path.dirname(full_path), exist_ok=True) if os.path.dirname(full_path) else None
with open(full_path, "w", encoding="utf-8") as f:
f.write(content)
return f"Successfully wrote {len(content)} characters to {full_path}"
except Exception as e:
return f"Error writing file: {str(e)}"
What does this code do?
FileWriterInput is a Pydantic model that tells the LLM this tool needs two arguments: a file_path (where to save) and content (what to write). The LLM reads the Field descriptions to understand how to use each argument.
FileWriterTool extends BaseTool and implements _run. When an agent calls this tool, it writes the content to a file inside an output/ directory. It creates any parent directories automatically so nested file paths work.
Why write files to an output/ directory?
Scoping all generated files to an output/ subdirectory keeps AI-generated code separate from your project code. This prevents the agent from accidentally overwriting your main.py or tools.py.
- Save tools.py.
Seeing a red underline on the imports?
If VS Code shows import errors for crewai.tools or pydantic, make sure your virtual environment is selected as the Python interpreter. Press Ctrl+Shift+P, type Python: Select Interpreter, and choose the one inside your dev_crew venv.
Help me fix import errors in my CrewAI tools file
Create the CommandExecutorTool
Your agents also need to run terminal commands. This lets the Writer verify that generated code has no syntax errors, and it opens the door for running tests or installing packages.
- In tools.py, add the CommandExecutorTool below the FileWriterTool class:
class CommandExecutorInput(BaseModel):
"""Input schema for the CommandExecutorTool."""
command: str = Field(description="The terminal command to execute.")
class CommandExecutorTool(BaseTool):
name: str = "command_executor"
description: str = (
"Executes a terminal command and returns the output. "
"Use this to run Python scripts, check syntax, run tests, or install packages. "
"Commands run in the project output directory."
)
args_schema: Type[BaseModel] = CommandExecutorInput
def _run(self, command: str) -> str:
try:
result = subprocess.run(
command,
shell=True,
capture_output=True,
text=True,
timeout=30,
cwd="output"
)
output = ""
if result.stdout:
output += f"STDOUT:\n{result.stdout}\n"
if result.stderr:
output += f"STDERR:\n{result.stderr}\n"
output += f"Return code: {result.returncode}"
return output if output.strip() else "Command executed successfully with no output."
except subprocess.TimeoutExpired:
return "Error: Command timed out after 30 seconds."
except Exception as e:
return f"Error executing command: {str(e)}"
What does this code do?
CommandExecutorTool uses Python's subprocess module to run shell commands. It captures both stdout and stderr so the agent can read the full output. A 30-second timeout prevents runaway processes from hanging your system.
Like the FileWriterTool, commands run scoped to the output/ directory via the cwd parameter. This keeps the agent's terminal actions contained.
- Save tools.py.
- Confirm the file has no syntax errors by running this in your terminal:
python -c "from tools import FileWriterTool, CommandExecutorTool; print('Tools OK')"
You should see Tools OK printed with no errors.
Seeing a ModuleNotFoundError?
Make sure your terminal is in the dev_crew directory where tools.py lives. Also confirm your virtual environment is active (you should see (venv) in your terminal prompt).
Help me debug why my tools.py import is failing
✔️ Awesome, I've got everything!
Great. Double check you have saved tools.py and move on to wiring these tools to your agents.
ⓧ I'd like to double check the full code
import os
import subprocess
from typing import Type
from crewai.tools import BaseTool
from pydantic import BaseModel, Field
class FileWriterInput(BaseModel):
"""Input schema for the FileWriterTool."""
file_path: str = Field(description="The path where the file should be written, relative to the project root.")
content: str = Field(description="The complete content to write to the file.")
class FileWriterTool(BaseTool):
name: str = "file_writer"
description: str = (
"Writes content to a file at the specified path. "
"Creates parent directories if they do not exist. "
"Use this to save code files to disk."
)
args_schema: Type[BaseModel] = FileWriterInput
def _run(self, file_path: str, content: str) -> str:
try:
full_path = os.path.join("output", file_path)
os.makedirs(os.path.dirname(full_path), exist_ok=True) if os.path.dirname(full_path) else None
with open(full_path, "w", encoding="utf-8") as f:
f.write(content)
return f"Successfully wrote {len(content)} characters to {full_path}"
except Exception as e:
return f"Error writing file: {str(e)}"
class CommandExecutorInput(BaseModel):
"""Input schema for the CommandExecutorTool."""
command: str = Field(description="The terminal command to execute.")
class CommandExecutorTool(BaseTool):
name: str = "command_executor"
description: str = (
"Executes a terminal command and returns the output. "
"Use this to run Python scripts, check syntax, run tests, or install packages. "
"Commands run in the project output directory."
)
args_schema: Type[BaseModel] = CommandExecutorInput
def _run(self, command: str) -> str:
try:
result = subprocess.run(
command,
shell=True,
capture_output=True,
text=True,
timeout=30,
cwd="output"
)
output = ""
if result.stdout:
output += f"STDOUT:\n{result.stdout}\n"
if result.stderr:
output += f"STDERR:\n{result.stderr}\n"
output += f"Return code: {result.returncode}"
return output if output.strip() else "Command executed successfully with no output."
except subprocess.TimeoutExpired:
return "Error: Command timed out after 30 seconds."
except Exception as e:
return f"Error executing command: {str(e)}"
Wire tools to your agents
Your tools exist, but your agents do not know about them yet. Each agent should only get the tools relevant to its job. The Writer needs to save files and run commands. The Reviewer needs to read files for analysis.
- Switch back to main.py in VS Code.
- Find the # Define agents comment. Add a tool initialization block directly above it:
# Initialize tools
file_read_tool = FileReadTool()
file_writer_tool = FileWriterTool()
command_executor_tool = CommandExecutorTool()
What does this code do?
This creates instances of each tool class. FileReadTool comes from the crewai_tools package (already imported). FileWriterTool and CommandExecutorTool come from the tools.py file you just wrote (also already imported).
Next, you need to add a tools parameter to the Writer and Reviewer agents so they know which tools they can use.
- In the writer agent definition, find this line:
llm=llm,
verbose=True
- Add a tools parameter above llm=llm, so the writer definition now includes:
tools=[file_writer_tool, command_executor_tool],
llm=llm,
verbose=True
- In the reviewer agent definition, find the same llm=llm line.
- Add a tools parameter above it, so the reviewer definition now includes:
tools=[file_read_tool],
llm=llm,
verbose=True
Why doesn't the Architect get any tools?
The Architect's job is purely planning. It outputs an implementation plan as text, which the Writer then acts on. Giving it file or command tools would blur its role and risk it trying to write code before the plan is finalized.
- Save main.py.
- Verify the updated file loads without errors by running:
python -c "import main; print('Main OK')"
You should see Main OK printed with no errors.
Seeing an ImportError from tools.py?
Make sure both main.py and tools.py are saved in the same dev_crew directory. Python finds tools.py by looking in the current working directory, so your terminal must be inside dev_crew when you run the check.
Help me fix my main.py import error
✔️ Awesome, I've got everything!
Great. Double check you have saved main.py and move on to the next step.
ⓧ I'd like to double check the full code
import sys
import os
from crewai import Agent, Task, Crew, Process, LLM
from crewai_tools import FileReadTool
from tools import FileWriterTool, CommandExecutorTool
# Configure the local LLM via Ollama
llm = LLM(
model="ollama/qwen2.5-coder:7b",
base_url="http://localhost:11434",
temperature=0.2
)
# Initialize tools
file_read_tool = FileReadTool()
file_writer_tool = FileWriterTool()
command_executor_tool = CommandExecutorTool()
# Define agents
architect = Agent(
role="Senior Software Architect",
goal="Design clean, scalable software architectures and break down requirements into clear implementation plans",
backstory=(
"You are a senior software architect with 15 years of experience. "
"You excel at breaking complex requirements into modular, well-structured plans. "
"You always specify file names, function signatures, and data flow between components."
),
llm=llm,
verbose=True
)
writer = Agent(
role="Expert Code Writer",
goal="Implement code based on architectural plans, writing clean, well-documented, production-ready code",
backstory=(
"You are an expert programmer who writes clean, efficient Python code. "
"You follow PEP 8 conventions, add docstrings, and handle edge cases. "
"You always write complete, runnable code, never pseudocode or placeholders."
),
tools=[file_writer_tool, command_executor_tool],
llm=llm,
verbose=True
)
reviewer = Agent(
role="Senior Code Reviewer",
goal="Review code line-by-line for bugs, security issues, performance problems, and suggest specific improvements",
backstory=(
"You are a meticulous code reviewer with expertise in Python best practices. "
"You check for bugs, security vulnerabilities, performance issues, and code style. "
"You provide specific line-by-line feedback with concrete improvement suggestions."
),
tools=[file_read_tool],
llm=llm,
verbose=True
)
Your agents now have real capabilities. The Writer can save code and run it, while the Reviewer can read files for analysis. Next up, you will connect these agents into a sequential crew that plans, writes, and reviews code as a team.
Wire Up the Development Crew
Your agents have their roles and your tools are ready. Now it's time to wire everything into a functioning crew that can take a task from start to finish.
In CrewAI, a sequential process means each agent's output becomes the next agent's input. The Architect's plan feeds into the Writer, and the Writer's code feeds into the Reviewer. You'll also build a CLI so you can trigger different workflows from your terminal.
In this step, get ready to:
- Define three sequential tasks that chain the agents' outputs together.
- Create a review mode that points the Reviewer at existing files.
- Build a CLI interface with build and review commands.
Define the sequential tasks for build mode
The build mode workflow needs three tasks that execute in order: plan the architecture, implement the code, then review the implementation. Each task includes a detailed description that tells the agent exactly what to produce and an expected output that CrewAI passes to the next agent in the chain.
- In main.py, scroll to the bottom of the file (below the reviewer agent definition).
- Add the following function that defines all three tasks and runs them as a sequential crew:
def run_build_mode(task_description):
"""Run the crew in build mode to create a project from scratch."""
plan_task = Task(
description=(
f"Analyze this requirement and create a detailed implementation plan:\n\n"
f"{task_description}\n\n"
"Your plan must include:\n"
"1. File structure (list every file to create)\n"
"2. For each file: its purpose, classes/functions it contains, and their signatures\n"
"3. Data flow between components\n"
"4. Any external dependencies needed"
),
expected_output="A detailed implementation plan with file structure, function signatures, and data flow.",
agent=architect
)
implement_task = Task(
description=(
"Implement the architecture plan by writing all the code files. "
"Use the file_writer tool to save each file to the 'output' directory. "
"Write complete, runnable Python code with proper imports, error handling, and docstrings. "
"After writing files, use the command executor to verify the code runs without syntax errors."
),
expected_output="All code files written to the output directory, verified to be syntactically correct.",
agent=writer
)
review_task = Task(
description=(
"Review all the code that was just written. "
"Use the file_read tool to read each file from the 'output' directory. "
"Provide a detailed review covering:\n"
"1. Line-by-line issues (bugs, logic errors)\n"
"2. Security concerns\n"
"3. Performance improvements\n"
"4. Code style and best practices\n"
"5. Overall architecture feedback"
),
expected_output="A comprehensive code review with specific line references and improvement suggestions.",
agent=reviewer
)
crew = Crew(
agents=[architect, writer, reviewer],
tasks=[plan_task, implement_task, review_task],
process=Process.sequential,
verbose=True
)
result = crew.kickoff()
print("\n" + "=" * 60)
print("DEVELOPMENT CREW COMPLETE")
print("=" * 60)
print(result.raw)
What does this code do?
This function defines three tasks and hands them to a sequential crew:
- plan_task asks the Architect to produce a full implementation plan including file structure, function signatures, and data flow.
- implement_task tells the Writer to use the file_writer tool to save real code files, then verify them with the command_executor.
- review_task tells the Reviewer to read the generated files and give line-by-line feedback.
- Process.sequential ensures each task's output is passed as context to the next task. The Architect's plan becomes the Writer's input, and the Writer's code becomes the Reviewer's input.
Why sequential instead of parallel?
Software development is inherently sequential. You can't write code without a plan, and you can't review code that doesn't exist yet. The sequential process mirrors a real development workflow where each phase depends on the previous one.
- You won't see a change yet. The next chunks add the review mode and CLI so you can actually run the crew.
Create the review mode crew
Build mode creates code from scratch, but sometimes you already have code that needs a second pair of eyes. The review mode spins up a simpler crew with just the Reviewer agent pointing at an existing file on your filesystem.
- Directly below the run_build_mode function, add this second function:
def run_review_mode(file_path):
"""Run the crew in review mode to analyze an existing file."""
review_task = Task(
description=(
f"Read and review the file at: {file_path}\n\n"
"Provide a thorough code review including:\n"
"1. Line-by-line analysis of potential issues\n"
"2. Bug identification with explanations\n"
"3. Security vulnerability check\n"
"4. Performance optimization suggestions\n"
"5. Code style and readability improvements\n"
"6. Refactoring suggestions with code examples"
),
expected_output="A detailed line-by-line code review with specific improvements and refactoring suggestions.",
agent=reviewer
)
crew = Crew(
agents=[reviewer],
tasks=[review_task],
process=Process.sequential,
verbose=True
)
result = crew.kickoff()
print("\n" + "=" * 60)
print("CODE REVIEW COMPLETE")
print("=" * 60)
print(result.raw)
What does this code do?
This function creates a single-agent crew focused entirely on code review. It passes the file path directly into the task description so the Reviewer knows which file to read with its file_read_tool.
Even with one agent, you still need a Crew wrapper. That's because crew.kickoff() is how CrewAI manages task execution, tool calling, and output formatting.
- You won't see a change yet. The next chunk adds the CLI entry point so you can trigger these modes from your terminal.
Build the CLI interface
Your crew needs a way to receive commands. The CLI parses terminal arguments to decide whether to run build mode (create a project from a description) or review mode (analyze an existing file).
- At the very bottom of main.py, below the run_review_mode function, add the entry point:
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Usage:")
print(' python main.py build "Build a Flask REST API with user authentication"')
print(' python main.py review path/to/file.py')
sys.exit(1)
mode = sys.argv[1]
if mode == "build":
task_description = " ".join(sys.argv[2:])
os.makedirs("output", exist_ok=True)
run_build_mode(task_description)
elif mode == "review":
file_path = sys.argv[2]
if not os.path.exists(file_path):
print(f"Error: File not found: {file_path}")
sys.exit(1)
run_review_mode(file_path)
else:
print(f"Unknown mode: {mode}. Use 'build' or 'review'.")
sys.exit(1)
What does this code do?
- sys.argv captures everything the user types after python main.py. The first argument is the mode, and everything after is the task description or file path.
- For build mode, os.makedirs("output", exist_ok=True) creates an output directory where the Writer agent saves generated files.
- For review mode, it checks the file exists before passing it to the crew. This prevents cryptic errors from the LLM trying to read a missing file.
- If fewer than 3 arguments are provided, it prints usage examples so the user knows the correct format.
- Save main.py.
- Verify the CLI prints usage instructions by running:
python main.py
- You should see the usage message with two example commands (one for build and one for review).
Seeing a ModuleNotFoundError?
- Make sure your virtual environment is still active. You should see (venv) at the start of your terminal prompt.
- Check that you're running the command from inside your project folder (the one containing main.py and tools.py).
Why is my main.py throwing an import error?
✔️ Awesome, I've got everything!
Great. Double check you've saved your file before moving on.
ⓧ I'd like to double check the full code
import sys
import os
from crewai import Agent, Task, Crew, Process, LLM
from crewai_tools import FileReadTool
from tools import FileWriterTool, CommandExecutorTool
# Configure the local LLM via Ollama
llm = LLM(
model="ollama/qwen2.5-coder:7b",
base_url="http://localhost:11434",
temperature=0.2
)
# Initialize tools
file_read_tool = FileReadTool()
file_writer_tool = FileWriterTool()
command_executor_tool = CommandExecutorTool()
# Define agents
architect = Agent(
role="Senior Software Architect",
goal="Design clean, scalable software architectures and break down requirements into clear implementation plans",
backstory=(
"You are a senior software architect with 15 years of experience. "
"You excel at breaking complex requirements into modular, well-structured plans. "
"You always specify file names, function signatures, and data flow between components."
),
llm=llm,
verbose=True
)
writer = Agent(
role="Expert Code Writer",
goal="Implement code based on architectural plans, writing clean, well-documented, production-ready code",
backstory=(
"You are an expert programmer who writes clean, efficient Python code. "
"You follow PEP 8 conventions, add docstrings, and handle edge cases. "
"You always write complete, runnable code, never pseudocode or placeholders."
),
tools=[file_writer_tool, command_executor_tool],
llm=llm,
verbose=True
)
reviewer = Agent(
role="Senior Code Reviewer",
goal="Review code line-by-line for bugs, security issues, performance problems, and suggest specific improvements",
backstory=(
"You are a meticulous code reviewer with expertise in Python best practices. "
"You check for bugs, security vulnerabilities, performance issues, and code style. "
"You provide specific line-by-line feedback with concrete improvement suggestions."
),
tools=[file_read_tool],
llm=llm,
verbose=True
)
def run_build_mode(task_description):
"""Run the crew in build mode to create a project from scratch."""
plan_task = Task(
description=(
f"Analyze this requirement and create a detailed implementation plan:\n\n"
f"{task_description}\n\n"
"Your plan must include:\n"
"1. File structure (list every file to create)\n"
"2. For each file: its purpose, classes/functions it contains, and their signatures\n"
"3. Data flow between components\n"
"4. Any external dependencies needed"
),
expected_output="A detailed implementation plan with file structure, function signatures, and data flow.",
agent=architect
)
implement_task = Task(
description=(
"Implement the architecture plan by writing all the code files. "
"Use the file_writer tool to save each file to the 'output' directory. "
"Write complete, runnable Python code with proper imports, error handling, and docstrings. "
"After writing files, use the command executor to verify the code runs without syntax errors."
),
expected_output="All code files written to the output directory, verified to be syntactically correct.",
agent=writer
)
review_task = Task(
description=(
"Review all the code that was just written. "
"Use the file_read tool to read each file from the 'output' directory. "
"Provide a detailed review covering:\n"
"1. Line-by-line issues (bugs, logic errors)\n"
"2. Security concerns\n"
"3. Performance improvements\n"
"4. Code style and best practices\n"
"5. Overall architecture feedback"
),
expected_output="A comprehensive code review with specific line references and improvement suggestions.",
agent=reviewer
)
crew = Crew(
agents=[architect, writer, reviewer],
tasks=[plan_task, implement_task, review_task],
process=Process.sequential,
verbose=True
)
result = crew.kickoff()
print("\n" + "=" * 60)
print("DEVELOPMENT CREW COMPLETE")
print("=" * 60)
print(result.raw)
def run_review_mode(file_path):
"""Run the crew in review mode to analyze an existing file."""
review_task = Task(
description=(
f"Read and review the file at: {file_path}\n\n"
"Provide a thorough code review including:\n"
"1. Line-by-line analysis of potential issues\n"
"2. Bug identification with explanations\n"
"3. Security vulnerability check\n"
"4. Performance optimization suggestions\n"
"5. Code style and readability improvements\n"
"6. Refactoring suggestions with code examples"
),
expected_output="A detailed line-by-line code review with specific improvements and refactoring suggestions.",
agent=reviewer
)
crew = Crew(
agents=[reviewer],
tasks=[review_task],
process=Process.sequential,
verbose=True
)
result = crew.kickoff()
print("\n" + "=" * 60)
print("CODE REVIEW COMPLETE")
print("=" * 60)
print(result.raw)
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Usage:")
print(' python main.py build "Build a Flask REST API with user authentication"')
print(' python main.py review path/to/file.py')
sys.exit(1)
mode = sys.argv[1]
if mode == "build":
task_description = " ".join(sys.argv[2:])
os.makedirs("output", exist_ok=True)
run_build_mode(task_description)
elif mode == "review":
file_path = sys.argv[2]
if not os.path.exists(file_path):
print(f"Error: File not found: {file_path}")
sys.exit(1)
run_review_mode(file_path)
else:
print(f"Unknown mode: {mode}. Use 'build' or 'review'.")
sys.exit(1)
Your crew is fully wired and ready to run. Next up, you'll put it to the test with real development tasks and see your agents collaborate in action.
Run Your Development Crew
Your agents are defined, the tools are wired up, and the CLI is ready. Everything is in place for the crew to collaborate on real tasks.
In this step, you'll put the crew to work. You'll watch the Architect plan, the Writer implement, and the Reviewer critique, all happening autonomously in your terminal.
In this step, get ready to:
- Test the "build" mode by giving the crew a real coding task.
- Test the "review" mode on an existing Python file.
- Iterate on agent prompts and configurations for better results.
Test build mode with a real task
The "build" mode triggers the full sequential workflow. The Architect plans the project, the Writer implements code files, and the Reviewer provides feedback. All three agents run one after the other, each building on the previous agent's output.
- Run the crew in build mode by running this command:
python main.py build "Build a Python CLI calculator with add, subtract, multiply, divide"
What should I expect?
Because verbose=True is set on each agent, you'll see detailed logs in your terminal showing each agent's thought process. The Architect will print its plan, the Writer will call the file_writer tool to save files, and the Reviewer will call file_read to read and critique the code.
The full crew run typically takes 1-3 minutes depending on task complexity. Each individual task may take 20-60 seconds as the model generates tokens at 15-30 tokens per second on CPU.
- Wait for the crew to finish. You'll know it's done when you see the DEVELOPMENT CREW COMPLETE banner printed in your terminal.
- Check the output folder inside your dev_crew directory. You should see one or more Python files that the Writer agent created.
- Confirm the output files exist by running:
ls output
You should see Python files like calculator.py or main.py in the listing. The exact filenames depend on what the Architect decided.
Crew seems stuck or nothing is happening?
- Make sure Ollama is still running. Open a new terminal and run ollama list to verify the model is available.
- If you see connection errors, Ollama may have stopped. Relaunch it from the system tray (Windows) or run ollama serve in a separate terminal.
- If the model seems to loop or repeat itself, press Ctrl+C to stop the run and try again. Local models occasionally get stuck in loops on complex tasks.
Help me troubleshoot why my CrewAI agents aren't producing output with Ollama
Test review mode on an existing file
The "review" mode lets you point the Reviewer agent at any Python file on your system. It reads the file line by line and provides detailed feedback on bugs, security issues, and improvements.
- Run the crew in review mode, pointing it at your own tools.py file:
python main.py review tools.py
What does review mode do differently?
Review mode only uses the Reviewer agent. It calls the FileReadTool to read the target file, then produces a structured code review covering bugs, security, performance, style, and refactoring suggestions.
This is faster than build mode because only one agent runs instead of three.
- Wait for the CODE REVIEW COMPLETE banner to appear in your terminal.
- Read through the review output. You should see line-by-line feedback about your tools.py file, including suggestions about error handling, security, and code style.
Review any Python file
You can point review mode at any Python file on your system. Try it on an old project or a script you wrote months ago. Just pass the relative or absolute path as the second argument.
Seeing "File not found" errors?
- Make sure the file path you pass is relative to where you're running the command (inside the dev_crew folder).
- Check for typos in the filename. The CLI checks if the file exists before starting the crew.
Help me fix a file not found error when running my CrewAI review command
Iterate on prompts and configuration
The quality of agent output depends heavily on how you configure their prompts and parameters. Small changes to backstories, task descriptions, or temperature can dramatically improve results.
What can I tune?
- Temperature: The temperature=0.2 in your LLM config controls randomness. Lower values (0.1-0.2) produce more deterministic, focused output. Higher values (0.5-0.7) produce more creative but less predictable results.
- Backstories: Each agent's backstory shapes how it approaches problems. Adding specific expertise ("you specialize in async Python") or constraints ("you never use global variables") changes the output style.
- Task descriptions: The description field in each Task is the main instruction the agent receives. More specific descriptions produce better results than vague ones.
- Try running build mode again with a different task to see how the crew handles varied requirements:
python main.py build "Build a Python script that reads a CSV file and prints a summary of each column"
- Compare the output quality between your two build runs. Notice how the Architect structures its plan differently for different types of tasks.
- If the output quality feels too generic or misses requirements, open main.py and experiment with adding more specific constraints to the agent backstories or task descriptions.
Why does output vary between runs?
Even at temperature=0.2, local LLMs produce slightly different output each time. This is normal. The overall structure should be consistent, but exact wording and code style will vary.
Clean the output folder between runs
Each build run writes files to the output folder. Files from previous runs will still be there. Delete the folder contents between runs if you want a fresh start.
✔️ Awesome, I've got everything!
Your development crew is fully operational. You've tested both build and review modes and seen the agents collaborate autonomously.
ⓧ I'd like to double check the full code
Here is the complete main.py:
import sys
import os
from crewai import Agent, Task, Crew, Process, LLM
from crewai_tools import FileReadTool
from tools import FileWriterTool, CommandExecutorTool
# Configure the local LLM via Ollama
llm = LLM(
model="ollama/qwen2.5-coder:7b",
base_url="http://localhost:11434",
temperature=0.2
)
# Initialize tools
file_read_tool = FileReadTool()
file_writer_tool = FileWriterTool()
command_executor_tool = CommandExecutorTool()
# Define agents
architect = Agent(
role="Senior Software Architect",
goal="Design clean, scalable software architectures and break down requirements into clear implementation plans",
backstory=(
"You are a senior software architect with 15 years of experience. "
"You excel at breaking complex requirements into modular, well-structured plans. "
"You always specify file names, function signatures, and data flow between components."
),
llm=llm,
verbose=True
)
writer = Agent(
role="Expert Code Writer",
goal="Implement code based on architectural plans, writing clean, well-documented, production-ready code",
backstory=(
"You are an expert programmer who writes clean, efficient Python code. "
"You follow PEP 8 conventions, add docstrings, and handle edge cases. "
"You always write complete, runnable code, never pseudocode or placeholders."
),
tools=[file_writer_tool, command_executor_tool],
llm=llm,
verbose=True
)
reviewer = Agent(
role="Senior Code Reviewer",
goal="Review code line-by-line for bugs, security issues, performance problems, and suggest specific improvements",
backstory=(
"You are a meticulous code reviewer with expertise in Python best practices. "
"You check for bugs, security vulnerabilities, performance issues, and code style. "
"You provide specific line-by-line feedback with concrete improvement suggestions."
),
tools=[file_read_tool],
llm=llm,
verbose=True
)
def run_build_mode(task_description):
"""Run the crew in build mode to create a project from scratch."""
plan_task = Task(
description=(
f"Analyze this requirement and create a detailed implementation plan:\n\n"
f"{task_description}\n\n"
"Your plan must include:\n"
"1. File structure (list every file to create)\n"
"2. For each file: its purpose, classes/functions it contains, and their signatures\n"
"3. Data flow between components\n"
"4. Any external dependencies needed"
),
expected_output="A detailed implementation plan with file structure, function signatures, and data flow.",
agent=architect
)
implement_task = Task(
description=(
"Implement the architecture plan by writing all the code files. "
"Use the file_writer tool to save each file to the 'output' directory. "
"Write complete, runnable Python code with proper imports, error handling, and docstrings. "
"After writing files, use the command executor to verify the code runs without syntax errors."
),
expected_output="All code files written to the output directory, verified to be syntactically correct.",
agent=writer
)
review_task = Task(
description=(
"Review all the code that was just written. "
"Use the file_read tool to read each file from the 'output' directory. "
"Provide a detailed review covering:\n"
"1. Line-by-line issues (bugs, logic errors)\n"
"2. Security concerns\n"
"3. Performance improvements\n"
"4. Code style and best practices\n"
"5. Overall architecture feedback"
),
expected_output="A comprehensive code review with specific line references and improvement suggestions.",
agent=reviewer
)
crew = Crew(
agents=[architect, writer, reviewer],
tasks=[plan_task, implement_task, review_task],
process=Process.sequential,
verbose=True
)
result = crew.kickoff()
print("\n" + "=" * 60)
print("DEVELOPMENT CREW COMPLETE")
print("=" * 60)
print(result.raw)
def run_review_mode(file_path):
"""Run the crew in review mode to analyze an existing file."""
review_task = Task(
description=(
f"Read and review the file at: {file_path}\n\n"
"Provide a thorough code review including:\n"
"1. Line-by-line analysis of potential issues\n"
"2. Bug identification with explanations\n"
"3. Security vulnerability check\n"
"4. Performance optimization suggestions\n"
"5. Code style and readability improvements\n"
"6. Refactoring suggestions with code examples"
),
expected_output="A detailed line-by-line code review with specific improvements and refactoring suggestions.",
agent=reviewer
)
crew = Crew(
agents=[reviewer],
tasks=[review_task],
process=Process.sequential,
verbose=True
)
result = crew.kickoff()
print("\n" + "=" * 60)
print("CODE REVIEW COMPLETE")
print("=" * 60)
print(result.raw)
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Usage:")
print(' python main.py build "Build a Flask REST API with user authentication"')
print(' python main.py review path/to/file.py')
sys.exit(1)
mode = sys.argv[1]
if mode == "build":
task_description = " ".join(sys.argv[2:])
os.makedirs("output", exist_ok=True)
run_build_mode(task_description)
elif mode == "review":
file_path = sys.argv[2]
if not os.path.exists(file_path):
print(f"Error: File not found: {file_path}")
sys.exit(1)
run_review_mode(file_path)
else:
print(f"Unknown mode: {mode}. Use 'build' or 'review'.")
sys.exit(1)
And here is the complete tools.py:
import os
import subprocess
from typing import Type
from crewai.tools import BaseTool
from pydantic import BaseModel, Field
class FileWriterInput(BaseModel):
"""Input schema for the FileWriterTool."""
file_path: str = Field(description="The path where the file should be written, relative to the project root.")
content: str = Field(description="The complete content to write to the file.")
class FileWriterTool(BaseTool):
name: str = "file_writer"
description: str = (
"Writes content to a file at the specified path. "
"Creates parent directories if they do not exist. "
"Use this to save code files to disk."
)
args_schema: Type[BaseModel] = FileWriterInput
def _run(self, file_path: str, content: str) -> str:
try:
full_path = os.path.join("output", file_path)
os.makedirs(os.path.dirname(full_path), exist_ok=True) if os.path.dirname(full_path) else None
with open(full_path, "w", encoding="utf-8") as f:
f.write(content)
return f"Successfully wrote {len(content)} characters to {full_path}"
except Exception as e:
return f"Error writing file: {str(e)}"
class CommandExecutorInput(BaseModel):
"""Input schema for the CommandExecutorTool."""
command: str = Field(description="The terminal command to execute.")
class CommandExecutorTool(BaseTool):
name: str = "command_executor"
description: str = (
"Executes a terminal command and returns the output. "
"Use this to run Python scripts, check syntax, run tests, or install packages. "
"Commands run in the project output directory."
)
args_schema: Type[BaseModel] = CommandExecutorInput
def _run(self, command: str) -> str:
try:
result = subprocess.run(
command,
shell=True,
capture_output=True,
text=True,
timeout=30,
cwd="output"
)
output = ""
if result.stdout:
output += f"STDOUT:\n{result.stdout}\n"
if result.stderr:
output += f"STDERR:\n{result.stderr}\n"
output += f"Return code: {result.returncode}"
return output if output.strip() else "Command executed successfully with no output."
except subprocess.TimeoutExpired:
return "Error: Command timed out after 30 seconds."
except Exception as e:
return f"Error executing command: {str(e)}"
Secret mission
Add Guided Development Mode
Your crew can build code and review code. But what if it could also teach? Add a guided development mode that breaks any task into sequential, explained steps before writing a single line of code.
Clean Up Your Resources
Clean Up Your Resources
This project runs entirely locally with no cloud resources, no accounts, and no billing. Decide whether to keep your resources running, pause them to come back later, or delete them entirely.
Resources you used:
- Ollama running as a background service with the qwen2.5-coder:7b model (4.7 GB on disk).
- Your project folder on the Desktop containing main.py, tools.py, and the output/ directory.
- A Python 3.13 virtual environment inside your project folder.
Keep everything running
No action needed. Choose this if you plan to keep experimenting with your development crew.
- Ollama only uses memory when actively processing a request. The model unloads from memory automatically after 5 minutes of inactivity.
- The qwen2.5-coder:7b model stays on disk (4.7 GB) so you can use it instantly next time.
- Your project folder stays on your Desktop ready for future use.
Pause - I'll come back to this later
Unload the model from memory so Ollama is not holding any resources. Your files and model stay on disk for next time.
- Unload the model from memory by running this command in your terminal:
- Right-click the Ollama icon in your system tray and select Quit to stop the background service entirely.
ollama stop qwen2.5-coder:7b
When you want to resume, open Ollama from the Start menu. It will start the background service again and your model is still on disk.
Delete - I don't want to use this again
Remove all project resources and reclaim disk space. This deletes the model, uninstalls Ollama, and removes your project files.
- Delete the downloaded model by running this command:
ollama rm qwen2.5-coder:7b
- Uninstall Ollama through Windows Settings.
- Open Settings, then Apps, then Installed apps.
- Search for Ollama, click the three-dot menu, and select Uninstall.
- Delete your project folder and virtual environment. Open your terminal and run:
cd ~\Desktop
rmdir /s /q [[PROJECT_DIR="your project folder name"]]
What about Python 3.13?
The virtual environment is inside your project folder, so deleting the folder removes it. Python 3.13 itself remains installed on your system. You can keep it for other projects or uninstall it through Windows Settings if you no longer need it.
Nice Work!
Nice Work!
You just built a fully local, zero-cost AI development crew that autonomously plans, writes, and reviews code on your machine.
You've learned how to:
- Build a multi-agent AI system with three specialized agents (Architect, Writer, Reviewer) that collaborate autonomously using CrewAI's sequential process.
- Create custom tools for file writing and command execution that give AI agents real power over your filesystem.
- Configure a local LLM (qwen2.5-coder:7b) via Ollama that handles tool calling without any cloud API or cost.
- Secret Mission: Added a guided development mode that produces step-by-step plans with explanations before writing code.
Ready to quiz yourself?