Why Developers Are Building Multi-Agent AI Systems With Plain Python First
Building multi-agent AI systems doesn't always require sophisticated frameworks; developers can start with plain Python to coordinate multiple specialized AI agents working together on a single task. A practical tutorial from FreeCodeCamp demonstrates how to construct a study guide generator using three focused agents, each handling a distinct responsibility, without any orchestration framework overhead.
When Should You Split One AI Agent Into Multiple Agents?
The decision to use multiple agents versus a single agent depends on task complexity and whether responsibilities naturally separate. As the tutorial explains, a single large language model (LLM), which is an AI system trained on vast amounts of text to understand and generate human language, can handle surprisingly complex tasks with one prompt. However, as workflows grow more intricate, asking one agent to do too many things at once makes the system harder to maintain, extend, and reason about, especially when using smaller local models.
Multi-agent systems make sense when a task naturally breaks into distinct steps or roles. The tutorial uses a study guide generator as an example, where the workflow naturally divides into planning, writing, and reviewing. Each agent becomes a specialist with its own focused prompt and responsibility, making it easier for smaller models to follow instructions consistently.
How to Build a Multi-Agent System in Python
The tutorial demonstrates two approaches to building the same study guide system. The first approach uses plain Python code to coordinate three specialized agents without any framework. The second uses LangGraph, a workflow framework that models the system as a graph with nodes, edges, and shared state. Both versions accomplish the same goal, but they reveal important tradeoffs.
The plain Python version requires minimal code. Each agent is simply a focused LLM call with its own system prompt. A helper function coordinates the workflow by calling agents in sequence and passing each output to the next step. For fixed sequence workflows like this study guide generator, plain Python often proves to be the best starting point because it requires less setup and introduces no framework complexity.
The three agents in the workflow each handle a specific part of the task:
- Planner Agent: Breaks the topic into three short study sections, creating a logical outline that the other agents can build upon.
- Teacher Agent: Transforms the outline into concise, beginner-friendly study notes that explain each section clearly and simply.
- Quiz Writer Agent: Generates three review questions based on the notes to help reinforce the material for learners.
The tutorial uses Ollama, a tool that lets developers run large language models locally on their own machines, paired with the Qwen 3.5 model. This setup eliminates API costs and allows the system to run entirely on a developer's computer. The tutorial works on macOS, Windows, and Linux, though it recommends at least 32 gigabytes of RAM for optimal performance, though smaller models can run on machines with less memory.
When Does a Framework Like LangGraph Add Value?
While plain Python works well for simple sequential workflows, frameworks like LangGraph provide benefits as systems grow more complex. In the LangGraph version, each specialist agent becomes a node in a graph, the shared dictionary becomes graph state, and the execution order becomes edges connecting nodes. Instead of a controller function manually calling agents in sequence, the flow is defined as a graph that moves from start to planner to teacher to quiz to end.
The key insight from the tutorial is that frameworks excel when workflows become non-linear or require features like memory, tool calling, or complex patterns. For straightforward sequential tasks, however, the overhead of learning and implementing a framework may introduce unnecessary complexity and latency. The tutorial intentionally keeps the system simple, with no memory or tool calling, to demonstrate the fundamental building blocks of multi-agent systems.
Developers working with local models like Qwen can see immediate results without waiting for API responses or paying per-token fees. The tutorial shows that even smaller models can produce reliable output when given focused, specialized prompts rather than trying to handle multiple responsibilities simultaneously. This approach makes multi-agent systems more accessible to developers who want to experiment with AI agents without relying on expensive cloud-based services.