## Short Segments Today, we're diving into the mechanics of AI agent loops and the economics behind them. Coming up, we'll explore how a new open-source course maps out three distinct ways to run an agent loop, each with its own provider economics. This development could reshape how teams approach AI deployment strategies. ## Feature Story Decoding AI's open-source course reveals three distinct ways to run an agent loop, each with unique provider economics. This insight could fundamentally change how teams approach AI deployment. Traditionally, teams have focused on selecting the right model as the key decision in AI deployment. However, recent findings from LangChain's Terminal-Bench experiment suggest that the harness, or the way the model is run, can significantly impact performance. In this experiment, simply changing the harness moved a coding agent from roughly 30th place into the top 5, using the same model throughout. This shift in perspective highlights the importance of how the agent loop is run, making it an architectural decision rather than a mere deployment detail. Paul Iusztin's open-source course, "Building a Coding Agent From Scratch," delves into this concept by constructing a Python agent named Decode. The course, published through Decoding AI, outlines three different run modes, each with its own latency profile and corresponding inference provider requirements. The core of the system is a headless harness, which operates without its own interface. Within this harness, the agent loop functions by having the LLM select an action, a tool execute it, and then feeding the observation back into the system. This loop reads from and writes to the context window, forming the backbone of the agent's operation. The agent itself is relatively small. In the Decode system, it consists of a roughly 20-line Pydantic AI definition that combines a model, tools, and an output type. In contrast, Claude Code's leaked source reveals a core loop of about 150 lines. The rest of the system, including memory, skills, sandbox, permissions, LSP feedback, and compaction, is part of the harness. Interfaces are then integrated into this core system. This modular approach allows for flexibility and adaptability in how the agent operates, depending on the specific requirements of the task at hand. The implications of this development are significant. By understanding the different ways to run an agent loop and the economics behind each, teams can make more informed decisions about their AI deployment strategies. This could lead to more efficient and effective use of AI resources, ultimately improving performance and reducing costs. Moreover, this approach aligns with the broader trend of open-source tools gaining traction in the AI community. As more organizations look to leverage AI for various applications, having access to open-source resources like this course can democratize the technology, making it more accessible to a wider range of users. In conclusion, the insights provided by Decoding AI's course offer a new perspective on AI deployment. By focusing on the harness and the agent loop, rather than just the model, teams can optimize their AI systems for better performance and cost-effectiveness. This development is a step forward in the ongoing evolution of AI technology, providing valuable tools and knowledge for those looking to harness the power of AI in their work. That's all for today's episode of Impact Vector. Stay tuned for more insights into the world of AI tools and technologies. Until next time, keep exploring the possibilities of AI.