Multi-Agent Systems
Hands-on lab with starter code you can copy + run, and guided steps to produce the artifact for this module.
Setup
- Open a fresh terminal in a new folder, e.g.
mkdir lab-5 && cd lab-5. - Create a Python 3.11 venv:
python -m venv .venv && source .venv/bin/activate. - Install the dependencies noted on each starter snippet (the small pip install … line above the code).
- Copy each starter into a file with the suggested name, then run it and capture the output.
Starter code
from openai import OpenAI
c = OpenAI()
def speak(role, history):
return c.chat.completions.create(
model="gpt-5-mini",
messages=[{"role":"system","content":f"You are {role}."},
{"role":"user","content":history}],
).choices[0].message.content
def debate(topic, rounds=3):
history = f"Topic: {topic}\n"
for _ in range(rounds):
history += "\nPRO: " + speak("a debater arguing FOR", history)
history += "\nCON: " + speak("a debater arguing AGAINST", history)
verdict = speak("an impartial judge giving a 1-paragraph verdict", history)
return verdict
print(debate("Should agents have persistent memory by default?"))python 05_01_lab.pyGuided steps
Work through each step in order. Stop when your output matches the expected artifact — then push your work to your lab folder.
- 1Debate-and-judge
Do — Build PRO/CON debaters and an impartial judge. Run on 5 contested questions.
Expected artifact — debate.md with full transcripts and a 1-paragraph verdict for each.
Run free: - 2Specialist team
Do — Compose 3 agents (Researcher, Coder, Critic). Have them produce a 50-line Python utility.
Expected artifact — util.py file plus a transcript showing each agent's contribution.
Run free: - 3Coordination failure log
Do — Force 5 cases where agents loop or contradict. Document patterns and your fix.
Expected artifact — coord_failures.md with case, symptom, root cause, fix.
Run free:
Authoritative sources
Independent primary sources used to check and corroborate the guidance on this page.
- NIST National Initiative for Cybersecurity Education (NICE)
US national framework for cybersecurity work roles and competencies.
- Financial Action Task Force (FATF)
Global AML/CFT standards referenced by financial-crime curricula.
- FBI Internet Crime Complaint Center — Annual Reports
Primary loss and typology data used in fraud-investigation training.
- US Federal Trade Commission — Consumer Sentinel Data Book
Official complaint statistics for teaching fraud trend analysis.
