Tutorial 2: Agent Team for Your Project

Build a multi-agent team: PM, analyst, developer, and QA working together using CrewAI + Ollama.

πŸ‡·πŸ‡Ί Russian version: 02-agent-team.ru.md


← Tutorials Β· First agent Β· Coding agent β†’


Contents

  1. What you will build
  2. Setup
  3. Define agents
  4. Define tasks
  5. Run the team
  6. Whats next

1. What you will build

A team of AI agents that collaborate on a project:


2. Setup

pip install crewai crewai-tools
ollama pull qwen3.5:4b

3. Define agents

from crewai import Agent, Task, Crew, Process, LLM

llm = LLM(model="ollama/qwen3.5:4b", base_url="http://localhost:11434")

pm = Agent(
    role="Project Manager",
    goal="Coordinate the team, distribute tasks, verify results",
    backstory="Experienced PM who keeps the team focused on delivery.",
    llm=llm
)

analyst = Agent(
    role="Analyst",
    goal="Gather requirements and write specifications",
    backstory="Detail-oriented analyst who turns vague ideas into clear specs.",
    llm=llm
)

developer = Agent(
    role="Developer",
    goal="Implement features according to specification",
    backstory="Senior full-stack developer who writes clean, tested code.",
    llm=llm
)

qa = Agent(
    role="QA Engineer",
    goal="Test everything and find bugs before users do",
    backstory="Meticulous tester who catches everything.",
    llm=llm
)

4. Define tasks

task_analyze = Task(
    description="Analyze requirements for a TODO app with web interface. Users should be able to create, read, update, and delete tasks.",
    agent=analyst,
    expected_output="Requirements document with functional and non-functional specs"
)

task_architect = Task(
    description="Design the architecture based on requirements. What components, what API endpoints.",
    agent=pm,
    expected_output="Architecture description with component list"
)

task_backend = Task(
    description="Implement REST API for TODO: create, read, update, delete tasks. Use FastAPI.",
    agent=developer,
    expected_output="Python code for the API"
)

task_test = Task(
    description="Write tests for the API. Test all CRUD operations, including edge cases.",
    agent=qa,
    expected_output="pytest test file"
)

5. Run the team

crew = Crew(
    agents=[pm, analyst, developer, qa],
    tasks=[task_analyze, task_architect, task_backend, task_test],
    process=Process.hierarchical,  # PM manages the team
    manager_llm=llm,
    verbose=True
)

result = crew.kickoff()
print(result)

Save as team.py and run:

python team.py

The PM will coordinate: analyst works first, then architect, then developer, then QA.


6. Whats next

| Go to | Description | |β€”β€”-|β€”β€”β€”β€”-| | 03-coding-agent.md | Coding agent with LangGraph | | multi-agent.md | Multi-agent architecture deep dive | | memory.md | Setting up team memory | | Back | README.md | β€”


In section: 01-first-agent Β· 02-agent-team Β· 03-coding-agent
Related sections: AI Agents Β· Zero Level Β· Local Models
Navigation: ← Tutorials Β· ↑ Back to main Β· πŸ‡·πŸ‡Ί Русский