{
  "id": 5644865,
  "title": "From Software Engineer to AI Engineer - Part 6: Closing the loop",
  "url": "https://urgent.news/2026/09/04/from-software-engineer-to-ai-engineer-part-6-closing-the-loop",
  "topic": "ai",
  "section": "AI",
  "published": "2026-09-04T20:57:00.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/bjornvdlaan/from-software-engineer-to-ai-engineer-part-6-closing-the-loop-3gba"
  },
  "original_language": "en",
  "account": "In the final part of the series, the author explains the concept of agent loops and how they enable AI systems to adapt dynamically to varying user prompts and retrieval results. Unlike single-shot systems that follow a fixed sequence of tool calls, agent loops allow the system to reason about what actions to take next based on the conversation history, tool catalog, and system prompt.\n\nThe author introduces the ReAct pattern, where the model alternates between reasoning about the next action and invoking tools to execute that action. This is similar to the logic seen in previous parts of the series, where the model reads the conversation context, determines if it needs to call a tool, and then executes the tool-call response.\n\nThe author emphasizes that the harness of an AI system, which includes the system prompt, tool catalog, middleware, and the agent loop itself, is the responsibility of an AI engineer to design. The author compares the model to Tony Stark and the harness to Iron Man's suit, highlighting the importance of the harness in shaping the behavior of the AI system.\n\nNext, the author demonstrates how to build a simple agent using LangChain's `create_agent` function, which automatically handles the loop of reasoning and acting based on the provided tools and system prompt. The author provides an example `agent_0.py` script that creates a simple payment refund assistant using LangChain tools and the ReAct pattern.\n\nThe key points of the article are:\n1. Agent loops allow AI systems to dynamically adapt their behavior based on the conversation context and tool results.\n2. The ReAct pattern enables the model to reason about the next action and then execute that action through tool calls.\n3. The harness of an AI system includes the system prompt, tool catalog, middleware, and agent loop, and it is the responsibility of the AI engineer to design this harness.\n4. LangChain's `create_agent` function abstracts away the loop logic, allowing developers to focus on defining the system prompt, tools, and the model to use.",
  "summary": "Everything so far has been single-shot. One call in, one result out, with us gluing the pieces together. But what if we get a realistically complex prompt: \"Tell me how much it costs to refund 100 euros to a European consumer card. Then issue a full refund of 100 euros for payment with id abc123 and write a confirmation email to the customer.\" Answering that means searching the knowledge base for…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}