Goal: Build the same multi-agent task two ways — once as a centralized supervisor hierarchy and once as a decentralized peer-to-peer swarm — using langgraph-supervisor, running entirely on free/local tools (Ollama or a free-tier hosted model). Trace which agent handled each step in both versions, and compare the control-vs-flexibility trade-offs directly.
llama3.1:8b or similar). In a fresh Python virtual environment, install langgraph, langgraph-supervisor, and your LLM client library.langgraph-supervisor, create a top-level supervisor agent that receives a multi-part user request (design a prompt that genuinely needs both specialists, e.g., "Look up the current population of X and calculate what a 3% annual growth rate would produce in 10 years"). Use create_handoff_tool to let the supervisor hand off to each specialist, and have the supervisor aggregate both results into one final answer.print statements or LangGraph's built-in tracing/callbacks are fine) that records, for each step: which agent acted, what it received, and what it returned. Run your test prompt through the supervisor version and save the trace.Deliverables: Submit your two working scripts (or one script with a config flag toggling architecture), both traced run logs, and your written comparison, either as an upload (.py/.ipynb + .txt/.md files, zipped) or pasted directly into the text-entry box.